Average Error: 45.0 → 45.0
Time: 5.2s
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 r82220 = x;
        double r82221 = y;
        double r82222 = z;
        double r82223 = fma(r82220, r82221, r82222);
        double r82224 = 1.0;
        double r82225 = r82220 * r82221;
        double r82226 = r82225 + r82222;
        double r82227 = r82224 + r82226;
        double r82228 = r82223 - r82227;
        return r82228;
}

double f(double x, double y, double z) {
        double r82229 = x;
        double r82230 = y;
        double r82231 = z;
        double r82232 = fma(r82229, r82230, r82231);
        double r82233 = 1.0;
        double r82234 = r82229 * r82230;
        double r82235 = r82234 + r82231;
        double r82236 = r82233 + r82235;
        double r82237 = r82232 - r82236;
        return r82237;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.0

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

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

Reproduce

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

  :herbie-target
  -1

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