1 #include "v3p_f2c.h"
2 
3 #ifdef KR_headers
4 double log(), exp(), cos(), sin(), atan2(), f__cabs();
pow_zz(r,a,b)5 VOID pow_zz(r,a,b) doublecomplex *r, *a, *b;
6 #else
7 #undef abs
8 #include "math.h"
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 extern double f__cabs(double,double);
13 void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
14 #endif
15 {
16 double logr, logi, x, y;
17 
18 logr = log( f__cabs(a->r, a->i) );
19 logi = atan2(a->i, a->r);
20 
21 x = exp( logr * b->r - logi * b->i );
22 y = logr * b->i + logi * b->r;
23 
24 r->r = x * cos(y);
25 r->i = x * sin(y);
26 }
27 #ifdef __cplusplus
28 }
29 #endif
30