\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot \left(6 - x \cdot 9\right)
double f(double x) {
double r931209 = 3.0;
double r931210 = 2.0;
double r931211 = x;
double r931212 = r931211 * r931209;
double r931213 = r931210 - r931212;
double r931214 = r931209 * r931213;
double r931215 = r931214 * r931211;
return r931215;
}
double f(double x) {
double r931216 = x;
double r931217 = 6.0;
double r931218 = 9.0;
double r931219 = r931216 * r931218;
double r931220 = r931217 - r931219;
double r931221 = r931216 * r931220;
return r931221;
}




Bits error versus x
Results
| Original | 0.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.3
rmApplied associate-*l*0.3
rmApplied add-cube-cbrt0.3
Applied associate-*l*0.5
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020025
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"
:precision binary64
:herbie-target
(- (* 6 x) (* 9 (* x x)))
(* (* 3 (- 2 (* x 3))) x))