d \cdot 10 + d \cdot 20
30 \cdot d
double f(double d) {
double r151217 = d;
double r151218 = 10.0;
double r151219 = r151217 * r151218;
double r151220 = 20.0;
double r151221 = r151217 * r151220;
double r151222 = r151219 + r151221;
return r151222;
}
double f(double d) {
double r151223 = 30.0;
double r151224 = d;
double r151225 = r151223 * r151224;
return r151225;
}




Bits error versus d
Results
| Original | 0.3 |
|---|---|
| Target | 0 |
| Herbie | 0 |
Initial program 0.3
Simplified0.1
Taylor expanded around 0 0
Final simplification0
herbie shell --seed 2020033 +o rules:numerics
(FPCore (d)
:name "FastMath test1"
:precision binary64
:herbie-target
(* d 30)
(+ (* d 10) (* d 20)))