Average Error: 45.2 → 45.2
Time: 1.9s
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 r49556 = x;
        double r49557 = y;
        double r49558 = z;
        double r49559 = fma(r49556, r49557, r49558);
        double r49560 = 1.0;
        double r49561 = r49556 * r49557;
        double r49562 = r49561 + r49558;
        double r49563 = r49560 + r49562;
        double r49564 = r49559 - r49563;
        return r49564;
}

double f(double x, double y, double z) {
        double r49565 = x;
        double r49566 = y;
        double r49567 = z;
        double r49568 = fma(r49565, r49566, r49567);
        double r49569 = 1.0;
        double r49570 = r49565 * r49566;
        double r49571 = r49570 + r49567;
        double r49572 = r49569 + r49571;
        double r49573 = r49568 - r49572;
        return r49573;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.2

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

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

Reproduce

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

  :herbie-target
  -1

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