\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\begin{array}{l}
t_1 := \frac{\ell \cdot \sqrt{0.5}}{t}\\
\mathbf{if}\;\frac{t}{\ell} \leq -9.571535657966036 \cdot 10^{+160}:\\
\;\;\;\;\sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot t_1\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 1.575323330487734 \cdot 10^{+157}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t_1 \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)\\
\end{array}
(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
(let* ((t_1 (/ (* l (sqrt 0.5)) t)))
(if (<= (/ t l) -9.571535657966036e+160)
(asin (- (* (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc)))) t_1)))
(if (<= (/ t l) 1.575323330487734e+157)
(asin
(sqrt
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0))))))
(asin (* t_1 (sqrt (- 1.0 (/ (pow Om 2.0) (pow Omc 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) {
double t_1 = (l * sqrt(0.5)) / t;
double tmp;
if ((t / l) <= -9.571535657966036e+160) {
tmp = asin(-(sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * t_1));
} else if ((t / l) <= 1.575323330487734e+157) {
tmp = asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
} else {
tmp = asin((t_1 * sqrt((1.0 - (pow(Om, 2.0) / pow(Omc, 2.0))))));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus Om



Bits error versus Omc
Results
if (/.f64 t l) < -9.5715356579660361e160Initial program 34.5
Simplified34.5
Taylor expanded in t around -inf 7.1
Simplified7.1
if -9.5715356579660361e160 < (/.f64 t l) < 1.5753233304877341e157Initial program 1.3
if 1.5753233304877341e157 < (/.f64 t l) Initial program 32.3
Simplified32.3
Taylor expanded in t around inf 8.1
Final simplification3.0
herbie shell --seed 2022130
(FPCore (t l Om Omc)
:name "Toniolo and Linder, Equation (2)"
:precision binary64
(asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))