\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\]
↓
\[\left(z \cdot \left(0.3333333333333333 \cdot \left(3 \cdot \mathsf{log1p}\left(-y\right)\right)\right) + x \cdot \log y\right) - t
\]
(FPCore (x y z t)
:precision binary64
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
↓
(FPCore (x y z t)
:precision binary64
(- (+ (* z (* 0.3333333333333333 (* 3.0 (log1p (- y))))) (* x (log y))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
↓
double code(double x, double y, double z, double t) {
return ((z * (0.3333333333333333 * (3.0 * log1p(-y)))) + (x * log(y))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
↓
public static double code(double x, double y, double z, double t) {
return ((z * (0.3333333333333333 * (3.0 * Math.log1p(-y)))) + (x * Math.log(y))) - t;
}
def code(x, y, z, t):
return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
↓
def code(x, y, z, t):
return ((z * (0.3333333333333333 * (3.0 * math.log1p(-y)))) + (x * math.log(y))) - t
function code(x, y, z, t)
return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t)
end
↓
function code(x, y, z, t)
return Float64(Float64(Float64(z * Float64(0.3333333333333333 * Float64(3.0 * log1p(Float64(-y))))) + Float64(x * log(y))) - t)
end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(N[(N[(z * N[(0.3333333333333333 * N[(3.0 * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
↓
\left(z \cdot \left(0.3333333333333333 \cdot \left(3 \cdot \mathsf{log1p}\left(-y\right)\right)\right) + x \cdot \log y\right) - t
Alternatives
| Alternative 1 |
|---|
| Error | 6.3 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - t\\
\mathbf{if}\;t \leq -2.008210813311964 \cdot 10^{-75}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.850130319430743 \cdot 10^{-86}:\\
\;\;\;\;t_1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 7.4 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -7.432213117427062 \cdot 10^{-136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.060342914185974 \cdot 10^{-205}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 13.9 |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -6.267401684283695 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.1310013792096254 \cdot 10^{+62}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(-1 + y \cdot -0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 27.0 |
|---|
| Cost | 704 |
|---|
\[\left(y \cdot z\right) \cdot \left(-1 + y \cdot -0.5\right) - t
\]
| Alternative 5 |
|---|
| Error | 32.7 |
|---|
| Cost | 520 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -9.503827415252146 \cdot 10^{-76}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 3.850130319430743 \cdot 10^{-86}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 27.2 |
|---|
| Cost | 384 |
|---|
\[y \cdot \left(-z\right) - t
\]
| Alternative 7 |
|---|
| Error | 36.6 |
|---|
| Cost | 128 |
|---|
\[-t
\]