Average Error: 0.0 → 0.0
Time: 3.7s
Precision: binary64
Cost: 576
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
\[\left(y \cdot \left(x + -0.5\right) - x\right) + 0.918938533204673 \]
(FPCore (x y)
 :precision binary64
 (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))
(FPCore (x y) :precision binary64 (+ (- (* y (+ x -0.5)) x) 0.918938533204673))
double code(double x, double y) {
	return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
double code(double x, double y) {
	return ((y * (x + -0.5)) - x) + 0.918938533204673;
}
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 * (x + (-0.5d0))) - x) + 0.918938533204673d0
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 * (x + -0.5)) - x) + 0.918938533204673;
}
def code(x, y):
	return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
def code(x, y):
	return ((y * (x + -0.5)) - x) + 0.918938533204673
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(y * Float64(x + -0.5)) - x) + 0.918938533204673)
end
function tmp = code(x, y)
	tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
end
function tmp = code(x, y)
	tmp = ((y * (x + -0.5)) - x) + 0.918938533204673;
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[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673
\left(y \cdot \left(x + -0.5\right) - x\right) + 0.918938533204673

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 y around 0 0.0

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

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

Alternatives

Alternative 1
Error28.5
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -0.095:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq 1.85:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+47}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+76}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array} \]
Alternative 2
Error1.6
Cost712
\[\begin{array}{l} t_0 := y \cdot \left(x + -0.5\right)\\ \mathbf{if}\;y \leq -7.8 \cdot 10^{+40}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.245:\\ \;\;\;\;0.918938533204673 + \left(y \cdot -0.5 - x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 + 0.918938533204673\\ \end{array} \]
Alternative 3
Error19.8
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -0.00046 \lor \neg \left(y \leq 1.55\right):\\ \;\;\;\;y \cdot \left(x + -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673\\ \end{array} \]
Alternative 4
Error19.8
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+18}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 0.0125:\\ \;\;\;\;0.918938533204673 + y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + -0.5\right)\\ \end{array} \]
Alternative 5
Error28.2
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -0.095:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq 1.85:\\ \;\;\;\;0.918938533204673\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array} \]
Alternative 6
Error18.9
Cost448
\[y \cdot \left(x + -0.5\right) + 0.918938533204673 \]
Alternative 7
Error45.5
Cost64
\[0.918938533204673 \]

Error

Reproduce

herbie shell --seed 2023016 
(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))