\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
6 \cdot x + \left(-9\right) \cdot \left(x \cdot x\right)
double f(double x) {
double r702552 = 3.0;
double r702553 = 2.0;
double r702554 = x;
double r702555 = r702554 * r702552;
double r702556 = r702553 - r702555;
double r702557 = r702552 * r702556;
double r702558 = r702557 * r702554;
return r702558;
}
double f(double x) {
double r702559 = 6.0;
double r702560 = x;
double r702561 = r702559 * r702560;
double r702562 = 9.0;
double r702563 = -r702562;
double r702564 = r702560 * r702560;
double r702565 = r702563 * r702564;
double r702566 = r702561 + r702565;
return r702566;
}




Bits error versus x
Results
| Original | 0.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.3
rmApplied associate-*l*0.3
Taylor expanded around 0 0.2
Simplified0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Simplified0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020045 +o rules:numerics
(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))