a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, b, \mathsf{fma}\left(a, d, a \cdot c\right)\right)
(FPCore (a b c d) :precision binary64 (* a (+ (+ b c) d)))
(FPCore (a b c d) :precision binary64 (fma a b (fma a d (* a c))))
double code(double a, double b, double c, double d) {
return a * ((b + c) + d);
}
double code(double a, double b, double c, double d) {
return fma(a, b, fma(a, d, (a * c)));
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
Applied distribute-rgt-in_binary640.0
Taylor expanded in a around 0 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2022024
(FPCore (a b c d)
:name "Expression, p14"
:precision binary64
:pre (and (and (and (and (<= 56789.0 a) (<= a 98765.0)) (and (<= 0.0 b) (<= b 1.0))) (and (<= 0.0 c) (<= c 0.0016773))) (and (<= 0.0 d) (<= d 0.0016773)))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))