\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\]
↓
\[\begin{array}{l}
t_0 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{+269} \lor \neg \left(t_0 \leq 10^{+258}\right):\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, -\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)\right)\right) + \frac{t_0 + 0.083333333333333}{x}\\
\end{array}
\]
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ -0.0027777777777778 (* (+ y 0.0007936500793651) z)))))
(if (or (<= t_0 -5e+269) (not (<= t_0 1e+258)))
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(* (+ y 0.0007936500793651) (/ z (/ x z))))
(+
(+ 0.91893853320467 (fma (log x) (+ x -0.5) (- (expm1 (log1p x)))))
(/ (+ t_0 0.083333333333333) x)))))double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
↓
double code(double x, double y, double z) {
double t_0 = z * (-0.0027777777777778 + ((y + 0.0007936500793651) * z));
double tmp;
if ((t_0 <= -5e+269) || !(t_0 <= 1e+258)) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
} else {
tmp = (0.91893853320467 + fma(log(x), (x + -0.5), -expm1(log1p(x)))) + ((t_0 + 0.083333333333333) / x);
}
return tmp;
}
function code(x, y, z)
return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x))
end
↓
function code(x, y, z)
t_0 = Float64(z * Float64(-0.0027777777777778 + Float64(Float64(y + 0.0007936500793651) * z)))
tmp = 0.0
if ((t_0 <= -5e+269) || !(t_0 <= 1e+258))
tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z))));
else
tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(-expm1(log1p(x))))) + Float64(Float64(t_0 + 0.083333333333333) / x));
end
return tmp
end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-0.0027777777777778 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e+269], N[Not[LessEqual[t$95$0, 1e+258]], $MachinePrecision]], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + (-N[(Exp[N[Log[1 + x], $MachinePrecision]] - 1), $MachinePrecision])), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
↓
\begin{array}{l}
t_0 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{+269} \lor \neg \left(t_0 \leq 10^{+258}\right):\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, -\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)\right)\right) + \frac{t_0 + 0.083333333333333}{x}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 27977 |
|---|
\[\begin{array}{l}
t_0 := \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\
t_1 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+269} \lor \neg \left(t_1 \leq 2 \cdot 10^{+169}\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.4 |
|---|
| Cost | 15561 |
|---|
\[\begin{array}{l}
t_0 := \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\
t_1 := \left(y + 0.0007936500793651\right) \cdot z\\
t_2 := z \cdot \left(-0.0027777777777778 + t_1\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+269} \lor \neg \left(t_2 \leq 2 \cdot 10^{+169}\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{\left(0.083333333333333 + z \cdot t_1\right) + z \cdot -0.0027777777777778}{x}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.4 |
|---|
| Cost | 14020 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 15500000:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 2.5 |
|---|
| Cost | 8268 |
|---|
\[\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
t_1 := \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
t_2 := \left(y + 0.0007936500793651\right) \cdot z\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{z}{\frac{x}{t_2}}\\
\mathbf{elif}\;z \leq -5 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + t_1\\
\mathbf{elif}\;z \leq 10^{+18}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + t_2\right) + 0.083333333333333}{x} + t_0\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0 + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 3.4 |
|---|
| Cost | 8144 |
|---|
\[\begin{array}{l}
t_0 := \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{z}{\frac{x}{\left(y + 0.0007936500793651\right) \cdot z}}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + t_0\\
\mathbf{elif}\;z \leq 11:\\
\;\;\;\;t_1 + \frac{0.083333333333333 + z \cdot \left(y \cdot z\right)}{x}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1 + t_0\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 3.6 |
|---|
| Cost | 8144 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
t_1 := \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
t_2 := \left(y + 0.0007936500793651\right) \cdot z\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{z}{\frac{x}{t_2}}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{+29}:\\
\;\;\;\;t_0 + t_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+16}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + t_2\right) + 0.083333333333333}{x} + \left(0.91893853320467 + t_0\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 2.4 |
|---|
| Cost | 7880 |
|---|
\[\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+132}:\\
\;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + z \cdot \frac{0.0007936500793651 \cdot z}{x}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 3.1 |
|---|
| Cost | 7752 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+132}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \frac{0.0007936500793651 \cdot z}{x}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 2.8 |
|---|
| Cost | 7752 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+132}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \frac{0.0007936500793651 \cdot z}{x}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 5.4 |
|---|
| Cost | 7492 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 7.0 |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 5.6 \cdot 10^{+17}:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 31.5 |
|---|
| Cost | 1096 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -380000000000:\\
\;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\mathbf{elif}\;z \leq 1050000000000:\\
\;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 52.4 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -230000000 \lor \neg \left(y \leq 3.7 \cdot 10^{+26}\right):\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 52.3 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -240000000 \lor \neg \left(y \leq 1.04 \cdot 10^{+21}\right):\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 52.3 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -0.00098 \lor \neg \left(y \leq 0.00029\right):\\
\;\;\;\;z \cdot \left(y \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 51.9 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -230000000 \lor \neg \left(y \leq 0.00029\right):\\
\;\;\;\;\frac{y}{\frac{\frac{x}{z}}{z}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 52.4 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -240000000:\\
\;\;\;\;z \cdot \frac{y}{\frac{x}{z}}\\
\mathbf{elif}\;y \leq 0.00029:\\
\;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \frac{z}{x}\right)\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 51.7 |
|---|
| Cost | 576 |
|---|
\[\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}
\]
| Alternative 19 |
|---|
| Error | 57.0 |
|---|
| Cost | 448 |
|---|
\[0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)
\]