Average Error: 44.9 → 44.9
Time: 1.3s
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 r66576 = x;
        double r66577 = y;
        double r66578 = z;
        double r66579 = fma(r66576, r66577, r66578);
        double r66580 = 1.0;
        double r66581 = r66576 * r66577;
        double r66582 = r66581 + r66578;
        double r66583 = r66580 + r66582;
        double r66584 = r66579 - r66583;
        return r66584;
}

double f(double x, double y, double z) {
        double r66585 = x;
        double r66586 = y;
        double r66587 = z;
        double r66588 = fma(r66585, r66586, r66587);
        double r66589 = 1.0;
        double r66590 = r66585 * r66586;
        double r66591 = r66590 + r66587;
        double r66592 = r66589 + r66591;
        double r66593 = r66588 - r66592;
        return r66593;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.9
Target0
Herbie44.9
\[-1\]

Derivation

  1. Initial program 44.9

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

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

Reproduce

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

  :herbie-target
  -1

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