|
|
1.1 ! root 1: #include "f2c.h" ! 2: ! 3: #ifdef KR_headers ! 4: double log(), exp(), cos(), sin(), atan2(), f__cabs(); ! 5: VOID pow_zz(r,a,b) doublecomplex *r, *a, *b; ! 6: #else ! 7: #undef abs ! 8: #include "math.h" ! 9: extern double f__cabs(double,double); ! 10: void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b) ! 11: #endif ! 12: { ! 13: double logr, logi, x, y; ! 14: ! 15: logr = log( f__cabs(a->r, a->i) ); ! 16: logi = atan2(a->i, a->r); ! 17: ! 18: x = exp( logr * b->r - logi * b->i ); ! 19: y = logr * b->i + logi * b->r; ! 20: ! 21: r->r = x * cos(y); ! 22: r->i = x * sin(y); ! 23: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.