\[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\]
↓
\[\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\]
(FPCore (t l Om Omc)
:precision binary64
(asin
(sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
↓
(FPCore (t l Om Omc)
:precision binary64
(asin
(/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
↓
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
↓
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc):
return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
↓
def code(t, l, Om, Omc):
return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc)
return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0))))))
end
↓
function code(t, l, Om, Omc)
return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0)))))
end
function tmp = code(t, l, Om, Omc)
tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0))))));
end
↓
function tmp = code(t, l, Om, Omc)
tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
↓
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
↓
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
Alternatives
| Alternative 1 |
|---|
| Error | 1.6 |
|---|
| Cost | 32512 |
|---|
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right)\right)\right)
\]
| Alternative 2 |
|---|
| Error | 1.6 |
|---|
| Cost | 19712 |
|---|
\[\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\frac{\ell}{\sqrt{2}}}\right)}\right)
\]
| Alternative 3 |
|---|
| Error | 1.6 |
|---|
| Cost | 19712 |
|---|
\[\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\sqrt{2}}{\frac{\ell}{t}}\right)}\right)
\]
| Alternative 4 |
|---|
| Error | 1.3 |
|---|
| Cost | 14408 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{\sqrt{2}}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 200000000000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + \frac{t}{\ell} \cdot \frac{2 \cdot t}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{t} \cdot \left(\ell + \frac{\ell}{\frac{Omc}{Om} \cdot \frac{Omc}{Om}} \cdot -0.5\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 1.5 |
|---|
| Cost | 14152 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{\sqrt{2}}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+75}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + \frac{t}{\ell} \cdot \frac{2 \cdot t}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 1.9 |
|---|
| Cost | 13960 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{\sqrt{2}}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.001:\\
\;\;\;\;\sin^{-1} \left(1 + \left(1 + \left(-1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 1.6 |
|---|
| Cost | 13896 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{\sqrt{2}}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.001:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 13.4 |
|---|
| Cost | 13640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+209}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.001:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 13.3 |
|---|
| Cost | 13640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+209}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.001:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 2.0 |
|---|
| Cost | 13640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.001:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 2.0 |
|---|
| Cost | 13640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{\sqrt{2}}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.001:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 23.5 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\ell \leq -9 \cdot 10^{-99}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 5.4 \cdot 10^{-74}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 23.5 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\ell \leq -2.85 \cdot 10^{-99}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-74}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 31.9 |
|---|
| Cost | 6464 |
|---|
\[\sin^{-1} 1
\]