?

Average Accuracy: 100.0% → 100.0%
Time: 2.4s
Precision: binary64
Cost: 448

?

\[\left(x + 1\right) \cdot y - x \]
\[\left(y + y \cdot x\right) - x \]
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
(FPCore (x y) :precision binary64 (- (+ y (* y x)) x))
double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
double code(double x, double y) {
	return (y + (y * x)) - x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x + 1.0d0) * y) - x
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (y + (y * x)) - x
end function
public static double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
public static double code(double x, double y) {
	return (y + (y * x)) - x;
}
def code(x, y):
	return ((x + 1.0) * y) - x
def code(x, y):
	return (y + (y * x)) - x
function code(x, y)
	return Float64(Float64(Float64(x + 1.0) * y) - x)
end
function code(x, y)
	return Float64(Float64(y + Float64(y * x)) - x)
end
function tmp = code(x, y)
	tmp = ((x + 1.0) * y) - x;
end
function tmp = code(x, y)
	tmp = (y + (y * x)) - x;
end
code[x_, y_] := N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]
code[x_, y_] := N[(N[(y + N[(y * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\left(x + 1\right) \cdot y - x
\left(y + y \cdot x\right) - x

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 100.0%

    \[\left(x + 1\right) \cdot y - x \]
  2. Taylor expanded in x around 0 100.0%

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

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

Alternatives

Alternative 1
Accuracy69.4%
Cost656
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+138}:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq -8.8 \cdot 10^{+92}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-19}:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-57}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \]
Alternative 2
Accuracy98.8%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\ \;\;\;\;y \cdot \left(x + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y - x\\ \end{array} \]
Alternative 3
Accuracy98.5%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -750000000 \lor \neg \left(x \leq 1\right):\\ \;\;\;\;y \cdot x - x\\ \mathbf{else}:\\ \;\;\;\;y - x\\ \end{array} \]
Alternative 4
Accuracy98.8%
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;y + y \cdot x\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + 1\right)\\ \end{array} \]
Alternative 5
Accuracy84.1%
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+138}:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq -1 \cdot 10^{+93}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y - x\\ \end{array} \]
Alternative 6
Accuracy100.0%
Cost448
\[y \cdot \left(x + 1\right) - x \]
Alternative 7
Accuracy70.7%
Cost392
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-16}:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-57}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \]
Alternative 8
Accuracy43.2%
Cost64
\[y \]

Error

Reproduce?

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