Average Error: 45.1 → 45.1
Time: 16.8s
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 r87493 = x;
        double r87494 = y;
        double r87495 = z;
        double r87496 = fma(r87493, r87494, r87495);
        double r87497 = 1.0;
        double r87498 = r87493 * r87494;
        double r87499 = r87498 + r87495;
        double r87500 = r87497 + r87499;
        double r87501 = r87496 - r87500;
        return r87501;
}

double f(double x, double y, double z) {
        double r87502 = x;
        double r87503 = y;
        double r87504 = z;
        double r87505 = fma(r87502, r87503, r87504);
        double r87506 = 1.0;
        double r87507 = r87502 * r87503;
        double r87508 = r87507 + r87504;
        double r87509 = r87506 + r87508;
        double r87510 = r87505 - r87509;
        return r87510;
}

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))))