\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\log \left(e^{\left(\sqrt[3]{\sqrt[3]{\left(\left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right) \cdot \left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right)\right) \cdot \left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right)}} \cdot \sqrt[3]{\sqrt[3]{\left(\left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right) \cdot \left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right)\right) \cdot \left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right)}}\right) \cdot \sqrt[3]{\sqrt[3]{\left(\left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right) \cdot \left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right)\right) \cdot \left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(1 + x \cdot y\right)\right)}}}\right)double f(double x, double y, double z) {
double r4852754 = x;
double r4852755 = y;
double r4852756 = z;
double r4852757 = fma(r4852754, r4852755, r4852756);
double r4852758 = 1.0;
double r4852759 = r4852754 * r4852755;
double r4852760 = r4852759 + r4852756;
double r4852761 = r4852758 + r4852760;
double r4852762 = r4852757 - r4852761;
return r4852762;
}
double f(double x, double y, double z) {
double r4852763 = x;
double r4852764 = y;
double r4852765 = z;
double r4852766 = fma(r4852763, r4852764, r4852765);
double r4852767 = r4852766 - r4852765;
double r4852768 = 1.0;
double r4852769 = r4852763 * r4852764;
double r4852770 = r4852768 + r4852769;
double r4852771 = r4852767 - r4852770;
double r4852772 = r4852771 * r4852771;
double r4852773 = r4852772 * r4852771;
double r4852774 = cbrt(r4852773);
double r4852775 = cbrt(r4852774);
double r4852776 = r4852775 * r4852775;
double r4852777 = r4852776 * r4852775;
double r4852778 = exp(r4852777);
double r4852779 = log(r4852778);
return r4852779;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 45.0 |
|---|---|
| Target | 0 |
| Herbie | 31.1 |
Initial program 45.0
rmApplied add-log-exp46.6
Applied add-log-exp47.6
Applied sum-log47.6
Applied add-log-exp47.6
Applied sum-log47.6
Applied add-log-exp47.6
Applied diff-log47.6
Simplified45.2
rmApplied add-log-exp46.6
Applied add-log-exp46.6
Applied sum-log46.6
Applied add-log-exp47.6
Applied diff-log47.6
Simplified32.3
rmApplied add-cbrt-cube32.3
Simplified31.1
rmApplied add-cube-cbrt31.1
Final simplification31.1
herbie shell --seed 2019172
(FPCore (x y z)
:name "simple fma test"
:herbie-target
-1.0
(- (fma x y z) (+ 1.0 (+ (* x y) z))))