\[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\]
↓
\[\left(x + \left(-1 + \left(e^{\mathsf{log1p}\left(y\right)} + \log y \cdot \left(-0.5 - y\right)\right)\right)\right) - z
\]
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
↓
(FPCore (x y z)
:precision binary64
(- (+ x (+ -1.0 (+ (exp (log1p y)) (* (log y) (- -0.5 y))))) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + y) - z;
}
↓
double code(double x, double y, double z) {
return (x + (-1.0 + (exp(log1p(y)) + (log(y) * (-0.5 - y))))) - z;
}
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
↓
public static double code(double x, double y, double z) {
return (x + (-1.0 + (Math.exp(Math.log1p(y)) + (Math.log(y) * (-0.5 - y))))) - z;
}
def code(x, y, z):
return ((x - ((y + 0.5) * math.log(y))) + y) - z
↓
def code(x, y, z):
return (x + (-1.0 + (math.exp(math.log1p(y)) + (math.log(y) * (-0.5 - y))))) - z
function code(x, y, z)
return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z)
end
↓
function code(x, y, z)
return Float64(Float64(x + Float64(-1.0 + Float64(exp(log1p(y)) + Float64(log(y) * Float64(-0.5 - y))))) - z)
end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(x + N[(-1.0 + N[(N[Exp[N[Log[1 + y], $MachinePrecision]], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-0.5 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
↓
\left(x + \left(-1 + \left(e^{\mathsf{log1p}\left(y\right)} + \log y \cdot \left(-0.5 - y\right)\right)\right)\right) - z
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 13376 |
|---|
\[x + \mathsf{fma}\left(\log y, -0.5 - y, y - z\right)
\]
| Alternative 2 |
|---|
| Error | 17.2 |
|---|
| Cost | 7904 |
|---|
\[\begin{array}{l}
t_0 := y + \log y \cdot \left(-0.5 - y\right)\\
t_1 := y \cdot \left(1 - \log y\right) - z\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+155}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -0.0036:\\
\;\;\;\;x - z\\
\mathbf{elif}\;x \leq -2.02 \cdot 10^{-81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-190}:\\
\;\;\;\;\log y \cdot -0.5 - z\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 16.6 |
|---|
| Cost | 7904 |
|---|
\[\begin{array}{l}
t_0 := \left(x + y\right) - y \cdot \log y\\
t_1 := y \cdot \left(1 - \log y\right) - z\\
t_2 := 0.5 \cdot \log y\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-148}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-170}:\\
\;\;\;\;\left(x + y\right) - t_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-286}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-162}:\\
\;\;\;\;y + \log y \cdot \left(-0.5 - y\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-14}:\\
\;\;\;\;x - t_2\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+143}:\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 20.2 |
|---|
| Cost | 7645 |
|---|
\[\begin{array}{l}
t_0 := \log y \cdot -0.5 - z\\
\mathbf{if}\;y \leq 3.3 \cdot 10^{-179}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-121}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-47}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+125} \lor \neg \left(y \leq 8 \cdot 10^{+144}\right) \land y \leq 3.5 \cdot 10^{+190}:\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 19.5 |
|---|
| Cost | 7381 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 1.4 \cdot 10^{-179}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-105}:\\
\;\;\;\;x - 0.5 \cdot \log y\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+125} \lor \neg \left(y \leq 1.65 \cdot 10^{+146}\right) \land y \leq 3.3 \cdot 10^{+190}:\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 6.9 |
|---|
| Cost | 7244 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+120}:\\
\;\;\;\;\left(y - z\right) - y \cdot \log y\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+14}:\\
\;\;\;\;\left(x + y\right) + \log y \cdot \left(-0.5 - y\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+140}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right) - z\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 19.1 |
|---|
| Cost | 7117 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+125} \lor \neg \left(y \leq 1.6 \cdot 10^{+147}\right) \land y \leq 3.2 \cdot 10^{+190}:\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 6.8 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.25 \cdot 10^{+52}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+148}:\\
\;\;\;\;\left(x + y\right) - y \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right) - z\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 6.8 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := y \cdot \left(1 - \log y\right)\\
\mathbf{if}\;y \leq 2.6 \cdot 10^{+52}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+147}:\\
\;\;\;\;x + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 - z\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 0.1 |
|---|
| Cost | 7104 |
|---|
\[\left(y - z\right) + \left(x + \log y \cdot \left(-0.5 - y\right)\right)
\]
| Alternative 11 |
|---|
| Error | 33.8 |
|---|
| Cost | 392 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+55}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+116}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 27.2 |
|---|
| Cost | 192 |
|---|
\[x - z
\]
| Alternative 13 |
|---|
| Error | 45.1 |
|---|
| Cost | 64 |
|---|
\[x
\]