\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\left(\left(\log \left(e^{\left(\mathsf{fma}\left(x, y, z\right) - \left(z + x \cdot y\right)\right) - 1}\right)\right)\right)double f(double x, double y, double z) {
double r1408224 = x;
double r1408225 = y;
double r1408226 = z;
double r1408227 = fma(r1408224, r1408225, r1408226);
double r1408228 = 1.0;
double r1408229 = r1408224 * r1408225;
double r1408230 = r1408229 + r1408226;
double r1408231 = r1408228 + r1408230;
double r1408232 = r1408227 - r1408231;
return r1408232;
}
double f(double x, double y, double z) {
double r1408233 = x;
double r1408234 = y;
double r1408235 = z;
double r1408236 = fma(r1408233, r1408234, r1408235);
double r1408237 = r1408233 * r1408234;
double r1408238 = r1408235 + r1408237;
double r1408239 = r1408236 - r1408238;
double r1408240 = 1.0;
double r1408241 = r1408239 - r1408240;
double r1408242 = exp(r1408241);
double r1408243 = log(r1408242);
double r1408244 = /* ERROR: no posit support in C */;
double r1408245 = /* ERROR: no posit support in C */;
return r1408245;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 45.2 |
|---|---|
| Target | 0 |
| Herbie | 7.7 |
Initial program 45.2
rmApplied add-log-exp47.1
Applied add-log-exp47.1
Applied sum-log47.1
Applied add-log-exp47.6
Applied diff-log47.5
Simplified30.6
rmApplied insert-posit1630.5
Simplified30.0
rmApplied add-log-exp31.6
Applied add-log-exp47.5
Applied add-log-exp47.5
Applied diff-log47.5
Applied diff-log47.5
Simplified7.7
Final simplification7.7
herbie shell --seed 2019153
(FPCore (x y z)
:name "simple fma test"
:herbie-target
-1
(- (fma x y z) (+ 1 (+ (* x y) z))))