\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot 3 - 2 \cdot \left(x \cdot x\right)\right)
double f(double x) {
double r33556198 = x;
double r33556199 = r33556198 * r33556198;
double r33556200 = 3.0;
double r33556201 = 2.0;
double r33556202 = r33556198 * r33556201;
double r33556203 = r33556200 - r33556202;
double r33556204 = r33556199 * r33556203;
return r33556204;
}
double f(double x) {
double r33556205 = x;
double r33556206 = 3.0;
double r33556207 = r33556205 * r33556206;
double r33556208 = 2.0;
double r33556209 = r33556205 * r33556205;
double r33556210 = r33556208 * r33556209;
double r33556211 = r33556207 - r33556210;
double r33556212 = r33556205 * r33556211;
return r33556212;
}




Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.2
rmApplied associate-*l*0.2
rmApplied flip--0.2
Applied associate-*r/0.2
Simplified0.2
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
:name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
:herbie-target
(* x (* x (- 3.0 (* x 2.0))))
(* (* x x) (- 3.0 (* x 2.0))))