void z_log(doublecomplex *r, doublecomplex *z) #endif { double zi = z->i, zr = z->r; r->i = atan2(zi, zr); r->r = log( f__cabs( zr, zi ) ); }
void z_log(doublecomplex *r, doublecomplex *z) #endif { r->i = atan2(z->i, z->r); r->r = log( f__cabs( z->r, z->i ) ); }
void c_log(complex *r, complex *z) #endif { double zi, zr; r->i = atan2(zi = z->i, zr = z->r); r->r = log( f__cabs(zr, zi) ); }
/* PURE _scale_logc PURE */ complex _scale_logc(complex expr) { complex result; result.i = atan2(expr.i, expr.r); result.r = log(f__cabs(expr.r, expr.i)); return result; }
void c_log(complex *resx, complex *z) #endif { complex res; res.i = atan2(z->i, z->r); res.r = log( f__cabs(z->r, z->i) ); resx->r = res.r; resx->i = res.i; }
/* PURE _scale_pow_zz PURE */ void _scale_pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b) { double logr, logi, x, y; logr = log(f__cabs(a->r, a->i)); logi = atan2(a->i, a->r); x = exp(logr * b->r - logi * b->i); y = logr * b->i + logi * b->r; r->r = x * cos(y); r->i = x * sin(y); }
void z_sqrt(doublecomplex *r, doublecomplex *z) #endif { double mag, zi = z->i, zr = z->r; if( (mag = f__cabs(zr, zi)) == 0.) r->r = r->i = 0.; else if(zr > 0) { r->r = sqrt(0.5 * (mag + zr) ); r->i = zi / r->r / 2; } else { r->i = sqrt(0.5 * (mag - zr) ); if(zi < 0) r->i = - r->i; r->r = zi / r->i / 2; } }
void c_sqrt(complex *r, complex *z) #endif { double mag, t; if ((mag = f__cabs(z->r, z->i)) == 0.) r->r = r->i = 0.; else if (z->r > 0) { r->r = t = sqrt(0.5 * (mag + z->r)); t = z->i / t; r->i = 0.5 * t; } else { t = sqrt(0.5 * (mag - z->r)); if (z->i < 0) t = -t; r->i = t; t = z->i / t; r->r = 0.5 * t; } }
void c_sqrt(complex *r, complex *z) #endif { double mag, t; double zi = z->i, zr = z->r; if( (mag = f__cabs(zr, zi)) == 0.) r->r = r->i = 0.0f; else if(zr > 0) { r->r = (real)(t = sqrt(0.5 * (mag + zr) )); t = zi / t; r->i = (real)( 0.5 * t); } else { t = sqrt(0.5 * (mag - zr) ); if(zi < 0) t = -t; r->i = (real)t; t = zi / t; r->r = (real)(0.5 * t); } }
void c_log(complex *r, complex *z) #endif { r->i = atan2(z->i, z->r); r->r = log( f__cabs(z->r, z->i) ); }
double c_abs(complex *z) #endif { return( f__cabs( z->r, z->i ) ); }
double c_abs(complex *z) { return f__cabs(z->r, z->i); }
/* PURE _scale_absc PURE */ float _scale_absc(complex arg) { /* defined in libScaleF77 */ return f__cabs((double) arg.r, (double) arg.i); }
/** * Used by Fortran. */ float _scale_cabs(complex arg) { return f__cabs((double) arg.r, (double) arg.i); }
/* PURE _scale_absz PURE */ double _scale_absz(doublecomplex arg) { /* defined in libScaleF77 */ return f__cabs(arg.r, arg.i); }