\[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 5 \cdot 10^{-12}:\\
\;\;\;\;1 - \log \left(\left(-1 - t_0\right) + 2\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(\frac{x}{{y}^{2}} + \left(-\frac{1 - x}{y}\right)\right) - \frac{1}{{y}^{2}}\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 5e-12)
(- 1.0 (log (+ (- -1.0 t_0) 2.0)))
(-
1.0
(log
(- (+ (/ x (pow y 2.0)) (- (/ (- 1.0 x) y))) (/ 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 <= 5e-12) {
tmp = 1.0 - log(((-1.0 - t_0) + 2.0));
} else {
tmp = 1.0 - log((((x / pow(y, 2.0)) + -((1.0 - x) / y)) - (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 <= 5d-12) then
tmp = 1.0d0 - log((((-1.0d0) - t_0) + 2.0d0))
else
tmp = 1.0d0 - log((((x / (y ** 2.0d0)) + -((1.0d0 - x) / y)) - (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 <= 5e-12) {
tmp = 1.0 - Math.log(((-1.0 - t_0) + 2.0));
} else {
tmp = 1.0 - Math.log((((x / Math.pow(y, 2.0)) + -((1.0 - x) / y)) - (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 <= 5e-12:
tmp = 1.0 - math.log(((-1.0 - t_0) + 2.0))
else:
tmp = 1.0 - math.log((((x / math.pow(y, 2.0)) + -((1.0 - x) / y)) - (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 <= 5e-12)
tmp = Float64(1.0 - log(Float64(Float64(-1.0 - t_0) + 2.0)));
else
tmp = Float64(1.0 - log(Float64(Float64(Float64(x / (y ^ 2.0)) + Float64(-Float64(Float64(1.0 - x) / y))) - 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 <= 5e-12)
tmp = 1.0 - log(((-1.0 - t_0) + 2.0));
else
tmp = 1.0 - log((((x / (y ^ 2.0)) + -((1.0 - x) / y)) - (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, 5e-12], N[(1.0 - N[Log[N[(N[(-1.0 - t$95$0), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Log[N[(N[(N[(x / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision] + (-N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision])), $MachinePrecision] - N[(1.0 / N[Power[y, 2.0], $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 5 \cdot 10^{-12}:\\
\;\;\;\;1 - \log \left(\left(-1 - t_0\right) + 2\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(\frac{x}{{y}^{2}} + \left(-\frac{1 - x}{y}\right)\right) - \frac{1}{{y}^{2}}\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 14468 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -490000:\\
\;\;\;\;1 - \left(\left(-\frac{\frac{x}{1 - x} - \frac{1}{1 - x}}{y}\right) + \left(\log \left(1 - x\right) + \log \left(\frac{-1}{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2000000000000:\\
\;\;\;\;1 - \log \left(\left(-1 - \frac{x - y}{1 - y}\right) + 2\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(-\frac{1 - x}{y}\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.1 |
|---|
| Cost | 7748 |
|---|
\[\begin{array}{l}
t_0 := \frac{x - y}{1 - y}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-12}:\\
\;\;\;\;1 - \log \left(\left(-1 - t_0\right) + 2\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(-\frac{1 - x}{y}\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.1 |
|---|
| Cost | 7620 |
|---|
\[\begin{array}{l}
t_0 := \frac{x - y}{1 - y}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-12}:\\
\;\;\;\;1 - \log \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(-\frac{1 - x}{y}\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 7.2 |
|---|
| Cost | 7176 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -40:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{elif}\;y \leq 0.135:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(-\frac{x}{1 - y}\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 1.1 |
|---|
| Cost | 7176 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1 - \log \left(-\frac{1 - x}{y}\right)\\
\mathbf{elif}\;y \leq 0.023:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(-\frac{x}{1 - y}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 7.3 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -75:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(-\left(-\frac{x}{y}\right)\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 13.4 |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -23.5:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 23.6 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.85:\\
\;\;\;\;1 - \log \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(-x\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 23.4 |
|---|
| Cost | 6720 |
|---|
\[1 - \log \left(1 - x\right)
\]
| Alternative 10 |
|---|
| Error | 36.2 |
|---|
| Cost | 256 |
|---|
\[1 - \left(-x\right)
\]
| Alternative 11 |
|---|
| Error | 37.7 |
|---|
| Cost | 192 |
|---|
\[1 - y
\]