Average Error: 0.0 → 0.0
Time: 3.3s
Precision: binary64
Cost: 448
\[\left(x + 1\right) \cdot y - x\]
\[\left(x + 1\right) \cdot y - x\]
\left(x + 1\right) \cdot y - x
\left(x + 1\right) \cdot y - x
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
double code(double x, double y) {
	return ((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

Alternatives

Alternative 1
Error0.8
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -8847.151629077207 \lor \neg \left(y \leq 0.010719471473792059\right):\\ \;\;\;\;\left(x + 1\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;y - x\\ \end{array}\]
Alternative 2
Error9.3
Cost192
\[y - x\]
Alternative 3
Error18.3
Cost770
\[\begin{array}{l} \mathbf{if}\;y \leq -4.308734839534673 \cdot 10^{-05}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.0191668924404321 \cdot 10^{-16}:\\ \;\;\;\;-x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array}\]
Alternative 4
Error36.0
Cost64
\[y\]
Alternative 5
Error61.8
Cost64
\[-1\]
Alternative 6
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

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

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

    \[\leadsto \left(x + 1\right) \cdot y - x\]

Reproduce

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