\[\frac{x - y}{2 - \left(x + y\right)}
\]
↓
\[\begin{array}{l}
t_0 := \frac{x - y}{\left(2 - y\right) - x}\\
t_1 := 2 + t_0\\
\frac{t_0 \cdot t_1}{t_1}
\end{array}
\]
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
↓
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- x y) (- (- 2.0 y) x))) (t_1 (+ 2.0 t_0)))
(/ (* t_0 t_1) t_1)))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
↓
double code(double x, double y) {
double t_0 = (x - y) / ((2.0 - y) - x);
double t_1 = 2.0 + t_0;
return (t_0 * t_1) / t_1;
}
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
real(8) :: t_0
real(8) :: t_1
t_0 = (x - y) / ((2.0d0 - y) - x)
t_1 = 2.0d0 + t_0
code = (t_0 * t_1) / t_1
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) {
double t_0 = (x - y) / ((2.0 - y) - x);
double t_1 = 2.0 + t_0;
return (t_0 * t_1) / t_1;
}
def code(x, y):
return (x - y) / (2.0 - (x + y))
↓
def code(x, y):
t_0 = (x - y) / ((2.0 - y) - x)
t_1 = 2.0 + t_0
return (t_0 * t_1) / t_1
function code(x, y)
return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y)))
end
↓
function code(x, y)
t_0 = Float64(Float64(x - y) / Float64(Float64(2.0 - y) - x))
t_1 = Float64(2.0 + t_0)
return Float64(Float64(t_0 * t_1) / t_1)
end
function tmp = code(x, y)
tmp = (x - y) / (2.0 - (x + y));
end
↓
function tmp = code(x, y)
t_0 = (x - y) / ((2.0 - y) - x);
t_1 = 2.0 + t_0;
tmp = (t_0 * t_1) / t_1;
end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := Block[{t$95$0 = N[(N[(x - y), $MachinePrecision] / N[(N[(2.0 - y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 + t$95$0), $MachinePrecision]}, N[(N[(t$95$0 * t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]]]
\frac{x - y}{2 - \left(x + y\right)}
↓
\begin{array}{l}
t_0 := \frac{x - y}{\left(2 - y\right) - x}\\
t_1 := 2 + t_0\\
\frac{t_0 \cdot t_1}{t_1}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 26.46% |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{-86}:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-89}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-71}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{\frac{y}{x}} + 1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 25.49% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{+14}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-89}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-71}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 26.61% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-89}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-71}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{+59}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 38.23% |
|---|
| Cost | 724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-118}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-89}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-71}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+60}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.03% |
|---|
| Cost | 576 |
|---|
\[\frac{x - y}{2 - \left(x + y\right)}
\]
| Alternative 6 |
|---|
| Error | 36.84% |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -11500000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 10^{+60}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 62.54% |
|---|
| Cost | 64 |
|---|
\[-1
\]