Average Error: 0.0 → 0.0
Time: 1.2s
Precision: binary64
\[\left(x + 1\right) \cdot y - x \]
\[\mathsf{fma}\left(y + -1, x, y\right) \]
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
(FPCore (x y) :precision binary64 (fma (+ y -1.0) x y))
double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
double code(double x, double y) {
	return fma((y + -1.0), x, y);
}
function code(x, y)
	return Float64(Float64(Float64(x + 1.0) * y) - x)
end
function code(x, y)
	return fma(Float64(y + -1.0), x, y)
end
code[x_, y_] := N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]
code[x_, y_] := N[(N[(y + -1.0), $MachinePrecision] * x + y), $MachinePrecision]
\left(x + 1\right) \cdot y - x
\mathsf{fma}\left(y + -1, x, y\right)

Error

Derivation

  1. Initial program 0.0

    \[\left(x + 1\right) \cdot y - x \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, y\right) - x} \]
  3. Taylor expanded in x around 0 0.0

    \[\leadsto \color{blue}{\left(y - 1\right) \cdot x + y} \]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2022210 
(FPCore (x y)
  :name "Data.Colour.SRGB:transferFunction from colour-2.3.3"
  :precision binary64
  (- (* (+ x 1.0) y) x))