Average Error: 45.2 → 45.2
Time: 17.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 r100939 = x;
        double r100940 = y;
        double r100941 = z;
        double r100942 = fma(r100939, r100940, r100941);
        double r100943 = 1.0;
        double r100944 = r100939 * r100940;
        double r100945 = r100944 + r100941;
        double r100946 = r100943 + r100945;
        double r100947 = r100942 - r100946;
        return r100947;
}

double f(double x, double y, double z) {
        double r100948 = x;
        double r100949 = y;
        double r100950 = z;
        double r100951 = fma(r100948, r100949, r100950);
        double r100952 = 1.0;
        double r100953 = r100948 * r100949;
        double r100954 = r100953 + r100950;
        double r100955 = r100952 + r100954;
        double r100956 = r100951 - r100955;
        return r100956;
}

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))))