Average Error: 44.9 → 8.9
Time: 3.7s
Precision: 64
\[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\sqrt[3]{{\left(\left(\mathsf{fma}\left(x, y, z\right) - \left(z + x \cdot y\right)\right) - 1\right)}^{3}}\]
\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)
\sqrt[3]{{\left(\left(\mathsf{fma}\left(x, y, z\right) - \left(z + x \cdot y\right)\right) - 1\right)}^{3}}
double f(double x, double y, double z) {
        double r76529 = x;
        double r76530 = y;
        double r76531 = z;
        double r76532 = fma(r76529, r76530, r76531);
        double r76533 = 1.0;
        double r76534 = r76529 * r76530;
        double r76535 = r76534 + r76531;
        double r76536 = r76533 + r76535;
        double r76537 = r76532 - r76536;
        return r76537;
}

double f(double x, double y, double z) {
        double r76538 = x;
        double r76539 = y;
        double r76540 = z;
        double r76541 = fma(r76538, r76539, r76540);
        double r76542 = r76538 * r76539;
        double r76543 = r76540 + r76542;
        double r76544 = r76541 - r76543;
        double r76545 = 1.0;
        double r76546 = r76544 - r76545;
        double r76547 = 3.0;
        double r76548 = pow(r76546, r76547);
        double r76549 = cbrt(r76548);
        return r76549;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.9
Target0
Herbie8.9
\[-1\]

Derivation

  1. Initial program 44.9

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

    \[\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. Simplified44.9

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(x, y, z\right) - \left(z + \left(x \cdot y + 1\right)\right)\right)}^{3}}}\]
  5. Using strategy rm
  6. Applied associate--r+30.8

    \[\leadsto \sqrt[3]{{\color{blue}{\left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(x \cdot y + 1\right)\right)}}^{3}}\]
  7. Using strategy rm
  8. Applied associate--r+15.7

    \[\leadsto \sqrt[3]{{\color{blue}{\left(\left(\left(\mathsf{fma}\left(x, y, z\right) - z\right) - x \cdot y\right) - 1\right)}}^{3}}\]
  9. Using strategy rm
  10. Applied associate--l-8.9

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

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

Reproduce

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

  :herbie-target
  -1

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