Average Error: 45.1 → 45.1
Time: 17.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 r48623 = x;
        double r48624 = y;
        double r48625 = z;
        double r48626 = fma(r48623, r48624, r48625);
        double r48627 = 1.0;
        double r48628 = r48623 * r48624;
        double r48629 = r48628 + r48625;
        double r48630 = r48627 + r48629;
        double r48631 = r48626 - r48630;
        return r48631;
}

double f(double x, double y, double z) {
        double r48632 = x;
        double r48633 = y;
        double r48634 = z;
        double r48635 = fma(r48632, r48633, r48634);
        double r48636 = 1.0;
        double r48637 = r48632 * r48633;
        double r48638 = r48637 + r48634;
        double r48639 = r48636 + r48638;
        double r48640 = r48635 - r48639;
        return r48640;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.1

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

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

Reproduce

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

  :herbie-target
  -1

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