Go to the source code of this file.
◆ csqrt()
Square root of complex number.
Definition at line 42 of file csqrt.c.
References cabs(), cimag(), cpack(), creal(), fabs(), and sqrt().
Referenced by cacos(), cacosh(), cacsc(), cacsch(), casec(), casech(), casin(), casinh(), and ComplexNumber::SquareRoot().
45 double x, y, r, t, scale;
82 if ((
fabs(x) > 4.0) || (
fabs(y) > 4.0))
91 x *= 1.8014398509481984e16;
92 y *= 1.8014398509481984e16;
93 scale = 7.450580596923828125e-9;
104 t =
sqrt(0.5 * r + 0.5 * x);
105 r = scale *
fabs((0.5 * y) / t);
110 r =
sqrt(0.5 * r - 0.5 * x);
111 t = scale *
fabs((0.5 * y) / r);
complex cpack(double x, double y)
Pack two real numbers into a complex number.
double cimag(complex z)
Imaginary part of complex number.
double creal(complex z)
Real part of complex number.
double sqrt(double x)
Square root function.
double fabs(double x)
Returns the absolute value of x.
double cabs(complex z)
Absolute value of complex number.