Average Error: 45.6 → 45.6
Time: 5.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 r86315 = x;
        double r86316 = y;
        double r86317 = z;
        double r86318 = fma(r86315, r86316, r86317);
        double r86319 = 1.0;
        double r86320 = r86315 * r86316;
        double r86321 = r86320 + r86317;
        double r86322 = r86319 + r86321;
        double r86323 = r86318 - r86322;
        return r86323;
}

double f(double x, double y, double z) {
        double r86324 = x;
        double r86325 = y;
        double r86326 = z;
        double r86327 = fma(r86324, r86325, r86326);
        double r86328 = 1.0;
        double r86329 = r86324 * r86325;
        double r86330 = r86329 + r86326;
        double r86331 = r86328 + r86330;
        double r86332 = r86327 - r86331;
        return r86332;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.6

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

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

Reproduce

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

  :herbie-target
  -1

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