\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\left(\log \left(e^{c + \left(a + d\right)}\right) + b\right) \cdot 2
(FPCore (a b c d) :precision binary64 (* (+ a (+ b (+ c d))) 2.0))
(FPCore (a b c d) :precision binary64 (* (+ (log (exp (+ c (+ a d)))) b) 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 (log(exp(c + (a + d))) + b) * 2.0;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.9 |
| Herbie | 0 |
Initial program 3.7
Applied add-log-exp_binary643.7
Applied add-log-exp_binary643.7
Applied sum-log_binary643.7
Applied add-log-exp_binary643.7
Applied sum-log_binary642.8
Applied add-log-exp_binary642.8
Applied sum-log_binary641.5
Taylor expanded in b around 0 0.1
Taylor expanded in d around inf 0.1
Simplified0
Final simplification0
herbie shell --seed 2022076
(FPCore (a b c d)
:name "Expression, p6"
:precision binary64
:pre (and (and (and (and (<= -14.0 a) (<= a -13.0)) (and (<= -3.0 b) (<= b -2.0))) (and (<= 3.0 c) (<= c 3.5))) (and (<= 12.5 d) (<= d 13.5)))
:herbie-target
(+ (* (+ a b) 2.0) (* (+ c d) 2.0))
(* (+ a (+ b (+ c d))) 2.0))