Average Error: 45.7 → 45.7
Time: 6.0s
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 r117549 = x;
        double r117550 = y;
        double r117551 = z;
        double r117552 = fma(r117549, r117550, r117551);
        double r117553 = 1.0;
        double r117554 = r117549 * r117550;
        double r117555 = r117554 + r117551;
        double r117556 = r117553 + r117555;
        double r117557 = r117552 - r117556;
        return r117557;
}

double f(double x, double y, double z) {
        double r117558 = x;
        double r117559 = y;
        double r117560 = z;
        double r117561 = fma(r117558, r117559, r117560);
        double r117562 = 1.0;
        double r117563 = r117558 * r117559;
        double r117564 = r117563 + r117560;
        double r117565 = r117562 + r117564;
        double r117566 = r117561 - r117565;
        return r117566;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.7

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

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

Reproduce

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

  :herbie-target
  -1

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