|
|
@ -26,43 +26,7 @@ int NIpzK_mag; |
|
|
int |
|
|
int |
|
|
NIpzSym(PZtrial **set, PZtrial *new) |
|
|
NIpzSym(PZtrial **set, PZtrial *new) |
|
|
{ |
|
|
{ |
|
|
double a, b, c, x0, x1; |
|
|
|
|
|
double dx0, dx1; |
|
|
|
|
|
int a_mag, b_mag, c_mag; |
|
|
|
|
|
|
|
|
|
|
|
dx0 = set[1]->s.real - set[0]->s.real; |
|
|
|
|
|
dx1 = set[2]->s.real - set[1]->s.real; |
|
|
|
|
|
|
|
|
|
|
|
zaddeq(&a, &a_mag, set[1]->f_def.real, set[1]->mag_def, |
|
|
|
|
|
-set[0]->f_def.real, set[0]->mag_def); |
|
|
|
|
|
a /= dx0; |
|
|
|
|
|
zaddeq(&b, &b_mag, set[2]->f_def.real, set[2]->mag_def, |
|
|
|
|
|
-set[1]->f_def.real, set[1]->mag_def); |
|
|
|
|
|
b /= dx1; |
|
|
|
|
|
zaddeq(&c, &c_mag, b, b_mag, -a, a_mag); |
|
|
|
|
|
|
|
|
|
|
|
/* XXX What if c == 0.0 ? */ |
|
|
|
|
|
|
|
|
|
|
|
x0 = (set[0]->s.real + set[1]->s.real) / 2.0; |
|
|
|
|
|
x1 = (set[1]->s.real + set[2]->s.real) / 2.0; |
|
|
|
|
|
|
|
|
|
|
|
c /= (x1 - x0); |
|
|
|
|
|
|
|
|
|
|
|
new->s.real = - a / c; |
|
|
|
|
|
c_mag -= a_mag; |
|
|
|
|
|
|
|
|
|
|
|
new->s.imag = 0.0; |
|
|
|
|
|
|
|
|
|
|
|
while (c_mag > 0) { |
|
|
|
|
|
new->s.real /= 2.0; |
|
|
|
|
|
c_mag -= 1; |
|
|
|
|
|
} |
|
|
|
|
|
while (c_mag < 0) { |
|
|
|
|
|
new->s.real *= 2.0; |
|
|
|
|
|
c_mag += 1; |
|
|
|
|
|
} |
|
|
|
|
|
new->s.real += set[0]->s.real; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
return NIpzSym2(set, new); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int |
|
|
int |
|
|
|