Average Error: 44.7 → 44.7
Time: 9.7s
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 r73504 = x;
        double r73505 = y;
        double r73506 = z;
        double r73507 = fma(r73504, r73505, r73506);
        double r73508 = 1.0;
        double r73509 = r73504 * r73505;
        double r73510 = r73509 + r73506;
        double r73511 = r73508 + r73510;
        double r73512 = r73507 - r73511;
        return r73512;
}

double f(double x, double y, double z) {
        double r73513 = x;
        double r73514 = y;
        double r73515 = z;
        double r73516 = fma(r73513, r73514, r73515);
        double r73517 = 1.0;
        double r73518 = r73513 * r73514;
        double r73519 = r73518 + r73515;
        double r73520 = r73517 + r73519;
        double r73521 = r73516 - r73520;
        return r73521;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 44.7

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

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

Reproduce

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

  :herbie-target
  -1

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