\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot 3\right) + \left(-2 \cdot {x}^{3}\right)double f(double x) {
double r731206 = x;
double r731207 = r731206 * r731206;
double r731208 = 3.0;
double r731209 = 2.0;
double r731210 = r731206 * r731209;
double r731211 = r731208 - r731210;
double r731212 = r731207 * r731211;
return r731212;
}
double f(double x) {
double r731213 = x;
double r731214 = 3.0;
double r731215 = r731213 * r731214;
double r731216 = r731213 * r731215;
double r731217 = 2.0;
double r731218 = 3.0;
double r731219 = pow(r731213, r731218);
double r731220 = r731217 * r731219;
double r731221 = -r731220;
double r731222 = r731216 + r731221;
return r731222;
}




Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Simplified0.1
rmApplied associate-*l*0.1
Final simplification0.1
herbie shell --seed 2020062
(FPCore (x)
:name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
:precision binary64
:herbie-target
(* x (* x (- 3 (* x 2))))
(* (* x x) (- 3 (* x 2))))