Average Error: 45.1 → 45.1
Time: 15.1s
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 r66451 = x;
        double r66452 = y;
        double r66453 = z;
        double r66454 = fma(r66451, r66452, r66453);
        double r66455 = 1.0;
        double r66456 = r66451 * r66452;
        double r66457 = r66456 + r66453;
        double r66458 = r66455 + r66457;
        double r66459 = r66454 - r66458;
        return r66459;
}

double f(double x, double y, double z) {
        double r66460 = x;
        double r66461 = y;
        double r66462 = z;
        double r66463 = fma(r66460, r66461, r66462);
        double r66464 = 1.0;
        double r66465 = r66460 * r66461;
        double r66466 = r66465 + r66462;
        double r66467 = r66464 + r66466;
        double r66468 = r66463 - r66467;
        return r66468;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.1

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

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

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

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

Reproduce

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

  :herbie-target
  -1

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