3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
{x}^{2} \cdot 9 + \left(3 - 12 \cdot x\right)double code(double x) {
return ((double) (3.0 * ((double) (((double) (((double) (((double) (x * 3.0)) * x)) - ((double) (x * 4.0)))) + 1.0))));
}
double code(double x) {
return ((double) (((double) (((double) pow(x, 2.0)) * 9.0)) + ((double) (3.0 - ((double) (12.0 * x))))));
}




Bits error versus x
Results
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
Taylor expanded around 0 0.1
Simplified0.1
rmApplied fma-udef0.1
Final simplification0.1
herbie shell --seed 2020121 +o rules:numerics
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(+ 3 (- (* (* 9 x) x) (* 12 x)))
(* 3 (+ (- (* (* x 3) x) (* x 4)) 1)))