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

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x + 1\right) \cdot y - x\]
  2. Using strategy rm
  3. Applied fma-neg0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x + 1, y, -x\right)}\]
  4. Final simplification0.0

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

Reproduce

herbie shell --seed 2020057 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.SRGB:transferFunction from colour-2.3.3"
  :precision binary64
  (- (* (+ x 1) y) x))