| 61 | } |
| 62 | |
| 63 | int solveCubic(double x[3], double a, double b, double c, double d) { |
| 64 | if (a != 0) { |
| 65 | double bn = b/a; |
| 66 | if (fabs(bn) < 1e6) // Above this ratio, the numerical error gets larger than if we treated a as zero |
| 67 | return solveCubicNormed(x, bn, c/a, d/a); |
| 68 | } |
| 69 | return solveQuadratic(x, b, c, d); |
| 70 | } |
| 71 | |
| 72 | } |
no test coverage detected