?

Average Error: 0.0 → 0.0
Time: 3.6s
Precision: binary64
Cost: 448

?

\[\left(x + 1\right) \cdot y - x \]
\[\left(y \cdot x + y\right) - x \]
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
(FPCore (x y) :precision binary64 (- (+ (* y x) y) x))
double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
double code(double x, double y) {
	return ((y * x) + y) - 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 * x) + y) - 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 * x) + y) - x;
}
def code(x, y):
	return ((x + 1.0) * y) - x
def code(x, y):
	return ((y * x) + y) - x
function code(x, y)
	return Float64(Float64(Float64(x + 1.0) * y) - x)
end
function code(x, y)
	return Float64(Float64(Float64(y * x) + y) - x)
end
function tmp = code(x, y)
	tmp = ((x + 1.0) * y) - x;
end
function tmp = code(x, y)
	tmp = ((y * x) + y) - x;
end
code[x_, y_] := N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]
code[x_, y_] := N[(N[(N[(y * x), $MachinePrecision] + y), $MachinePrecision] - x), $MachinePrecision]
\left(x + 1\right) \cdot y - x
\left(y \cdot x + y\right) - x

Error?

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. Taylor expanded in x around 0 0.0

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

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

Alternatives

Alternative 1
Error0.8
Cost584
\[\begin{array}{l} t_0 := y \cdot x - x\\ \mathbf{if}\;x \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-7}:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error0.0
Cost448
\[\left(x + 1\right) \cdot y - x \]
Alternative 3
Error9.6
Cost192
\[y - x \]

Error

Reproduce?

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