\[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)
\]
↓
\[a + \left(-0.3333333333333333 + \frac{-0.3333333333333333 + a}{\frac{\sqrt{-0.3333333333333333 + a} \cdot 3}{rand}}\right)
\]
(FPCore (a rand)
:precision binary64
(*
(- a (/ 1.0 3.0))
(+ 1.0 (* (/ 1.0 (sqrt (* 9.0 (- a (/ 1.0 3.0))))) rand))))
↓
(FPCore (a rand)
:precision binary64
(+
a
(+
-0.3333333333333333
(/
(+ -0.3333333333333333 a)
(/ (* (sqrt (+ -0.3333333333333333 a)) 3.0) rand)))))double code(double a, double rand) {
return (a - (1.0 / 3.0)) * (1.0 + ((1.0 / sqrt((9.0 * (a - (1.0 / 3.0))))) * rand));
}
↓
double code(double a, double rand) {
return a + (-0.3333333333333333 + ((-0.3333333333333333 + a) / ((sqrt((-0.3333333333333333 + a)) * 3.0) / rand)));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a - (1.0d0 / 3.0d0)) * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * (a - (1.0d0 / 3.0d0))))) * rand))
end function
↓
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a + ((-0.3333333333333333d0) + (((-0.3333333333333333d0) + a) / ((sqrt(((-0.3333333333333333d0) + a)) * 3.0d0) / rand)))
end function
public static double code(double a, double rand) {
return (a - (1.0 / 3.0)) * (1.0 + ((1.0 / Math.sqrt((9.0 * (a - (1.0 / 3.0))))) * rand));
}
↓
public static double code(double a, double rand) {
return a + (-0.3333333333333333 + ((-0.3333333333333333 + a) / ((Math.sqrt((-0.3333333333333333 + a)) * 3.0) / rand)));
}
def code(a, rand):
return (a - (1.0 / 3.0)) * (1.0 + ((1.0 / math.sqrt((9.0 * (a - (1.0 / 3.0))))) * rand))
↓
def code(a, rand):
return a + (-0.3333333333333333 + ((-0.3333333333333333 + a) / ((math.sqrt((-0.3333333333333333 + a)) * 3.0) / rand)))
function code(a, rand)
return Float64(Float64(a - Float64(1.0 / 3.0)) * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * Float64(a - Float64(1.0 / 3.0))))) * rand)))
end
↓
function code(a, rand)
return Float64(a + Float64(-0.3333333333333333 + Float64(Float64(-0.3333333333333333 + a) / Float64(Float64(sqrt(Float64(-0.3333333333333333 + a)) * 3.0) / rand))))
end
function tmp = code(a, rand)
tmp = (a - (1.0 / 3.0)) * (1.0 + ((1.0 / sqrt((9.0 * (a - (1.0 / 3.0))))) * rand));
end
↓
function tmp = code(a, rand)
tmp = a + (-0.3333333333333333 + ((-0.3333333333333333 + a) / ((sqrt((-0.3333333333333333 + a)) * 3.0) / rand)));
end
code[a_, rand_] := N[(N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[a_, rand_] := N[(a + N[(-0.3333333333333333 + N[(N[(-0.3333333333333333 + a), $MachinePrecision] / N[(N[(N[Sqrt[N[(-0.3333333333333333 + a), $MachinePrecision]], $MachinePrecision] * 3.0), $MachinePrecision] / rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)
↓
a + \left(-0.3333333333333333 + \frac{-0.3333333333333333 + a}{\frac{\sqrt{-0.3333333333333333 + a} \cdot 3}{rand}}\right)
Alternatives
| Alternative 1 |
|---|
| Error | 5.9 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(\sqrt{a - 0.3333333333333333} \cdot rand\right)\\
\mathbf{if}\;rand \leq -7.6 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq 4.5 \cdot 10^{+52}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 5.8 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := rand \cdot \left(0.3333333333333333 \cdot \sqrt{-0.3333333333333333 + a}\right)\\
\mathbf{if}\;rand \leq -1.35 \cdot 10^{+73}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq 4.6 \cdot 10^{+52}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 5.8 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := \sqrt{a - 0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)\\
\mathbf{if}\;rand \leq -1.2 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq 4.6 \cdot 10^{+52}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.8 |
|---|
| Cost | 7104 |
|---|
\[\left(a - 0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{a \cdot 9}}\right)
\]
| Alternative 5 |
|---|
| Error | 0.2 |
|---|
| Cost | 7104 |
|---|
\[\left(0.3333333333333333 \cdot \left(\sqrt{a - 0.3333333333333333} \cdot rand\right) + a\right) - 0.3333333333333333
\]
| Alternative 6 |
|---|
| Error | 0.1 |
|---|
| Cost | 7104 |
|---|
\[\left(\sqrt{-0.3333333333333333 + a} \cdot \left(rand \cdot 0.3333333333333333\right) + a\right) - 0.3333333333333333
\]
| Alternative 7 |
|---|
| Error | 6.4 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(\sqrt{a} \cdot rand\right)\\
\mathbf{if}\;rand \leq -3.8 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq 3.5 \cdot 10^{+51}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 6.3 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_0 := rand \cdot \left(\sqrt{a} \cdot 0.3333333333333333\right)\\
\mathbf{if}\;rand \leq -4.5 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq 4.6 \cdot 10^{+52}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 6.3 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_0 := \sqrt{a} \cdot \left(0.3333333333333333 \cdot rand\right)\\
\mathbf{if}\;rand \leq -1.15 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq 4.6 \cdot 10^{+52}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 18.9 |
|---|
| Cost | 192 |
|---|
\[a - 0.3333333333333333
\]
| Alternative 11 |
|---|
| Error | 63.1 |
|---|
| Cost | 64 |
|---|
\[-0.3333333333333333
\]
| Alternative 12 |
|---|
| Error | 19.7 |
|---|
| Cost | 64 |
|---|
\[a
\]