1 /*
2     Copyright (C) 2014 Fredrik Johansson
3 
4     This file is part of Arb.
5 
6     Arb is free software: you can redistribute it and/or modify it under
7     the terms of the GNU Lesser General Public License (LGPL) as published
8     by the Free Software Foundation; either version 2.1 of the License, or
9     (at your option) any later version.  See <http://www.gnu.org/licenses/>.
10 */
11 
12 #include "acb_elliptic.h"
13 
14 void
acb_elliptic_k(acb_t k,const acb_t m,slong prec)15 acb_elliptic_k(acb_t k, const acb_t m, slong prec)
16 {
17     acb_t t;
18     acb_init(t);
19     acb_sub_ui(t, m, 1, prec);
20     acb_neg(t, t);
21     acb_sqrt(t, t, prec);
22     acb_agm1(k, t, prec);
23     acb_const_pi(t, prec);
24     acb_div(k, t, k, prec);
25     acb_mul_2exp_si(k, k, -1);
26     acb_clear(t);
27 }
28 
29