200 |
D = QQQ - R*R; |
D = QQQ - R*R; |
201 |
if (D > epsilon) { |
if (D > epsilon) { |
202 |
/* three distinct roots- this is the most common case */ |
/* three distinct roots- this is the most common case */ |
203 |
double mm, ss, cc; |
Diderot_real_t mm, ss, cc; |
204 |
theta = ATAN2(SQRT(D), R)/3.0; |
theta = ATAN2(SQRT(D), R)/3.0; |
205 |
mm = SQRT(Q); |
mm = SQRT(Q); |
206 |
ss = SIN(theta); |
ss = SIN(theta); |
212 |
} |
} |
213 |
/* else D is near enough to zero */ |
/* else D is near enough to zero */ |
214 |
else if (R < -epsilon || epsilon < R) { |
else if (R < -epsilon || epsilon < R) { |
215 |
double U; |
Diderot_real_t U; |
216 |
/* one double root and one single root */ |
/* one double root and one single root */ |
217 |
U = CBRT(R); /* cube root function */ |
U = CBRT(R); /* cube root function */ |
218 |
if (U > 0) { |
if (U > 0) { |
300 |
D = QQQ - R*R; |
D = QQQ - R*R; |
301 |
if (D > epsilon) { |
if (D > epsilon) { |
302 |
/* three distinct roots- this is the most common case */ |
/* three distinct roots- this is the most common case */ |
303 |
double mm, ss, cc; |
Diderot_real_t mm, ss, cc; |
304 |
theta = ATAN2(SQRT(D), R)/3.0; |
theta = ATAN2(SQRT(D), R)/3.0; |
305 |
mm = SQRT(Q); |
mm = SQRT(Q); |
306 |
ss = SIN(theta); |
ss = SIN(theta); |
312 |
} |
} |
313 |
/* else D is near enough to zero */ |
/* else D is near enough to zero */ |
314 |
else if (R < -epsilon || epsilon < R) { |
else if (R < -epsilon || epsilon < R) { |
315 |
double U; |
Diderot_real_t U; |
316 |
/* one double root and one single root */ |
/* one double root and one single root */ |
317 |
U = CBRT(R); /* cube root function */ |
U = CBRT(R); /* cube root function */ |
318 |
if (U > 0) { |
if (U > 0) { |