\[1 - \log \left(1 - \frac{x - y}{1 - y}\right)
\]
↓
\[\begin{array}{l}
t_0 := \frac{x - y}{1 - y}\\
\mathbf{if}\;t_0 \leq 0.5:\\
\;\;\;\;1 - \log \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{-1 + x}{y} + \left(\frac{x}{{y}^{2}} + \left(\left(-\frac{1 - x}{{y}^{3}}\right) - \frac{1}{{y}^{2}}\right)\right)\right)\\
\end{array}
\]
(FPCore (x y) :precision binary64 (- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))
↓
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- x y) (- 1.0 y))))
(if (<= t_0 0.5)
(- 1.0 (log (- 1.0 t_0)))
(-
1.0
(log
(+
(/ (+ -1.0 x) y)
(+
(/ x (pow y 2.0))
(- (- (/ (- 1.0 x) (pow y 3.0))) (/ 1.0 (pow y 2.0))))))))))double code(double x, double y) {
return 1.0 - log((1.0 - ((x - y) / (1.0 - y))));
}
↓
double code(double x, double y) {
double t_0 = (x - y) / (1.0 - y);
double tmp;
if (t_0 <= 0.5) {
tmp = 1.0 - log((1.0 - t_0));
} else {
tmp = 1.0 - log((((-1.0 + x) / y) + ((x / pow(y, 2.0)) + (-((1.0 - x) / pow(y, 3.0)) - (1.0 / pow(y, 2.0))))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - log((1.0d0 - ((x - y) / (1.0d0 - 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) :: tmp
t_0 = (x - y) / (1.0d0 - y)
if (t_0 <= 0.5d0) then
tmp = 1.0d0 - log((1.0d0 - t_0))
else
tmp = 1.0d0 - log(((((-1.0d0) + x) / y) + ((x / (y ** 2.0d0)) + (-((1.0d0 - x) / (y ** 3.0d0)) - (1.0d0 / (y ** 2.0d0))))))
end if
code = tmp
end function
public static double code(double x, double y) {
return 1.0 - Math.log((1.0 - ((x - y) / (1.0 - y))));
}
↓
public static double code(double x, double y) {
double t_0 = (x - y) / (1.0 - y);
double tmp;
if (t_0 <= 0.5) {
tmp = 1.0 - Math.log((1.0 - t_0));
} else {
tmp = 1.0 - Math.log((((-1.0 + x) / y) + ((x / Math.pow(y, 2.0)) + (-((1.0 - x) / Math.pow(y, 3.0)) - (1.0 / Math.pow(y, 2.0))))));
}
return tmp;
}
def code(x, y):
return 1.0 - math.log((1.0 - ((x - y) / (1.0 - y))))
↓
def code(x, y):
t_0 = (x - y) / (1.0 - y)
tmp = 0
if t_0 <= 0.5:
tmp = 1.0 - math.log((1.0 - t_0))
else:
tmp = 1.0 - math.log((((-1.0 + x) / y) + ((x / math.pow(y, 2.0)) + (-((1.0 - x) / math.pow(y, 3.0)) - (1.0 / math.pow(y, 2.0))))))
return tmp
function code(x, y)
return Float64(1.0 - log(Float64(1.0 - Float64(Float64(x - y) / Float64(1.0 - y)))))
end
↓
function code(x, y)
t_0 = Float64(Float64(x - y) / Float64(1.0 - y))
tmp = 0.0
if (t_0 <= 0.5)
tmp = Float64(1.0 - log(Float64(1.0 - t_0)));
else
tmp = Float64(1.0 - log(Float64(Float64(Float64(-1.0 + x) / y) + Float64(Float64(x / (y ^ 2.0)) + Float64(Float64(-Float64(Float64(1.0 - x) / (y ^ 3.0))) - Float64(1.0 / (y ^ 2.0)))))));
end
return tmp
end
function tmp = code(x, y)
tmp = 1.0 - log((1.0 - ((x - y) / (1.0 - y))));
end
↓
function tmp_2 = code(x, y)
t_0 = (x - y) / (1.0 - y);
tmp = 0.0;
if (t_0 <= 0.5)
tmp = 1.0 - log((1.0 - t_0));
else
tmp = 1.0 - log((((-1.0 + x) / y) + ((x / (y ^ 2.0)) + (-((1.0 - x) / (y ^ 3.0)) - (1.0 / (y ^ 2.0))))));
end
tmp_2 = tmp;
end
code[x_, y_] := N[(1.0 - N[Log[N[(1.0 - N[(N[(x - y), $MachinePrecision] / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := Block[{t$95$0 = N[(N[(x - y), $MachinePrecision] / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.5], N[(1.0 - N[Log[N[(1.0 - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Log[N[(N[(N[(-1.0 + x), $MachinePrecision] / y), $MachinePrecision] + N[(N[(x / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision] + N[((-N[(N[(1.0 - x), $MachinePrecision] / N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]) - N[(1.0 / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
1 - \log \left(1 - \frac{x - y}{1 - y}\right)
↓
\begin{array}{l}
t_0 := \frac{x - y}{1 - y}\\
\mathbf{if}\;t_0 \leq 0.5:\\
\;\;\;\;1 - \log \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{-1 + x}{y} + \left(\frac{x}{{y}^{2}} + \left(\left(-\frac{1 - x}{{y}^{3}}\right) - \frac{1}{{y}^{2}}\right)\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.3 |
|---|
| Cost | 14468 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -520000:\\
\;\;\;\;1 - \left(\left(\log \left(1 - x\right) + \log \left(\frac{-1}{y}\right)\right) + \left(-\frac{\frac{x}{1 - x} - \frac{1}{1 - x}}{y}\right)\right)\\
\mathbf{elif}\;y \leq 2000000000:\\
\;\;\;\;1 - \log \left(1 - \frac{x - y}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x}{y}\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.2 |
|---|
| Cost | 7368 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3600000000:\\
\;\;\;\;1 - \log \left(\frac{-1 + x}{y}\right)\\
\mathbf{elif}\;y \leq 2000000000:\\
\;\;\;\;1 - \log \left(1 - \frac{x - y}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x}{y}\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 7.2 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -28:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x}{y}\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.3 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1 - \log \left(\frac{-1 + x}{y}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x}{y}\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 13.0 |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -175:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 24.0 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -27:\\
\;\;\;\;1 - \log \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 23.7 |
|---|
| Cost | 6720 |
|---|
\[1 - \log \left(1 - x\right)
\]
| Alternative 8 |
|---|
| Error | 36.0 |
|---|
| Cost | 256 |
|---|
\[1 - \left(-x\right)
\]
| Alternative 9 |
|---|
| Error | 37.7 |
|---|
| Cost | 192 |
|---|
\[1 - y
\]