5 extern double f__cabs (double, double);
7 pow_zz (doublecomplex
* r
, doublecomplex
* a
, doublecomplex
* b
)
9 double logr
, logi
, x
, y
;
11 if (a
->r
== 0.0 && a
->i
== 0.0)
13 /* Algorithm below doesn't cope. */
17 logr
= log (f__cabs (a
->r
, a
->i
));
18 logi
= atan2 (a
->i
, a
->r
);
20 x
= exp (logr
* b
->r
- logi
* b
->i
);
21 y
= logr
* b
->i
+ logi
* b
->r
;