\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\left(\sqrt[3]{\left(-\left(1 + x \cdot y\right)\right) + \left(\mathsf{fma}\left(x, y, z\right) - z\right)} \cdot \sqrt[3]{\left(-\left(1 + x \cdot y\right)\right) + \left(\mathsf{fma}\left(x, y, z\right) - z\right)}\right) \cdot \sqrt[3]{\sqrt[3]{\left(-\left(1 + x \cdot y\right)\right) + \left(\mathsf{fma}\left(x, y, z\right) - z\right)} \cdot \left(\sqrt[3]{\left(-\left(1 + x \cdot y\right)\right) + \left(\mathsf{fma}\left(x, y, z\right) - z\right)} \cdot \sqrt[3]{\left(-\left(1 + x \cdot y\right)\right) + \left(\mathsf{fma}\left(x, y, z\right) - z\right)}\right)}double f(double x, double y, double z) {
double r4763520 = x;
double r4763521 = y;
double r4763522 = z;
double r4763523 = fma(r4763520, r4763521, r4763522);
double r4763524 = 1.0;
double r4763525 = r4763520 * r4763521;
double r4763526 = r4763525 + r4763522;
double r4763527 = r4763524 + r4763526;
double r4763528 = r4763523 - r4763527;
return r4763528;
}
double f(double x, double y, double z) {
double r4763529 = 1.0;
double r4763530 = x;
double r4763531 = y;
double r4763532 = r4763530 * r4763531;
double r4763533 = r4763529 + r4763532;
double r4763534 = -r4763533;
double r4763535 = z;
double r4763536 = fma(r4763530, r4763531, r4763535);
double r4763537 = r4763536 - r4763535;
double r4763538 = r4763534 + r4763537;
double r4763539 = cbrt(r4763538);
double r4763540 = r4763539 * r4763539;
double r4763541 = r4763539 * r4763540;
double r4763542 = cbrt(r4763541);
double r4763543 = r4763540 * r4763542;
return r4763543;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 45.1 |
|---|---|
| Target | 0 |
| Herbie | 30.6 |
Initial program 45.1
rmApplied add-log-exp46.6
Applied add-log-exp47.5
Applied sum-log47.5
Applied add-log-exp47.5
Applied sum-log47.5
Applied add-log-exp47.5
Applied diff-log47.5
Simplified30.8
rmApplied sub-neg30.8
Applied associate--l+30.8
Applied exp-sum31.9
Applied log-prod31.9
Simplified31.9
Simplified30.6
rmApplied add-cube-cbrt30.6
rmApplied add-cube-cbrt30.6
Final simplification30.6
herbie shell --seed 2019171
(FPCore (x y z)
:name "simple fma test"
:herbie-target
-1.0
(- (fma x y z) (+ 1.0 (+ (* x y) z))))