\left(\left(\left(e + d\right) + c\right) + b\right) + a
\mathsf{fma}\left(b, 1 + \mathsf{fma}\left(\frac{d}{b} + \left(\frac{c}{b} + \frac{e}{b}\right), 1, 0\right), a\right)
(FPCore (a b c d e) :precision binary64 (+ (+ (+ (+ e d) c) b) a))
(FPCore (a b c d e) :precision binary64 (fma b (+ 1.0 (fma (+ (/ d b) (+ (/ c b) (/ e b))) 1.0 0.0)) a))
double code(double a, double b, double c, double d, double e) {
return (((e + d) + c) + b) + a;
}
double code(double a, double b, double c, double d, double e) {
return fma(b, (1.0 + fma(((d / b) + ((c / b) + (e / b))), 1.0, 0.0)), a);
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d




Bits error versus e
| Original | 0.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 0.4
Applied egg-rr0.5
Applied egg-rr0.4
Taylor expanded in b around 0 0.4
Simplified0.3
Applied egg-rr0.3
Final simplification0.3
herbie shell --seed 2022127
(FPCore (a b c d e)
:name "Expression 1, p15"
:precision binary64
:pre (and (and (and (and (and (and (and (and (and (<= 1.0 a) (<= a 2.0)) (<= 2.0 b)) (<= b 4.0)) (<= 4.0 c)) (<= c 8.0)) (<= 8.0 d)) (<= d 16.0)) (<= 16.0 e)) (<= e 32.0))
:herbie-target
(+ (+ d (+ c (+ a b))) e)
(+ (+ (+ (+ e d) c) b) a))