// ellip_acdf() // // complex elliptic inverse cd() function (Jacobian elliptic // arc cosine) // // _w : vector in the complex u-plane // _k : elliptic modulus (0 <= _k < 1) // _n : number of Landen iterations (typically 5-6) float complex ellip_acdf(float complex _w, float _k, unsigned int _n) { float v[_n]; landenf(_k,_n,v); float v1; float complex w = _w; unsigned int i; for (i=0; i<_n; i++) { v1 = (i==0) ? _k : v[i-1]; w = w / (1 + liquid_csqrtf(1 - w*w*v1*v1)) * 2.0 / (1+v[i]); //printf(" w[%3u] = %12.8f + j*%12.8f\n", i, crealf(w), cimagf(w)); } float complex u = liquid_cacosf(w) * 2.0 / M_PI; //printf(" u = %12.8f + j*%12.8f\n", crealf(u), cimagf(u)); #if 0 float K, Kp; ellipkf(_k, _n, &K, &Kp); float R = Kp / K; #endif return u; }
// complex arcsin float complex liquid_casinf(float complex _z) { return 0.5f*M_PI - liquid_cacosf(_z); }