Average Error: 45.3 → 45.3
Time: 15.4s
Precision: 64
\[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)
\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)
double f(double x, double y, double z) {
        double r53660 = x;
        double r53661 = y;
        double r53662 = z;
        double r53663 = fma(r53660, r53661, r53662);
        double r53664 = 1.0;
        double r53665 = r53660 * r53661;
        double r53666 = r53665 + r53662;
        double r53667 = r53664 + r53666;
        double r53668 = r53663 - r53667;
        return r53668;
}

double f(double x, double y, double z) {
        double r53669 = x;
        double r53670 = y;
        double r53671 = z;
        double r53672 = fma(r53669, r53670, r53671);
        double r53673 = 1.0;
        double r53674 = r53669 * r53670;
        double r53675 = r53674 + r53671;
        double r53676 = r53673 + r53675;
        double r53677 = r53672 - r53676;
        return r53677;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.3
Target0
Herbie45.3
\[-1\]

Derivation

  1. Initial program 45.3

    \[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
  2. Final simplification45.3

    \[\leadsto \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]

Reproduce

herbie shell --seed 2019297 
(FPCore (x y z)
  :name "simple fma test"
  :precision binary64

  :herbie-target
  -1

  (- (fma x y z) (+ 1 (+ (* x y) z))))