Average Error: 44.8 → 44.8
Time: 1.3s
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 r68614 = x;
        double r68615 = y;
        double r68616 = z;
        double r68617 = fma(r68614, r68615, r68616);
        double r68618 = 1.0;
        double r68619 = r68614 * r68615;
        double r68620 = r68619 + r68616;
        double r68621 = r68618 + r68620;
        double r68622 = r68617 - r68621;
        return r68622;
}

double f(double x, double y, double z) {
        double r68623 = x;
        double r68624 = y;
        double r68625 = z;
        double r68626 = fma(r68623, r68624, r68625);
        double r68627 = 1.0;
        double r68628 = r68623 * r68624;
        double r68629 = r68628 + r68625;
        double r68630 = r68627 + r68629;
        double r68631 = r68626 - r68630;
        return r68631;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.8
Target0
Herbie44.8
\[-1\]

Derivation

  1. Initial program 44.8

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

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

Reproduce

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

  :herbie-target
  -1

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