\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 r30231168 = x;
double r30231169 = r30231168 * r30231168;
double r30231170 = 3.0;
double r30231171 = 2.0;
double r30231172 = r30231168 * r30231171;
double r30231173 = r30231170 - r30231172;
double r30231174 = r30231169 * r30231173;
return r30231174;
}
double f(double x) {
double r30231175 = x;
double r30231176 = 3.0;
double r30231177 = r30231175 * r30231176;
double r30231178 = 2.0;
double r30231179 = r30231175 * r30231175;
double r30231180 = r30231178 * r30231179;
double r30231181 = r30231177 - r30231180;
double r30231182 = r30231175 * r30231181;
return r30231182;
}




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 2019172 +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))))