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




Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program Error: 0.2 bits
SimplifiedError: 0.2 bits
Final simplificationError: 0.2 bits
herbie shell --seed 2020204
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"
:precision binary64
:herbie-target
(- (* 6.0 x) (* 9.0 (* x x)))
(* (* 3.0 (- 2.0 (* x 3.0))) x))