a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(b, a, \left(c \cdot a + a \cdot d\right)\right)double f(double a, double b, double c, double d) {
double r11471848 = a;
double r11471849 = b;
double r11471850 = c;
double r11471851 = r11471849 + r11471850;
double r11471852 = d;
double r11471853 = r11471851 + r11471852;
double r11471854 = r11471848 * r11471853;
return r11471854;
}
double f(double a, double b, double c, double d) {
double r11471855 = b;
double r11471856 = a;
double r11471857 = c;
double r11471858 = r11471857 * r11471856;
double r11471859 = d;
double r11471860 = r11471856 * r11471859;
double r11471861 = r11471858 + r11471860;
double r11471862 = fma(r11471855, r11471856, r11471861);
return r11471862;
}




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