Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{x - y}{2 - \left(x + y\right)}
\]
↓
\[\frac{x - y}{2 - \left(x + y\right)}
\]
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y)))) ↓
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y)))) double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
↓
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
↓
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y):
return (x - y) / (2.0 - (x + y))
↓
def code(x, y):
return (x - y) / (2.0 - (x + y))
function code(x, y)
return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y)))
end
↓
function code(x, y)
return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y)))
end
function tmp = code(x, y)
tmp = (x - y) / (2.0 - (x + y));
end
↓
function tmp = code(x, y)
tmp = (x - y) / (2.0 - (x + y));
end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x - y}{2 - \left(x + y\right)}
↓
\frac{x - y}{2 - \left(x + y\right)}
Alternatives Alternative 1 Accuracy 100.0% Cost 576
\[\frac{x - y}{2 - \left(x + y\right)}
\]
Alternative 2 Accuracy 59.2% Cost 980
\[\begin{array}{l}
t_0 := \frac{y}{x} + -1\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-167}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-245}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-307}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+58}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Accuracy 73.4% Cost 848
\[\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
t_1 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -175000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-17}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1.04 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Accuracy 59.0% Cost 724
\[\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-167}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-245}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-307}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+58}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 5 Accuracy 59.0% Cost 724
\[\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-167}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-245}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-307}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+58}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 6 Accuracy 72.2% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+58}:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} + -1\\
\end{array}
\]
Alternative 7 Accuracy 59.2% Cost 460
\[\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-168}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+59}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 8 Accuracy 61.8% Cost 328
\[\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+41}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+58}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 9 Accuracy 37.7% Cost 64
\[-1
\]