\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\]
↓
\[\left(\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - t\right) + \log y \cdot \left(-1 + x\right)
\]
(FPCore (x y z t)
:precision binary64
(- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
↓
(FPCore (x y z t)
:precision binary64
(+ (- (* (log1p (- y)) (+ z -1.0)) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
↓
double code(double x, double y, double z, double t) {
return ((log1p(-y) * (z + -1.0)) - t) + (log(y) * (-1.0 + x));
}
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
↓
public static double code(double x, double y, double z, double t) {
return ((Math.log1p(-y) * (z + -1.0)) - t) + (Math.log(y) * (-1.0 + x));
}
def code(x, y, z, t):
return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
↓
def code(x, y, z, t):
return ((math.log1p(-y) * (z + -1.0)) - t) + (math.log(y) * (-1.0 + x))
function code(x, y, z, t)
return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t)
end
↓
function code(x, y, z, t)
return Float64(Float64(Float64(log1p(Float64(-y)) * Float64(z + -1.0)) - t) + Float64(log(y) * Float64(-1.0 + x)))
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
↓
\left(\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - t\right) + \log y \cdot \left(-1 + x\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 7616 |
|---|
\[\left(\log y \cdot \left(-1 + x\right) + \left(y \cdot \left(y \cdot -0.5\right) - y\right) \cdot \left(z + -1\right)\right) - t
\]
| Alternative 2 |
|---|
| Error | 2.8 |
|---|
| Cost | 7497 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-1 + x \leq -400000 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - y \cdot z\right) - \log y\right) - t\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 6.7 |
|---|
| Cost | 7241 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+183} \lor \neg \left(z \leq 1.3 \cdot 10^{+233}\right):\\
\;\;\;\;y \cdot \left(1 - z\right) + x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 6.7 |
|---|
| Cost | 7241 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+183} \lor \neg \left(z \leq 1.22 \cdot 10^{+231}\right):\\
\;\;\;\;y \cdot \left(1 - z\right) + x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(y + \log y \cdot \left(-1 + x\right)\right) - t\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 1.1 |
|---|
| Cost | 7241 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1700 \lor \neg \left(x \leq 0.28\right):\\
\;\;\;\;x \cdot \log y - \left(t + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - y \cdot z\right) - \log y\right) - t\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.6 |
|---|
| Cost | 7232 |
|---|
\[\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(1 - z\right)\right) - t
\]
| Alternative 7 |
|---|
| Error | 0.6 |
|---|
| Cost | 7232 |
|---|
\[\log y \cdot \left(-1 + x\right) + \left(y \cdot \left(1 - z\right) - t\right)
\]
| Alternative 8 |
|---|
| Error | 9.7 |
|---|
| Cost | 7113 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.65 \cdot 10^{-89} \lor \neg \left(y \leq 4.6 \cdot 10^{-62}\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - y \cdot z\right) - t\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 14.4 |
|---|
| Cost | 7049 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -7900 \lor \neg \left(x \leq 6.6\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(-y\right) \cdot z - t\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 14.5 |
|---|
| Cost | 6985 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -22500 \lor \neg \left(x \leq 9.5\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(y - y \cdot z\right) - t\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 21.2 |
|---|
| Cost | 6857 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+69} \lor \neg \left(x \leq 1.6 \cdot 10^{+93}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(y - y \cdot z\right) - t\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 36.0 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+40}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;y - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 36.2 |
|---|
| Cost | 520 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+40}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+20}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 33.4 |
|---|
| Cost | 448 |
|---|
\[\left(y - y \cdot z\right) - t
\]
| Alternative 15 |
|---|
| Error | 33.6 |
|---|
| Cost | 384 |
|---|
\[-\left(t + y \cdot z\right)
\]
| Alternative 16 |
|---|
| Error | 40.7 |
|---|
| Cost | 128 |
|---|
\[-t
\]