\[1 - \log \left(1 - \frac{x - y}{1 - y}\right)
\]
↓
\[\begin{array}{l}
t_0 := -1 \cdot \left(\frac{1 - x}{y} + \frac{1 + \left(-x\right)}{{y}^{3}}\right)\\
t_1 := \frac{x}{{y}^{2}}\\
t_2 := \frac{1}{{y}^{2}}\\
\mathbf{if}\;y \leq -1780:\\
\;\;\;\;1 - \log \left(\left(t_1 + \left(t_0 + \frac{x}{{y}^{4}}\right)\right) - \left(t_2 + \frac{1}{{y}^{4}}\right)\right)\\
\mathbf{elif}\;y \leq 1000:\\
\;\;\;\;1 - \log \left(1 - \left(\left(1 - \frac{x - y}{y + -1}\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(t_1 + t_0\right) - t_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 (* -1.0 (+ (/ (- 1.0 x) y) (/ (+ 1.0 (- x)) (pow y 3.0)))))
(t_1 (/ x (pow y 2.0)))
(t_2 (/ 1.0 (pow y 2.0))))
(if (<= y -1780.0)
(-
1.0
(log (- (+ t_1 (+ t_0 (/ x (pow y 4.0)))) (+ t_2 (/ 1.0 (pow y 4.0))))))
(if (<= y 1000.0)
(- 1.0 (log (- 1.0 (+ (- 1.0 (/ (- x y) (+ y -1.0))) -1.0))))
(- 1.0 (log (- (+ t_1 t_0) t_2)))))))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 = -1.0 * (((1.0 - x) / y) + ((1.0 + -x) / pow(y, 3.0)));
double t_1 = x / pow(y, 2.0);
double t_2 = 1.0 / pow(y, 2.0);
double tmp;
if (y <= -1780.0) {
tmp = 1.0 - log(((t_1 + (t_0 + (x / pow(y, 4.0)))) - (t_2 + (1.0 / pow(y, 4.0)))));
} else if (y <= 1000.0) {
tmp = 1.0 - log((1.0 - ((1.0 - ((x - y) / (y + -1.0))) + -1.0)));
} else {
tmp = 1.0 - log(((t_1 + t_0) - t_2));
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (-1.0d0) * (((1.0d0 - x) / y) + ((1.0d0 + -x) / (y ** 3.0d0)))
t_1 = x / (y ** 2.0d0)
t_2 = 1.0d0 / (y ** 2.0d0)
if (y <= (-1780.0d0)) then
tmp = 1.0d0 - log(((t_1 + (t_0 + (x / (y ** 4.0d0)))) - (t_2 + (1.0d0 / (y ** 4.0d0)))))
else if (y <= 1000.0d0) then
tmp = 1.0d0 - log((1.0d0 - ((1.0d0 - ((x - y) / (y + (-1.0d0)))) + (-1.0d0))))
else
tmp = 1.0d0 - log(((t_1 + t_0) - t_2))
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 = -1.0 * (((1.0 - x) / y) + ((1.0 + -x) / Math.pow(y, 3.0)));
double t_1 = x / Math.pow(y, 2.0);
double t_2 = 1.0 / Math.pow(y, 2.0);
double tmp;
if (y <= -1780.0) {
tmp = 1.0 - Math.log(((t_1 + (t_0 + (x / Math.pow(y, 4.0)))) - (t_2 + (1.0 / Math.pow(y, 4.0)))));
} else if (y <= 1000.0) {
tmp = 1.0 - Math.log((1.0 - ((1.0 - ((x - y) / (y + -1.0))) + -1.0)));
} else {
tmp = 1.0 - Math.log(((t_1 + t_0) - t_2));
}
return tmp;
}
def code(x, y):
return 1.0 - math.log((1.0 - ((x - y) / (1.0 - y))))
↓
def code(x, y):
t_0 = -1.0 * (((1.0 - x) / y) + ((1.0 + -x) / math.pow(y, 3.0)))
t_1 = x / math.pow(y, 2.0)
t_2 = 1.0 / math.pow(y, 2.0)
tmp = 0
if y <= -1780.0:
tmp = 1.0 - math.log(((t_1 + (t_0 + (x / math.pow(y, 4.0)))) - (t_2 + (1.0 / math.pow(y, 4.0)))))
elif y <= 1000.0:
tmp = 1.0 - math.log((1.0 - ((1.0 - ((x - y) / (y + -1.0))) + -1.0)))
else:
tmp = 1.0 - math.log(((t_1 + t_0) - t_2))
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(-1.0 * Float64(Float64(Float64(1.0 - x) / y) + Float64(Float64(1.0 + Float64(-x)) / (y ^ 3.0))))
t_1 = Float64(x / (y ^ 2.0))
t_2 = Float64(1.0 / (y ^ 2.0))
tmp = 0.0
if (y <= -1780.0)
tmp = Float64(1.0 - log(Float64(Float64(t_1 + Float64(t_0 + Float64(x / (y ^ 4.0)))) - Float64(t_2 + Float64(1.0 / (y ^ 4.0))))));
elseif (y <= 1000.0)
tmp = Float64(1.0 - log(Float64(1.0 - Float64(Float64(1.0 - Float64(Float64(x - y) / Float64(y + -1.0))) + -1.0))));
else
tmp = Float64(1.0 - log(Float64(Float64(t_1 + t_0) - t_2)));
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 = -1.0 * (((1.0 - x) / y) + ((1.0 + -x) / (y ^ 3.0)));
t_1 = x / (y ^ 2.0);
t_2 = 1.0 / (y ^ 2.0);
tmp = 0.0;
if (y <= -1780.0)
tmp = 1.0 - log(((t_1 + (t_0 + (x / (y ^ 4.0)))) - (t_2 + (1.0 / (y ^ 4.0)))));
elseif (y <= 1000.0)
tmp = 1.0 - log((1.0 - ((1.0 - ((x - y) / (y + -1.0))) + -1.0)));
else
tmp = 1.0 - log(((t_1 + t_0) - t_2));
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[(-1.0 * N[(N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision] + N[(N[(1.0 + (-x)), $MachinePrecision] / N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1780.0], N[(1.0 - N[Log[N[(N[(t$95$1 + N[(t$95$0 + N[(x / N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 + N[(1.0 / N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1000.0], N[(1.0 - N[Log[N[(1.0 - N[(N[(1.0 - N[(N[(x - y), $MachinePrecision] / N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Log[N[(N[(t$95$1 + t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
1 - \log \left(1 - \frac{x - y}{1 - y}\right)
↓
\begin{array}{l}
t_0 := -1 \cdot \left(\frac{1 - x}{y} + \frac{1 + \left(-x\right)}{{y}^{3}}\right)\\
t_1 := \frac{x}{{y}^{2}}\\
t_2 := \frac{1}{{y}^{2}}\\
\mathbf{if}\;y \leq -1780:\\
\;\;\;\;1 - \log \left(\left(t_1 + \left(t_0 + \frac{x}{{y}^{4}}\right)\right) - \left(t_2 + \frac{1}{{y}^{4}}\right)\right)\\
\mathbf{elif}\;y \leq 1000:\\
\;\;\;\;1 - \log \left(1 - \left(\left(1 - \frac{x - y}{y + -1}\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(t_1 + t_0\right) - t_2\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.0 |
|---|
| Cost | 27592 |
|---|
\[\begin{array}{l}
t_0 := 1 - \log \left(\left(\frac{x}{{y}^{2}} + -1 \cdot \left(\frac{1 - x}{y} + \frac{1 + \left(-x\right)}{{y}^{3}}\right)\right) - \frac{1}{{y}^{2}}\right)\\
\mathbf{if}\;y \leq -12800:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 100000:\\
\;\;\;\;1 - \log \left(1 - \left(\left(1 - \frac{x - y}{y + -1}\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.2 |
|---|
| Cost | 14212 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -720000:\\
\;\;\;\;\frac{-\left(1 - x\right)}{y \cdot \left(1 - x\right)} - \left(-1 + \left(\log \left(1 - x\right) + \log \left(\frac{-1}{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 10000000:\\
\;\;\;\;1 - \log \left(1 - \frac{x - y}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x - 1}{y}\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 7.7 |
|---|
| Cost | 7376 |
|---|
\[\begin{array}{l}
t_0 := 1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+180}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{+156}:\\
\;\;\;\;1 - \log \left(\frac{x}{y}\right)\\
\mathbf{elif}\;y \leq -22:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-8}:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x}{y - 1}\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.2 |
|---|
| Cost | 7368 |
|---|
\[\begin{array}{l}
t_0 := 1 - \log \left(\frac{x - 1}{y}\right)\\
\mathbf{if}\;y \leq -18000000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10000000:\\
\;\;\;\;1 - \log \left(1 - \frac{x - y}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 7.7 |
|---|
| Cost | 7248 |
|---|
\[\begin{array}{l}
t_0 := 1 - \log \left(\frac{-1}{y}\right)\\
t_1 := 1 - \log \left(\frac{x}{y}\right)\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+180}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -20.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 1.3 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1 - \log \left(\frac{x - 1}{y}\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-8}:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x}{y - 1}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 13.6 |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -22:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - x\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 24.9 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.85:\\
\;\;\;\;1 - \log \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x - -1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 24.6 |
|---|
| Cost | 6720 |
|---|
\[1 - \log \left(1 - x\right)
\]
| Alternative 10 |
|---|
| Error | 37.0 |
|---|
| Cost | 192 |
|---|
\[x - -1
\]
| Alternative 11 |
|---|
| Error | 37.1 |
|---|
| Cost | 64 |
|---|
\[1
\]