Average Error: 45.5 → 45.5
Time: 14.7s
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 r50073 = x;
        double r50074 = y;
        double r50075 = z;
        double r50076 = fma(r50073, r50074, r50075);
        double r50077 = 1.0;
        double r50078 = r50073 * r50074;
        double r50079 = r50078 + r50075;
        double r50080 = r50077 + r50079;
        double r50081 = r50076 - r50080;
        return r50081;
}

double f(double x, double y, double z) {
        double r50082 = x;
        double r50083 = y;
        double r50084 = z;
        double r50085 = fma(r50082, r50083, r50084);
        double r50086 = 1.0;
        double r50087 = r50082 * r50083;
        double r50088 = r50087 + r50084;
        double r50089 = r50086 + r50088;
        double r50090 = r50085 - r50089;
        return r50090;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.5

    \[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
  2. Using strategy rm
  3. Applied add-cube-cbrt45.5

    \[\leadsto \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)}}\]
  4. Final simplification45.5

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

Reproduce

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

  :herbie-target
  -1

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