\[\frac{x - y}{2 - \left(x + y\right)}
\]
↓
\[\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t_0} - \frac{y}{t_0}
\end{array}
\]
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
↓
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 2.0 (+ x y)))) (- (/ x t_0) (/ y t_0))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
↓
double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
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
t_0 = 2.0d0 - (x + y)
code = (x / t_0) - (y / t_0)
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 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
def code(x, y):
return (x - y) / (2.0 - (x + y))
↓
def code(x, y):
t_0 = 2.0 - (x + y)
return (x / t_0) - (y / t_0)
function code(x, y)
return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y)))
end
↓
function code(x, y)
t_0 = Float64(2.0 - Float64(x + y))
return Float64(Float64(x / t_0) - Float64(y / t_0))
end
function tmp = code(x, y)
tmp = (x - y) / (2.0 - (x + y));
end
↓
function tmp = code(x, y)
t_0 = 2.0 - (x + y);
tmp = (x / t_0) - (y / t_0);
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[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[(x / t$95$0), $MachinePrecision] - N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]
\frac{x - y}{2 - \left(x + y\right)}
↓
\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t_0} - \frac{y}{t_0}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 26.5 |
|---|
| Cost | 980 |
|---|
\[\begin{array}{l}
t_0 := 1 + \frac{2}{y}\\
\mathbf{if}\;x \leq -1.9942022948545567 \cdot 10^{+125}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.826848170010284 \cdot 10^{-82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.0024460758496544156:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 2.9658099958485696 \cdot 10^{+66}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.2802029569200474 \cdot 10^{+114}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 26.4 |
|---|
| Cost | 980 |
|---|
\[\begin{array}{l}
t_0 := -1 + \frac{y}{x}\\
t_1 := 1 + \frac{2}{y}\\
\mathbf{if}\;x \leq -1.9942022948545567 \cdot 10^{+125}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.826848170010284 \cdot 10^{-82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 0.0024460758496544156:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 2.9658099958485696 \cdot 10^{+66}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.2802029569200474 \cdot 10^{+114}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 10.5 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.9942022948545567 \cdot 10^{+125}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.5875690938112374 \cdot 10^{-12}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{1}{2 - y}\\
\mathbf{elif}\;x \leq 2.9658099958485696 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{elif}\;x \leq 1.2802029569200474 \cdot 10^{+114}:\\
\;\;\;\;1 + \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 26.4 |
|---|
| Cost | 724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.9942022948545567 \cdot 10^{+125}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.826848170010284 \cdot 10^{-82}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.0024460758496544156:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 2.9658099958485696 \cdot 10^{+66}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.8494387053009244 \cdot 10^{+110}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 17.2 |
|---|
| Cost | 648 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.348807799747896 \cdot 10^{+95}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.944192617580757 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{2 - y}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 17.1 |
|---|
| Cost | 648 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.348807799747896 \cdot 10^{+95}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-1}{y}\\
\mathbf{elif}\;y \leq 2.944192617580757 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{2 - y}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 26.2 |
|---|
| Cost | 592 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.9942022948545567 \cdot 10^{+125}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 0.0024460758496544156:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.9658099958485696 \cdot 10^{+66}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.8494387053009244 \cdot 10^{+110}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 17.2 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.348807799747896 \cdot 10^{+95}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 0.8957115902786915:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{2}{y}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 0.0 |
|---|
| Cost | 576 |
|---|
\[\frac{x - y}{\left(2 - x\right) - y}
\]
| Alternative 10 |
|---|
| Error | 39.6 |
|---|
| Cost | 64 |
|---|
\[-1
\]