Average Error: 45.3 → 8.4
Time: 2.6s
Precision: binary64
\[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\left(\mathsf{fma}\left(x, y, z\right) - 1 \cdot \left(x \cdot y + z\right)\right) - 1\]
\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)
\left(\mathsf{fma}\left(x, y, z\right) - 1 \cdot \left(x \cdot y + z\right)\right) - 1
double code(double x, double y, double z) {
	return ((double) (((double) fma(x, y, z)) - ((double) (1.0 + ((double) (((double) (x * y)) + z))))));
}
double code(double x, double y, double z) {
	return ((double) (((double) (((double) fma(x, y, z)) - ((double) (1.0 * ((double) (((double) (x * y)) + z)))))) - 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
Herbie8.4
\[-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 flip-+46.0

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

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

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

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

Reproduce

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

  :herbie-target
  -1.0

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