\[1 - \log \left(1 - \frac{x - y}{1 - y}\right)
\]
↓
\[\begin{array}{l}
t_0 := \frac{e}{1 - x}\\
\log \left(t_0 - t_0 \cdot y\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 (/ E (- 1.0 x)))) (log (- t_0 (* t_0 y)))))
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 = ((double) M_E) / (1.0 - x);
return log((t_0 - (t_0 * y)));
}
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 = Math.E / (1.0 - x);
return Math.log((t_0 - (t_0 * y)));
}
def code(x, y):
return 1.0 - math.log((1.0 - ((x - y) / (1.0 - y))))
↓
def code(x, y):
t_0 = math.e / (1.0 - x)
return math.log((t_0 - (t_0 * y)))
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(exp(1) / Float64(1.0 - x))
return log(Float64(t_0 - Float64(t_0 * y)))
end
function tmp = code(x, y)
tmp = 1.0 - log((1.0 - ((x - y) / (1.0 - y))));
end
↓
function tmp = code(x, y)
t_0 = 2.71828182845904523536 / (1.0 - x);
tmp = log((t_0 - (t_0 * y)));
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[(E / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]}, N[Log[N[(t$95$0 - N[(t$95$0 * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
1 - \log \left(1 - \frac{x - y}{1 - y}\right)
↓
\begin{array}{l}
t_0 := \frac{e}{1 - x}\\
\log \left(t_0 - t_0 \cdot y\right)
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 99.4% |
|---|
| Cost | 14084 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -12500:\\
\;\;\;\;1 + \left(\frac{-1}{y} + \left(\frac{-0.5}{y \cdot y} - \left(\mathsf{log1p}\left(-x\right) + \log \left(\frac{-1}{y}\right)\right)\right)\right)\\
\mathbf{elif}\;y \leq 0.001:\\
\;\;\;\;1 - \mathsf{log1p}\left(\frac{y - x}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x + -1}{y}\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 99.8% |
|---|
| Cost | 7492 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \leq 0.999995:\\
\;\;\;\;1 - \mathsf{log1p}\left(\frac{y - x}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\frac{x + -1}{y}\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 98.7% |
|---|
| Cost | 7113 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.76 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;1 - \log \left(\frac{x + -1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(y + \mathsf{log1p}\left(-x\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 79.8% |
|---|
| Cost | 6916 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -17.5:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(y + \mathsf{log1p}\left(-x\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 79.1% |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -162:\\
\;\;\;\;1 - \log \left(\frac{-1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \mathsf{log1p}\left(-x\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 62.9% |
|---|
| Cost | 6656 |
|---|
\[1 - \mathsf{log1p}\left(-x\right)
\]
| Alternative 7 |
|---|
| Accuracy | 44.1% |
|---|
| Cost | 448 |
|---|
\[1 + \frac{x}{1 - y}
\]
| Alternative 8 |
|---|
| Accuracy | 42.4% |
|---|
| Cost | 64 |
|---|
\[1
\]