a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(d, a, \mathsf{fma}\left(a, b, a \cdot c\right)\right)double f(double a, double b, double c, double d) {
double r99497 = a;
double r99498 = b;
double r99499 = c;
double r99500 = r99498 + r99499;
double r99501 = d;
double r99502 = r99500 + r99501;
double r99503 = r99497 * r99502;
return r99503;
}
double f(double a, double b, double c, double d) {
double r99504 = d;
double r99505 = a;
double r99506 = b;
double r99507 = c;
double r99508 = r99505 * r99507;
double r99509 = fma(r99505, r99506, r99508);
double r99510 = fma(r99504, r99505, r99509);
return r99510;
}




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
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020060 +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)))