arb/acb_modular/elliptic_k.c
2016-04-26 17:20:05 +02:00

28 lines
711 B
C

/*
Copyright (C) 2014 Fredrik Johansson
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include "acb_modular.h"
void
acb_modular_elliptic_k(acb_t k, const acb_t m, slong prec)
{
acb_t t;
acb_init(t);
acb_sub_ui(t, m, 1, prec);
acb_neg(t, t);
acb_sqrt(t, t, prec);
acb_agm1(k, t, prec);
acb_const_pi(t, prec);
acb_div(k, t, k, prec);
acb_mul_2exp_si(k, k, -1);
acb_clear(t);
}