Average Error: 45.2 → 45.2
Time: 10.5s
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 r58247 = x;
        double r58248 = y;
        double r58249 = z;
        double r58250 = fma(r58247, r58248, r58249);
        double r58251 = 1.0;
        double r58252 = r58247 * r58248;
        double r58253 = r58252 + r58249;
        double r58254 = r58251 + r58253;
        double r58255 = r58250 - r58254;
        return r58255;
}

double f(double x, double y, double z) {
        double r58256 = x;
        double r58257 = y;
        double r58258 = z;
        double r58259 = fma(r58256, r58257, r58258);
        double r58260 = 1.0;
        double r58261 = r58256 * r58257;
        double r58262 = r58261 + r58258;
        double r58263 = r58260 + r58262;
        double r58264 = r58259 - r58263;
        return r58264;
}

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 2019304 
(FPCore (x y z)
  :name "simple fma test"
  :precision binary64

  :herbie-target
  -1

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