a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(b + c, a, d \cdot a\right)double f(double a, double b, double c, double d) {
double r63819 = a;
double r63820 = b;
double r63821 = c;
double r63822 = r63820 + r63821;
double r63823 = d;
double r63824 = r63822 + r63823;
double r63825 = r63819 * r63824;
return r63825;
}
double f(double a, double b, double c, double d) {
double r63826 = b;
double r63827 = c;
double r63828 = r63826 + r63827;
double r63829 = a;
double r63830 = d;
double r63831 = r63830 * r63829;
double r63832 = fma(r63828, r63829, r63831);
return r63832;
}




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
rmApplied distribute-lft-in0.0
Simplified0.0
Simplified0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019323 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:precision binary64
:pre (and (<= 56789 a 98765) (<= 0.0 b 1) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))