\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)
double code(double x) {
return ((3.0 * (2.0 - (x * 3.0))) * x);
}
double code(double x) {
return (3.0 * ((2.0 - (x * 3.0)) * x));
}




Bits error versus x
Results
| Original | 0.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 0.3
rmApplied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2020100
(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))