\[\left(0.0001 \leq \alpha \land \alpha \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\]
\[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\alpha\right) \cdot \left(\left(-1 \cdot \left(u0 \cdot \alpha\right) + \left(-0.3333333333333333 \cdot \left({u0}^{3} \cdot \alpha\right) + -0.5 \cdot \left({u0}^{2} \cdot \alpha\right)\right)\right) + -0.25 \cdot \left({u0}^{4} \cdot \alpha\right)\right)\\
\end{array}
\]
(FPCore (alpha u0)
:precision binary32
(* (* (- alpha) alpha) (log (- 1.0 u0))))
↓
(FPCore (alpha u0)
:precision binary32
(if (<= (- 1.0 u0) 0.9599999785423279)
(* (* (- alpha) alpha) (log (- 1.0 u0)))
(*
(- alpha)
(+
(+
(* -1.0 (* u0 alpha))
(+
(* -0.3333333333333333 (* (pow u0 3.0) alpha))
(* -0.5 (* (pow u0 2.0) alpha))))
(* -0.25 (* (pow u0 4.0) alpha))))))float code(float alpha, float u0) {
return (-alpha * alpha) * logf((1.0f - u0));
}
↓
float code(float alpha, float u0) {
float tmp;
if ((1.0f - u0) <= 0.9599999785423279f) {
tmp = (-alpha * alpha) * logf((1.0f - u0));
} else {
tmp = -alpha * (((-1.0f * (u0 * alpha)) + ((-0.3333333333333333f * (powf(u0, 3.0f) * alpha)) + (-0.5f * (powf(u0, 2.0f) * alpha)))) + (-0.25f * (powf(u0, 4.0f) * alpha)));
}
return tmp;
}
real(4) function code(alpha, u0)
real(4), intent (in) :: alpha
real(4), intent (in) :: u0
code = (-alpha * alpha) * log((1.0e0 - u0))
end function
↓
real(4) function code(alpha, u0)
real(4), intent (in) :: alpha
real(4), intent (in) :: u0
real(4) :: tmp
if ((1.0e0 - u0) <= 0.9599999785423279e0) then
tmp = (-alpha * alpha) * log((1.0e0 - u0))
else
tmp = -alpha * ((((-1.0e0) * (u0 * alpha)) + (((-0.3333333333333333e0) * ((u0 ** 3.0e0) * alpha)) + ((-0.5e0) * ((u0 ** 2.0e0) * alpha)))) + ((-0.25e0) * ((u0 ** 4.0e0) * alpha)))
end if
code = tmp
end function
function code(alpha, u0)
return Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)))
end
↓
function code(alpha, u0)
tmp = Float32(0.0)
if (Float32(Float32(1.0) - u0) <= Float32(0.9599999785423279))
tmp = Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)));
else
tmp = Float32(Float32(-alpha) * Float32(Float32(Float32(Float32(-1.0) * Float32(u0 * alpha)) + Float32(Float32(Float32(-0.3333333333333333) * Float32((u0 ^ Float32(3.0)) * alpha)) + Float32(Float32(-0.5) * Float32((u0 ^ Float32(2.0)) * alpha)))) + Float32(Float32(-0.25) * Float32((u0 ^ Float32(4.0)) * alpha))));
end
return tmp
end
function tmp = code(alpha, u0)
tmp = (-alpha * alpha) * log((single(1.0) - u0));
end
↓
function tmp_2 = code(alpha, u0)
tmp = single(0.0);
if ((single(1.0) - u0) <= single(0.9599999785423279))
tmp = (-alpha * alpha) * log((single(1.0) - u0));
else
tmp = -alpha * (((single(-1.0) * (u0 * alpha)) + ((single(-0.3333333333333333) * ((u0 ^ single(3.0)) * alpha)) + (single(-0.5) * ((u0 ^ single(2.0)) * alpha)))) + (single(-0.25) * ((u0 ^ single(4.0)) * alpha)));
end
tmp_2 = tmp;
end
\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)
↓
\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\alpha\right) \cdot \left(\left(-1 \cdot \left(u0 \cdot \alpha\right) + \left(-0.3333333333333333 \cdot \left({u0}^{3} \cdot \alpha\right) + -0.5 \cdot \left({u0}^{2} \cdot \alpha\right)\right)\right) + -0.25 \cdot \left({u0}^{4} \cdot \alpha\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.5 |
|---|
| Cost | 10500 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;{u0}^{2} \cdot \left(\left(\alpha \cdot \alpha\right) \cdot 0.5\right) - \left(\alpha \cdot \alpha\right) \cdot \left(-0.3333333333333333 \cdot {u0}^{3} + \left(-0.25 \cdot {u0}^{4} - u0\right)\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.5 |
|---|
| Cost | 10372 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;\alpha \cdot \left(\alpha \cdot \left(u0 + \left({u0}^{4} \cdot 0.25 + \left({u0}^{3} \cdot 0.3333333333333333 + 0.5 \cdot {u0}^{2}\right)\right)\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.4 |
|---|
| Cost | 10372 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\alpha \cdot \alpha\right) \cdot \left(u0 - \left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.6 |
|---|
| Cost | 7108 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9860000014305115:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\alpha\right) \cdot \left(\left(-0.5 \cdot {u0}^{2} + -0.3333333333333333 \cdot {u0}^{3}\right) \cdot \alpha - u0 \cdot \alpha\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.6 |
|---|
| Cost | 7076 |
|---|
\[\begin{array}{l}
t_0 := \left(-\alpha\right) \cdot \alpha\\
\mathbf{if}\;1 - u0 \leq 0.9860000014305115:\\
\;\;\;\;t_0 \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\left(-u0\right) + \left(-0.5 \cdot {u0}^{2} + -0.3333333333333333 \cdot {u0}^{3}\right)\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.6 |
|---|
| Cost | 7012 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9860000014305115:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\mathbf{else}:\\
\;\;\;\;\alpha \cdot \left(\alpha \cdot \left(u0 - \left(-0.5 \cdot {u0}^{2} + -0.3333333333333333 \cdot {u0}^{3}\right)\right)\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 1.0 |
|---|
| Cost | 3716 |
|---|
\[\begin{array}{l}
\mathbf{if}\;u0 \leq 0.003700000001117587:\\
\;\;\;\;\alpha \cdot \left(\alpha \cdot u0\right) - \left(-0.5 \cdot {u0}^{2}\right) \cdot \left(\alpha \cdot \alpha\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 1.0 |
|---|
| Cost | 3716 |
|---|
\[\begin{array}{l}
\mathbf{if}\;u0 \leq 0.003700000001117587:\\
\;\;\;\;u0 \cdot \left(\alpha \cdot \alpha\right) - \left(\alpha \cdot \alpha\right) \cdot \left(-0.5 \cdot {u0}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 3.2 |
|---|
| Cost | 3588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9998649954795837:\\
\;\;\;\;\left(-\alpha\right) \cdot \left(\alpha \cdot \log \left(1 - u0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;u0 \cdot \left(\alpha \cdot \alpha\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 1.0 |
|---|
| Cost | 3588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;u0 \leq 0.003700000001117587:\\
\;\;\;\;\alpha \cdot \left(\alpha \cdot \left(u0 + {u0}^{2} \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 1.0 |
|---|
| Cost | 3588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;u0 \leq 0.003700000001117587:\\
\;\;\;\;\left(u0 + {u0}^{2} \cdot 0.5\right) \cdot \left(\alpha \cdot \alpha\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 3.2 |
|---|
| Cost | 3524 |
|---|
\[\begin{array}{l}
\mathbf{if}\;u0 \leq 0.00013499999477062374:\\
\;\;\;\;u0 \cdot \left(\alpha \cdot \alpha\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 8.1 |
|---|
| Cost | 160 |
|---|
\[\alpha \cdot \left(u0 \cdot \alpha\right)
\]
| Alternative 14 |
|---|
| Error | 8.1 |
|---|
| Cost | 160 |
|---|
\[u0 \cdot \left(\alpha \cdot \alpha\right)
\]