\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}\\
t_2 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
t_3 := \sqrt{t_2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1.7351943106705547 \cdot 10^{+68}:\\
\;\;\;\;\sin^{-1} \left(t_3 \cdot \left(-t_1\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 494140.4287704275:\\
\;\;\;\;\begin{array}{l}
t_4 := \mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)\\
t_5 := \sqrt{\sqrt{\sin^{-1} \left(\frac{t_3}{\sqrt{t_4}}\right)}}\\
\sqrt{\sin^{-1} \left(\sqrt{\frac{t_2}{t_4}}\right)} \cdot \left(t_5 \cdot t_5\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t_3 \cdot t_1\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))
(t_2 (- 1.0 (pow (/ Om Omc) 2.0)))
(t_3 (sqrt t_2)))
(if (<= (/ t l) -1.7351943106705547e+68)
(asin (* t_3 (- t_1)))
(if (<= (/ t l) 494140.4287704275)
(let* ((t_4 (fma 2.0 (pow (/ t l) 2.0) 1.0))
(t_5 (sqrt (sqrt (asin (/ t_3 (sqrt t_4)))))))
(* (sqrt (asin (sqrt (/ t_2 t_4)))) (* t_5 t_5)))
(asin (* t_3 t_1))))))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 t_2 = 1.0 - pow((Om / Omc), 2.0);
double t_3 = sqrt(t_2);
double tmp;
if ((t / l) <= -1.7351943106705547e+68) {
tmp = asin(t_3 * -t_1);
} else if ((t / l) <= 494140.4287704275) {
double t_4 = fma(2.0, pow((t / l), 2.0), 1.0);
double t_5 = sqrt(sqrt(asin(t_3 / sqrt(t_4))));
tmp = sqrt(asin(sqrt(t_2 / t_4))) * (t_5 * t_5);
} else {
tmp = asin(t_3 * t_1);
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus Om



Bits error versus Omc
if (/.f64 t l) < -1.7351943106705547e68Initial program 23.8
Simplified23.8
Taylor expanded in t around -inf 7.2
Simplified0.3
if -1.7351943106705547e68 < (/.f64 t l) < 494140.42877042748Initial program 1.1
Simplified1.1
Applied add-sqr-sqrt_binary641.9
Applied sqrt-div_binary641.9
Applied add-sqr-sqrt_binary641.1
if 494140.42877042748 < (/.f64 t l) Initial program 18.6
Simplified18.6
Taylor expanded in t around inf 8.2
Simplified0.4
Final simplification0.8
herbie shell --seed 2022094
(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)))))))