\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 r1437 = 3.0;
double r1438 = 2.0;
double r1439 = x;
double r1440 = r1439 * r1437;
double r1441 = r1438 - r1440;
double r1442 = r1437 * r1441;
double r1443 = r1442 * r1439;
return r1443;
}
double f(double x) {
double r1444 = x;
double r1445 = 6.0;
double r1446 = 9.0;
double r1447 = r1444 * r1446;
double r1448 = r1445 - r1447;
double r1449 = r1444 * r1448;
return r1449;
}




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))