Average Error: 45.3 → 30.9
Time: 4.2s
Precision: 64
\[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(x \cdot y + 1\right)\]
\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)
\left(\mathsf{fma}\left(x, y, z\right) - z\right) - \left(x \cdot y + 1\right)
double code(double x, double y, double z) {
	return (fma(x, y, z) - (1.0 + ((x * y) + z)));
}
double code(double x, double y, double z) {
	return ((fma(x, y, z) - z) - ((x * y) + 1.0));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original45.3
Target0
Herbie30.9
\[-1\]

Derivation

  1. Initial program 45.3

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

    \[\leadsto \mathsf{fma}\left(x, y, z\right) - \left(1 + \color{blue}{\left(\sqrt[3]{x \cdot y + z} \cdot \sqrt[3]{x \cdot y + z}\right) \cdot \sqrt[3]{x \cdot y + z}}\right)\]
  4. Using strategy rm
  5. Applied add-cube-cbrt46.0

    \[\leadsto \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(\sqrt[3]{x \cdot y + z} \cdot \sqrt[3]{x \cdot y + z}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{x \cdot y + z}} \cdot \sqrt[3]{\sqrt[3]{x \cdot y + z}}\right) \cdot \sqrt[3]{\sqrt[3]{x \cdot y + z}}\right)}\right)\]
  6. Taylor expanded around 0 45.3

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

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

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

Reproduce

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

  :herbie-target
  -1

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