\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\left(c + \log \left(\left(e^{d} \cdot e^{b}\right) \cdot e^{a}\right)\right) \cdot 2
(FPCore (a b c d) :precision binary64 (* (+ a (+ b (+ c d))) 2.0))
(FPCore (a b c d) :precision binary64 (* (+ c (log (* (* (exp d) (exp b)) (exp a)))) 2.0))
double code(double a, double b, double c, double d) {
return (a + (b + (c + d))) * 2.0;
}
double code(double a, double b, double c, double d) {
return (c + log((exp(d) * exp(b)) * exp(a))) * 2.0;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.8 |
| Herbie | 0.1 |
Initial program 3.7
Taylor expanded around 0 2.8
Simplified2.8
rmApplied add-log-exp_binary642.8
Applied add-log-exp_binary642.8
Applied add-log-exp_binary642.8
Applied sum-log_binary642.8
Applied sum-log_binary640.1
Final simplification0.1
herbie shell --seed 2021196
(FPCore (a b c d)
:name "Expression, p6"
:precision binary64
:pre (and (<= -14.0 a -13.0) (<= -3.0 b -2.0) (<= 3.0 c 3.5) (<= 12.5 d 13.5))
:herbie-target
(+ (* (+ a b) 2.0) (* (+ c d) 2.0))
(* (+ a (+ b (+ c d))) 2.0))