\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 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
t_2 := \sqrt{t_1}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1.8210917523283662 \cdot 10^{+180}:\\
\;\;\;\;\sin^{-1} \left(\frac{t_2}{-\frac{t \cdot \sqrt{2}}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 1.7392727750868362 \cdot 10^{+112}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_1}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t_2 \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\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 (- 1.0 (pow (/ Om Omc) 2.0))) (t_2 (sqrt t_1)))
(if (<= (/ t l) -1.8210917523283662e+180)
(asin (/ t_2 (- (/ (* t (sqrt 2.0)) l))))
(if (<= (/ t l) 1.7392727750868362e+112)
(asin (sqrt (log1p (expm1 (/ t_1 (fma 2.0 (pow (/ t l) 2.0) 1.0))))))
(asin (* t_2 (/ (* l (sqrt 0.5)) t)))))))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 = 1.0 - pow((Om / Omc), 2.0);
double t_2 = sqrt(t_1);
double tmp;
if ((t / l) <= -1.8210917523283662e+180) {
tmp = asin(t_2 / -((t * sqrt(2.0)) / l));
} else if ((t / l) <= 1.7392727750868362e+112) {
tmp = asin(sqrt(log1p(expm1(t_1 / fma(2.0, pow((t / l), 2.0), 1.0)))));
} else {
tmp = asin(t_2 * ((l * sqrt(0.5)) / t));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus Om



Bits error versus Omc
if (/.f64 t l) < -1.8210917523283662e180Initial program 30.1
Simplified30.1
Applied sqrt-div_binary6430.1
Taylor expanded in t around -inf 1.4
if -1.8210917523283662e180 < (/.f64 t l) < 1.73927277508683619e112Initial program 2.1
Simplified2.1
Applied log1p-expm1-u_binary642.1
if 1.73927277508683619e112 < (/.f64 t l) Initial program 29.3
Simplified29.3
Taylor expanded in t around inf 9.0
Simplified0.3
Final simplification1.7
herbie shell --seed 2022087
(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)))))))