\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
6 \cdot x + \left(-9 \cdot {x}^{2}\right)double f(double x) {
double r503823 = 3.0;
double r503824 = 2.0;
double r503825 = x;
double r503826 = r503825 * r503823;
double r503827 = r503824 - r503826;
double r503828 = r503823 * r503827;
double r503829 = r503828 * r503825;
return r503829;
}
double f(double x) {
double r503830 = 6.0;
double r503831 = x;
double r503832 = r503830 * r503831;
double r503833 = 9.0;
double r503834 = 2.0;
double r503835 = pow(r503831, r503834);
double r503836 = r503833 * r503835;
double r503837 = -r503836;
double r503838 = r503832 + r503837;
return r503838;
}




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