\[\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 |
|---|
| Error | 27.2% |
|---|
| Cost | 1376 |
|---|
\[\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
t_1 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+42}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-75}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -9.4 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-128}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+60}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 38.93% |
|---|
| Cost | 1112 |
|---|
\[\begin{array}{l}
t_0 := -1 + \frac{y}{x}\\
t_1 := 1 - \frac{x}{y}\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{-51}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{-220}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-297}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 39.18% |
|---|
| Cost | 856 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+63}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-8}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{-50}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-219}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-297}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 40.2% |
|---|
| Cost | 856 |
|---|
\[\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+106}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-50}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-219}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-297}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 26.94% |
|---|
| Cost | 849 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+65}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-6}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-51} \lor \neg \left(x \leq 4.15 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + -2}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 26.84% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+64}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-8}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-51}:\\
\;\;\;\;x \cdot \left(0.5 + x \cdot 0.25\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 26.99% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+64}:\\
\;\;\;\;\frac{-1}{\frac{x}{x - y}}\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-6}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \left(0.5 + x \cdot 0.25\right)\\
\mathbf{elif}\;x \leq 1.58 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 39.14% |
|---|
| Cost | 592 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.35 \cdot 10^{+64}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2.12 \cdot 10^{-219}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-295}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 38.8% |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+66}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 61.93% |
|---|
| Cost | 64 |
|---|
\[-1
\]