a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(c, a, a \cdot \left(b + d\right)\right)double f(double a, double b, double c, double d) {
double r4539553 = a;
double r4539554 = b;
double r4539555 = c;
double r4539556 = r4539554 + r4539555;
double r4539557 = d;
double r4539558 = r4539556 + r4539557;
double r4539559 = r4539553 * r4539558;
return r4539559;
}
double f(double a, double b, double c, double d) {
double r4539560 = c;
double r4539561 = a;
double r4539562 = b;
double r4539563 = d;
double r4539564 = r4539562 + r4539563;
double r4539565 = r4539561 * r4539564;
double r4539566 = fma(r4539560, r4539561, r4539565);
return r4539566;
}




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 add-sqr-sqrt0.5
rmApplied sqrt-prod0.5
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019179 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789.0 a 98765.0) (<= 0.0 b 1.0) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))