?

Average Error: 0.0 → 0.0
Time: 7.0s
Precision: binary64
Cost: 704

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.0

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

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

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

Alternatives

Alternative 1
Error0.0
Cost704
\[0.918938533204673 + \left(\left(y + -1\right) \cdot x + y \cdot -0.5\right) \]
Alternative 2
Error1.5
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -1.5 \lor \neg \left(y \leq 1.75\right):\\ \;\;\;\;y \cdot \left(x + -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - x\\ \end{array} \]
Alternative 3
Error0.0
Cost576
\[\left(0.918938533204673 + y \cdot \left(x + -0.5\right)\right) - x \]
Alternative 4
Error27.9
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-9}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq 0.72:\\ \;\;\;\;0.918938533204673\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array} \]
Alternative 5
Error10.1
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -125:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq 1.85:\\ \;\;\;\;0.918938533204673 - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array} \]
Alternative 6
Error45.2
Cost64
\[0.918938533204673 \]

Error

Reproduce?

herbie shell --seed 2023055 
(FPCore (x y)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))