\[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\]
↓
\[x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}
\]
(FPCore (x y z t)
:precision binary64
(- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
↓
(FPCore (x y z t) :precision binary64 (- x (/ (log1p (* y (expm1 z))) t)))
double code(double x, double y, double z, double t) {
return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
↓
double code(double x, double y, double z, double t) {
return x - (log1p((y * expm1(z))) / t);
}
public static double code(double x, double y, double z, double t) {
return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
↓
public static double code(double x, double y, double z, double t) {
return x - (Math.log1p((y * Math.expm1(z))) / t);
}
def code(x, y, z, t):
return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
↓
def code(x, y, z, t):
return x - (math.log1p((y * math.expm1(z))) / t)
function code(x, y, z, t)
return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
↓
function code(x, y, z, t)
return Float64(x - Float64(log1p(Float64(y * expm1(z))) / t))
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(x - N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
↓
x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 87.6% |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \mathsf{expm1}\left(z\right)\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+64}:\\
\;\;\;\;x - \frac{1}{t \cdot 0.5 + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}\\
\mathbf{elif}\;y \leq -1.38 \cdot 10^{+17}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(t_1\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{t \cdot 0.5 + \frac{t}{t_1}}\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 89.4% |
|---|
| Cost | 7232 |
|---|
\[x - \frac{1}{t \cdot 0.5 + \frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}
\]
| Alternative 3 |
|---|
| Accuracy | 90.6% |
|---|
| Cost | 7113 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -490 \lor \neg \left(y \leq 0.01\right):\\
\;\;\;\;x - \frac{1}{t \cdot 0.5 + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 88.0% |
|---|
| Cost | 6980 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -490:\\
\;\;\;\;x - \frac{1}{t \cdot 0.5 + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 84.9% |
|---|
| Cost | 1348 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -490:\\
\;\;\;\;x - \frac{1}{t \cdot 0.5 + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{t}{z} + t \cdot -0.5}{y}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 81.3% |
|---|
| Cost | 832 |
|---|
\[x - \frac{1}{\frac{\frac{t}{z} + t \cdot -0.5}{y}}
\]
| Alternative 7 |
|---|
| Accuracy | 69.9% |
|---|
| Cost | 648 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+48}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -0.0004:\\
\;\;\;\;\frac{z}{t} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 69.8% |
|---|
| Cost | 648 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+48}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -0.0004:\\
\;\;\;\;\frac{-z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 81.7% |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\end{array}
\]
| Alternative 10 |
|---|
| Accuracy | 81.8% |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\end{array}
\]
| Alternative 11 |
|---|
| Accuracy | 71.6% |
|---|
| Cost | 64 |
|---|
\[x
\]