\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
3 \cdot \left(x \cdot 2\right) - \left(3 \cdot 3\right) \cdot \left(x \cdot x\right)
double code(double x) {
return ((double) (((double) (3.0 * ((double) (2.0 - ((double) (x * 3.0)))))) * x));
}
double code(double x) {
return ((double) (((double) (3.0 * ((double) (x * 2.0)))) - ((double) (((double) (3.0 * 3.0)) * ((double) (x * 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
rmApplied sub-negError: 0.2 bits
Applied distribute-lft-inError: 0.2 bits
Applied distribute-lft-inError: 0.2 bits
SimplifiedError: 0.3 bits
rmApplied associate-*r*Error: 0.2 bits
Final simplificationError: 0.2 bits
herbie shell --seed 2020200
(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))