//## Complex Complex.csinf(); static KMETHOD Complex_csinf(KonohaContext *kctx, KonohaStack *sfp) { kComplex *kc = (kComplex *) sfp[0].asObject; float _Complex zf = (float _Complex)kc->z; float ret = csinf(zf); KReturnFloatValue(ret); }
// ellip_snf() // // complex elliptic sn() function (Jacobian elliptic sine) // // _u : vector in the complex u-plane // _k : elliptic modulus (0 <= _k < 1) // _n : number of Landen iterations (typically 5-6) float complex ellip_snf(float complex _u, float _k, unsigned int _n) { float complex wn = csinf(_u*M_PI*0.5f); float v[_n]; landenf(_k,_n,v); unsigned int i; for (i=_n; i>0; i--) { wn = (1 + v[i-1])*wn / (1 + v[i-1]*wn*wn); } return wn; }
ld = cacosl(ld); TEST_TRACE(C99 7.3.5.2) d = casin(d); f = casinf(f); ld = casinl(ld); TEST_TRACE(C99 7.3.5.3) d = catan(d); f = catanf(f); ld = catanl(ld); TEST_TRACE(C99 7.3.5.4) d = ccos(d); f = ccosf(f); ld = ccosl(ld); TEST_TRACE(C99 7.3.5.5) d = csin(d); f = csinf(f); ld = csinl(ld); TEST_TRACE(C99 7.3.5.6) d = ctan(d); f = ctanf(f); ld = ctanl(ld); TEST_TRACE(C99 7.3.6.1) d = cacosh(d); f = cacoshf(f); ld = cacoshl(ld); TEST_TRACE(C99 7.3.6.2) d = casinh(d); f = casinhf(f); ld = casinhl(ld); TEST_TRACE(C99 7.3.6.3) d = catanh(d);
void docomplexf (void) { #ifndef NO_FLOAT complex float ca, cb, cc; float f1; ca = 1.0 + 1.0 * I; cb = 1.0 - 1.0 * I; f1 = cabsf (ca); fprintf (stdout, "cabsf : %f\n", f1); cc = cacosf (ca); fprintf (stdout, "cacosf : %f %fi\n", crealf (cc), cimagf (cc)); cc = cacoshf (ca); fprintf (stdout, "cacoshf: %f %fi\n", crealf (cc), cimagf (cc)); f1 = cargf (ca); fprintf (stdout, "cargf : %f\n", f1); cc = casinf (ca); fprintf (stdout, "casinf : %f %fi\n", crealf (cc), cimagf (cc)); cc = casinhf (ca); fprintf (stdout, "casinhf: %f %fi\n", crealf (cc), cimagf (cc)); cc = catanf (ca); fprintf (stdout, "catanf : %f %fi\n", crealf (cc), cimagf (cc)); cc = catanhf (ca); fprintf (stdout, "catanhf: %f %fi\n", crealf (cc), cimagf (cc)); cc = ccosf (ca); fprintf (stdout, "ccosf : %f %fi\n", crealf (cc), cimagf (cc)); cc = ccoshf (ca); fprintf (stdout, "ccoshf : %f %fi\n", crealf (cc), cimagf (cc)); cc = cexpf (ca); fprintf (stdout, "cexpf : %f %fi\n", crealf (cc), cimagf (cc)); f1 = cimagf (ca); fprintf (stdout, "cimagf : %f\n", f1); cc = clogf (ca); fprintf (stdout, "clogf : %f %fi\n", crealf (cc), cimagf (cc)); cc = conjf (ca); fprintf (stdout, "conjf : %f %fi\n", crealf (cc), cimagf (cc)); cc = cpowf (ca, cb); fprintf (stdout, "cpowf : %f %fi\n", crealf (cc), cimagf (cc)); cc = cprojf (ca); fprintf (stdout, "cprojf : %f %fi\n", crealf (cc), cimagf (cc)); f1 = crealf (ca); fprintf (stdout, "crealf : %f\n", f1); cc = csinf (ca); fprintf (stdout, "csinf : %f %fi\n", crealf (cc), cimagf (cc)); cc = csinhf (ca); fprintf (stdout, "csinhf : %f %fi\n", crealf (cc), cimagf (cc)); cc = csqrtf (ca); fprintf (stdout, "csqrtf : %f %fi\n", crealf (cc), cimagf (cc)); cc = ctanf (ca); fprintf (stdout, "ctanf : %f %fi\n", crealf (cc), cimagf (cc)); cc = ctanhf (ca); fprintf (stdout, "ctanhf : %f %fi\n", crealf (cc), cimagf (cc)); #endif }
TEST(complex, csinf) { ASSERT_EQ(0.0, csinf(0)); }