Toniolo and Linder, Equation (2)

Percentage Accurate: 84.4% → 98.9%
Time: 26.0s
Alternatives: 10
Speedup: 1.3×

Specification

?
\[\begin{array}{l} \\ \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{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)))))))
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))))));
}
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
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))))));
}
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))))))
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 tmp = code(t, l, Om, Omc)
	tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 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]
\begin{array}{l}

\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 84.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{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)))))))
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))))));
}
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
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))))));
}
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))))))
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 tmp = code(t, l, Om, Omc)
	tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 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]
\begin{array}{l}

\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}

Alternative 1: 98.9% accurate, 1.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\ t_2 := 1 - t_1\\ \mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+98}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{t_2} \cdot \frac{-\ell}{t \cdot \sqrt{2}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+104}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_2}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + t_1 \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (let* ((t_1 (pow (/ Om Omc) 2.0)) (t_2 (- 1.0 t_1)))
   (if (<= (/ t l) -5e+98)
     (asin (* (sqrt t_2) (/ (- l) (* t (sqrt 2.0)))))
     (if (<= (/ t l) 2e+104)
       (asin (sqrt (/ t_2 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
       (asin (* (+ 1.0 (* t_1 -0.5)) (* (/ l t) (sqrt 0.5))))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double t_1 = pow((Om / Omc), 2.0);
	double t_2 = 1.0 - t_1;
	double tmp;
	if ((t / l) <= -5e+98) {
		tmp = asin((sqrt(t_2) * (-l / (t * sqrt(2.0)))));
	} else if ((t / l) <= 2e+104) {
		tmp = asin(sqrt((t_2 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
	} else {
		tmp = asin(((1.0 + (t_1 * -0.5)) * ((l / t) * sqrt(0.5))));
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (om / omc) ** 2.0d0
    t_2 = 1.0d0 - t_1
    if ((t / l) <= (-5d+98)) then
        tmp = asin((sqrt(t_2) * (-l / (t * sqrt(2.0d0)))))
    else if ((t / l) <= 2d+104) then
        tmp = asin(sqrt((t_2 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
    else
        tmp = asin(((1.0d0 + (t_1 * (-0.5d0))) * ((l / t) * sqrt(0.5d0))))
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	double t_1 = Math.pow((Om / Omc), 2.0);
	double t_2 = 1.0 - t_1;
	double tmp;
	if ((t / l) <= -5e+98) {
		tmp = Math.asin((Math.sqrt(t_2) * (-l / (t * Math.sqrt(2.0)))));
	} else if ((t / l) <= 2e+104) {
		tmp = Math.asin(Math.sqrt((t_2 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
	} else {
		tmp = Math.asin(((1.0 + (t_1 * -0.5)) * ((l / t) * Math.sqrt(0.5))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	t_1 = math.pow((Om / Omc), 2.0)
	t_2 = 1.0 - t_1
	tmp = 0
	if (t / l) <= -5e+98:
		tmp = math.asin((math.sqrt(t_2) * (-l / (t * math.sqrt(2.0)))))
	elif (t / l) <= 2e+104:
		tmp = math.asin(math.sqrt((t_2 / (1.0 + (2.0 * ((t / l) * (t / l)))))))
	else:
		tmp = math.asin(((1.0 + (t_1 * -0.5)) * ((l / t) * math.sqrt(0.5))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	t_1 = Float64(Om / Omc) ^ 2.0
	t_2 = Float64(1.0 - t_1)
	tmp = 0.0
	if (Float64(t / l) <= -5e+98)
		tmp = asin(Float64(sqrt(t_2) * Float64(Float64(-l) / Float64(t * sqrt(2.0)))));
	elseif (Float64(t / l) <= 2e+104)
		tmp = asin(sqrt(Float64(t_2 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l)))))));
	else
		tmp = asin(Float64(Float64(1.0 + Float64(t_1 * -0.5)) * Float64(Float64(l / t) * sqrt(0.5))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	t_1 = (Om / Omc) ^ 2.0;
	t_2 = 1.0 - t_1;
	tmp = 0.0;
	if ((t / l) <= -5e+98)
		tmp = asin((sqrt(t_2) * (-l / (t * sqrt(2.0)))));
	elseif ((t / l) <= 2e+104)
		tmp = asin(sqrt((t_2 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
	else
		tmp = asin(((1.0 + (t_1 * -0.5)) * ((l / t) * sqrt(0.5))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - t$95$1), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -5e+98], N[ArcSin[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+104], N[ArcSin[N[Sqrt[N[(t$95$2 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
t_2 := 1 - t_1\\
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+98}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t_2} \cdot \frac{-\ell}{t \cdot \sqrt{2}}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+104}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_2}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\left(1 + t_1 \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 t l) < -4.9999999999999998e98

    1. Initial program 57.2%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. sqrt-div57.1%

        \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)} \]
      2. div-inv57.1%

        \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)} \]
      3. add-sqr-sqrt57.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\sqrt{1 + \color{blue}{\sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}} \cdot \sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}}}\right) \]
      4. hypot-1-def57.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}\right)}}\right) \]
      5. *-commutative57.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{{\left(\frac{t}{\ell}\right)}^{2} \cdot 2}}\right)}\right) \]
      6. sqrt-prod57.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\sqrt{{\left(\frac{t}{\ell}\right)}^{2}} \cdot \sqrt{2}}\right)}\right) \]
      7. unpow257.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}} \cdot \sqrt{2}\right)}\right) \]
      8. sqrt-prod0.0%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{\frac{t}{\ell}} \cdot \sqrt{\frac{t}{\ell}}\right)} \cdot \sqrt{2}\right)}\right) \]
      9. add-sqr-sqrt97.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\ell}} \cdot \sqrt{2}\right)}\right) \]
    3. Applied egg-rr97.1%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
    4. Step-by-step derivation
      1. unpow297.1%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      2. times-frac88.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om \cdot Om}{Omc \cdot Omc}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      3. unpow288.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{{Om}^{2}}}{Omc \cdot Omc}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      4. unpow288.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{{Om}^{2}}{\color{blue}{{Omc}^{2}}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      5. associate-*r/88.7%

        \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot 1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
      6. *-rgt-identity88.7%

        \[\leadsto \sin^{-1} \left(\frac{\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      7. unpow288.7%

        \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      8. unpow288.7%

        \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      9. times-frac97.1%

        \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
      10. unpow297.1%

        \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    5. Simplified97.1%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
    6. Taylor expanded in t around -inf 90.0%

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \left(\frac{\ell}{t \cdot \sqrt{2}} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg90.0%

        \[\leadsto \sin^{-1} \color{blue}{\left(-\frac{\ell}{t \cdot \sqrt{2}} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
      2. *-commutative90.0%

        \[\leadsto \sin^{-1} \left(-\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell}{t \cdot \sqrt{2}}}\right) \]
      3. unpow290.0%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right) \]
      4. unpow290.0%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right) \]
      5. times-frac99.8%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right) \]
      6. unpow299.8%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right) \]
    8. Simplified99.8%

      \[\leadsto \sin^{-1} \color{blue}{\left(-\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right)} \]

    if -4.9999999999999998e98 < (/.f64 t l) < 2e104

    1. Initial program 97.7%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow297.7%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
    3. Applied egg-rr97.7%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]

    if 2e104 < (/.f64 t l)

    1. Initial program 68.1%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in t around inf 90.0%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
    3. Step-by-step derivation
      1. *-commutative90.0%

        \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
      2. unpow290.0%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      3. unpow290.0%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. times-frac99.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. unpow299.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. associate-/l*99.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      7. associate-/r/99.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)}\right) \]
    4. Simplified99.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)} \]
    5. Taylor expanded in Om around 0 89.9%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot \frac{{Om}^{2}}{{Omc}^{2}}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    6. Step-by-step derivation
      1. unpow289.9%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      2. unpow289.9%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      3. times-frac99.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      4. unpow299.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    7. Simplified99.7%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot {\left(\frac{Om}{Omc}\right)}^{2}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+98}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{-\ell}{t \cdot \sqrt{2}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+104}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \]

Alternative 2: 98.3% accurate, 0.8× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (asin
  (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
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)))));
}
t = Math.abs(t);
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)))));
}
t = abs(t)
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)))))
t = abs(t)
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
t = abs(t)
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
NOTE: t should be positive before calling this function
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]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 83.7%

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
  2. Step-by-step derivation
    1. sqrt-div83.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)} \]
    2. div-inv83.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)} \]
    3. add-sqr-sqrt83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\sqrt{1 + \color{blue}{\sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}} \cdot \sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}}}\right) \]
    4. hypot-1-def83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}\right)}}\right) \]
    5. *-commutative83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{{\left(\frac{t}{\ell}\right)}^{2} \cdot 2}}\right)}\right) \]
    6. sqrt-prod83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\sqrt{{\left(\frac{t}{\ell}\right)}^{2}} \cdot \sqrt{2}}\right)}\right) \]
    7. unpow283.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}} \cdot \sqrt{2}\right)}\right) \]
    8. sqrt-prod50.5%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{\frac{t}{\ell}} \cdot \sqrt{\frac{t}{\ell}}\right)} \cdot \sqrt{2}\right)}\right) \]
    9. add-sqr-sqrt97.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\ell}} \cdot \sqrt{2}\right)}\right) \]
  3. Applied egg-rr97.3%

    \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
  4. Step-by-step derivation
    1. unpow297.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    2. times-frac86.1%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om \cdot Om}{Omc \cdot Omc}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    3. unpow286.1%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{{Om}^{2}}}{Omc \cdot Omc}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    4. unpow286.1%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{{Om}^{2}}{\color{blue}{{Omc}^{2}}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    5. associate-*r/86.1%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot 1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
    6. *-rgt-identity86.1%

      \[\leadsto \sin^{-1} \left(\frac{\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    7. unpow286.1%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    8. unpow286.1%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    9. times-frac97.3%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    10. unpow297.3%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
  5. Simplified97.3%

    \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
  6. Final simplification97.3%

    \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]

Alternative 3: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} \left(\frac{1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (asin
  (/
   (+ 1.0 (* (pow (/ Om Omc) 2.0) -0.5))
   (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	return asin(((1.0 + (pow((Om / Omc), 2.0) * -0.5)) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(((1.0 + (Math.pow((Om / Omc), 2.0) * -0.5)) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
t = abs(t)
def code(t, l, Om, Omc):
	return math.asin(((1.0 + (math.pow((Om / Omc), 2.0) * -0.5)) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t)
function code(t, l, Om, Omc)
	return asin(Float64(Float64(1.0 + Float64((Float64(Om / Omc) ^ 2.0) * -0.5)) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0)))))
end
t = abs(t)
function tmp = code(t, l, Om, Omc)
	tmp = asin(((1.0 + (((Om / Omc) ^ 2.0) * -0.5)) / hypot(1.0, ((t / l) * sqrt(2.0)))));
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[(1.0 + N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 83.7%

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
  2. Step-by-step derivation
    1. sqrt-div83.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)} \]
    2. div-inv83.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)} \]
    3. add-sqr-sqrt83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\sqrt{1 + \color{blue}{\sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}} \cdot \sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}}}\right) \]
    4. hypot-1-def83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \sqrt{2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}\right)}}\right) \]
    5. *-commutative83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{{\left(\frac{t}{\ell}\right)}^{2} \cdot 2}}\right)}\right) \]
    6. sqrt-prod83.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\sqrt{{\left(\frac{t}{\ell}\right)}^{2}} \cdot \sqrt{2}}\right)}\right) \]
    7. unpow283.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}} \cdot \sqrt{2}\right)}\right) \]
    8. sqrt-prod50.5%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{\frac{t}{\ell}} \cdot \sqrt{\frac{t}{\ell}}\right)} \cdot \sqrt{2}\right)}\right) \]
    9. add-sqr-sqrt97.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\ell}} \cdot \sqrt{2}\right)}\right) \]
  3. Applied egg-rr97.3%

    \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
  4. Step-by-step derivation
    1. unpow297.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    2. times-frac86.1%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om \cdot Om}{Omc \cdot Omc}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    3. unpow286.1%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{{Om}^{2}}}{Omc \cdot Omc}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    4. unpow286.1%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{{Om}^{2}}{\color{blue}{{Omc}^{2}}}} \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    5. associate-*r/86.1%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot 1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
    6. *-rgt-identity86.1%

      \[\leadsto \sin^{-1} \left(\frac{\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    7. unpow286.1%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    8. unpow286.1%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    9. times-frac97.3%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
    10. unpow297.3%

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
  5. Simplified97.3%

    \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)} \]
  6. Taylor expanded in Om around 0 85.8%

    \[\leadsto \sin^{-1} \left(\frac{\color{blue}{1 + -0.5 \cdot \frac{{Om}^{2}}{{Omc}^{2}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
  7. Step-by-step derivation
    1. unpow230.3%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    2. unpow230.3%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    3. times-frac32.9%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    4. unpow232.9%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
  8. Simplified96.8%

    \[\leadsto \sin^{-1} \left(\frac{\color{blue}{1 + -0.5 \cdot {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]
  9. Final simplification96.8%

    \[\leadsto \sin^{-1} \left(\frac{1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \]

Alternative 4: 97.3% accurate, 1.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\ \mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+104}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - t_1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + t_1 \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (let* ((t_1 (pow (/ Om Omc) 2.0)))
   (if (<= (/ t l) -1e+158)
     (asin
      (* (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc)))) (/ (- l) (/ t (sqrt 0.5)))))
     (if (<= (/ t l) 2e+104)
       (asin (sqrt (/ (- 1.0 t_1) (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
       (asin (* (+ 1.0 (* t_1 -0.5)) (* (/ l t) (sqrt 0.5))))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double t_1 = pow((Om / Omc), 2.0);
	double tmp;
	if ((t / l) <= -1e+158) {
		tmp = asin((sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / sqrt(0.5)))));
	} else if ((t / l) <= 2e+104) {
		tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
	} else {
		tmp = asin(((1.0 + (t_1 * -0.5)) * ((l / t) * sqrt(0.5))));
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (om / omc) ** 2.0d0
    if ((t / l) <= (-1d+158)) then
        tmp = asin((sqrt((1.0d0 - ((om * om) / (omc * omc)))) * (-l / (t / sqrt(0.5d0)))))
    else if ((t / l) <= 2d+104) then
        tmp = asin(sqrt(((1.0d0 - t_1) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
    else
        tmp = asin(((1.0d0 + (t_1 * (-0.5d0))) * ((l / t) * sqrt(0.5d0))))
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	double t_1 = Math.pow((Om / Omc), 2.0);
	double tmp;
	if ((t / l) <= -1e+158) {
		tmp = Math.asin((Math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / Math.sqrt(0.5)))));
	} else if ((t / l) <= 2e+104) {
		tmp = Math.asin(Math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
	} else {
		tmp = Math.asin(((1.0 + (t_1 * -0.5)) * ((l / t) * Math.sqrt(0.5))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	t_1 = math.pow((Om / Omc), 2.0)
	tmp = 0
	if (t / l) <= -1e+158:
		tmp = math.asin((math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / math.sqrt(0.5)))))
	elif (t / l) <= 2e+104:
		tmp = math.asin(math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) * (t / l)))))))
	else:
		tmp = math.asin(((1.0 + (t_1 * -0.5)) * ((l / t) * math.sqrt(0.5))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	t_1 = Float64(Om / Omc) ^ 2.0
	tmp = 0.0
	if (Float64(t / l) <= -1e+158)
		tmp = asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc)))) * Float64(Float64(-l) / Float64(t / sqrt(0.5)))));
	elseif (Float64(t / l) <= 2e+104)
		tmp = asin(sqrt(Float64(Float64(1.0 - t_1) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l)))))));
	else
		tmp = asin(Float64(Float64(1.0 + Float64(t_1 * -0.5)) * Float64(Float64(l / t) * sqrt(0.5))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	t_1 = (Om / Omc) ^ 2.0;
	tmp = 0.0;
	if ((t / l) <= -1e+158)
		tmp = asin((sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / sqrt(0.5)))));
	elseif ((t / l) <= 2e+104)
		tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
	else
		tmp = asin(((1.0 + (t_1 * -0.5)) * ((l / t) * sqrt(0.5))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+158], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+104], N[ArcSin[N[Sqrt[N[(N[(1.0 - t$95$1), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+158}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+104}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - t_1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\left(1 + t_1 \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 t l) < -9.99999999999999953e157

    1. Initial program 48.1%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow248.1%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
      2. associate-*r/48.1%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    3. Applied egg-rr48.1%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    4. Taylor expanded in t around -inf 87.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg87.7%

        \[\leadsto \sin^{-1} \color{blue}{\left(-\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
      2. *-commutative87.7%

        \[\leadsto \sin^{-1} \left(-\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}}\right) \]
      3. unpow287.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. unpow287.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. times-frac99.6%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. unpow299.6%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      7. unpow299.6%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      8. times-frac87.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om \cdot Om}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      9. associate-/l*87.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
    6. Simplified87.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)} \]

    if -9.99999999999999953e157 < (/.f64 t l) < 2e104

    1. Initial program 97.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow297.8%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
    3. Applied egg-rr97.8%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]

    if 2e104 < (/.f64 t l)

    1. Initial program 68.1%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in t around inf 90.0%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
    3. Step-by-step derivation
      1. *-commutative90.0%

        \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
      2. unpow290.0%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      3. unpow290.0%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. times-frac99.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. unpow299.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. associate-/l*99.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      7. associate-/r/99.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)}\right) \]
    4. Simplified99.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)} \]
    5. Taylor expanded in Om around 0 89.9%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot \frac{{Om}^{2}}{{Omc}^{2}}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    6. Step-by-step derivation
      1. unpow289.9%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      2. unpow289.9%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      3. times-frac99.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      4. unpow299.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    7. Simplified99.7%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot {\left(\frac{Om}{Omc}\right)}^{2}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+104}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \]

Alternative 5: 97.2% accurate, 1.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\ \mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 50000000:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + t_1 \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (let* ((t_1 (pow (/ Om Omc) 2.0)))
   (if (<= (/ t l) -1e+158)
     (asin
      (* (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc)))) (/ (- l) (/ t (sqrt 0.5)))))
     (if (<= (/ t l) 50000000.0)
       (asin (sqrt (/ (- 1.0 t_1) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
       (asin (* (+ 1.0 (* t_1 -0.5)) (* (/ l t) (sqrt 0.5))))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double t_1 = pow((Om / Omc), 2.0);
	double tmp;
	if ((t / l) <= -1e+158) {
		tmp = asin((sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / sqrt(0.5)))));
	} else if ((t / l) <= 50000000.0) {
		tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
	} else {
		tmp = asin(((1.0 + (t_1 * -0.5)) * ((l / t) * sqrt(0.5))));
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (om / omc) ** 2.0d0
    if ((t / l) <= (-1d+158)) then
        tmp = asin((sqrt((1.0d0 - ((om * om) / (omc * omc)))) * (-l / (t / sqrt(0.5d0)))))
    else if ((t / l) <= 50000000.0d0) then
        tmp = asin(sqrt(((1.0d0 - t_1) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
    else
        tmp = asin(((1.0d0 + (t_1 * (-0.5d0))) * ((l / t) * sqrt(0.5d0))))
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	double t_1 = Math.pow((Om / Omc), 2.0);
	double tmp;
	if ((t / l) <= -1e+158) {
		tmp = Math.asin((Math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / Math.sqrt(0.5)))));
	} else if ((t / l) <= 50000000.0) {
		tmp = Math.asin(Math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
	} else {
		tmp = Math.asin(((1.0 + (t_1 * -0.5)) * ((l / t) * Math.sqrt(0.5))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	t_1 = math.pow((Om / Omc), 2.0)
	tmp = 0
	if (t / l) <= -1e+158:
		tmp = math.asin((math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / math.sqrt(0.5)))))
	elif (t / l) <= 50000000.0:
		tmp = math.asin(math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t)))))))
	else:
		tmp = math.asin(((1.0 + (t_1 * -0.5)) * ((l / t) * math.sqrt(0.5))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	t_1 = Float64(Om / Omc) ^ 2.0
	tmp = 0.0
	if (Float64(t / l) <= -1e+158)
		tmp = asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc)))) * Float64(Float64(-l) / Float64(t / sqrt(0.5)))));
	elseif (Float64(t / l) <= 50000000.0)
		tmp = asin(sqrt(Float64(Float64(1.0 - t_1) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t)))))));
	else
		tmp = asin(Float64(Float64(1.0 + Float64(t_1 * -0.5)) * Float64(Float64(l / t) * sqrt(0.5))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	t_1 = (Om / Omc) ^ 2.0;
	tmp = 0.0;
	if ((t / l) <= -1e+158)
		tmp = asin((sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / sqrt(0.5)))));
	elseif ((t / l) <= 50000000.0)
		tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
	else
		tmp = asin(((1.0 + (t_1 * -0.5)) * ((l / t) * sqrt(0.5))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+158], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 50000000.0], N[ArcSin[N[Sqrt[N[(N[(1.0 - t$95$1), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+158}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 50000000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\left(1 + t_1 \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 t l) < -9.99999999999999953e157

    1. Initial program 48.1%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow248.1%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
      2. associate-*r/48.1%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    3. Applied egg-rr48.1%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    4. Taylor expanded in t around -inf 87.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg87.7%

        \[\leadsto \sin^{-1} \color{blue}{\left(-\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
      2. *-commutative87.7%

        \[\leadsto \sin^{-1} \left(-\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}}\right) \]
      3. unpow287.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. unpow287.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. times-frac99.6%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. unpow299.6%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      7. unpow299.6%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      8. times-frac87.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om \cdot Om}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      9. associate-/l*87.7%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
    6. Simplified87.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)} \]

    if -9.99999999999999953e157 < (/.f64 t l) < 5e7

    1. Initial program 97.6%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow297.6%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
      2. associate-*r/95.1%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    3. Applied egg-rr95.1%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    4. Step-by-step derivation
      1. *-un-lft-identity95.1%

        \[\leadsto \sin^{-1} \color{blue}{\left(1 \cdot \sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell} \cdot t}{\ell}}}\right)} \]
      2. associate-/l*97.6%

        \[\leadsto \sin^{-1} \left(1 \cdot \sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}}\right) \]
    5. Applied egg-rr97.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(1 \cdot \sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)} \]
    6. Step-by-step derivation
      1. *-lft-identity97.6%

        \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)} \]
    7. Simplified97.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)} \]

    if 5e7 < (/.f64 t l)

    1. Initial program 74.2%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in t around inf 91.8%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
    3. Step-by-step derivation
      1. *-commutative91.8%

        \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
      2. unpow291.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      3. unpow291.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. times-frac99.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. unpow299.8%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. associate-/l*99.6%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      7. associate-/r/99.6%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)}\right) \]
    4. Simplified99.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)} \]
    5. Taylor expanded in Om around 0 91.7%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot \frac{{Om}^{2}}{{Omc}^{2}}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    6. Step-by-step derivation
      1. unpow291.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      2. unpow291.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      3. times-frac99.6%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      4. unpow299.6%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    7. Simplified99.6%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot {\left(\frac{Om}{Omc}\right)}^{2}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 50000000:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \]

Alternative 6: 80.6% accurate, 1.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.5 \cdot 10^{+190}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= t 1.5e+190)
   (asin
    (sqrt
     (/
      (- 1.0 (/ (/ Om Omc) (/ Omc Om)))
      (+ 1.0 (* 2.0 (/ (* t (/ t l)) l))))))
   (asin
    (* (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc)))) (/ (- l) (/ t (sqrt 0.5)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (t <= 1.5e+190) {
		tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
	} else {
		tmp = asin((sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / sqrt(0.5)))));
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    real(8) :: tmp
    if (t <= 1.5d+190) then
        tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
    else
        tmp = asin((sqrt((1.0d0 - ((om * om) / (omc * omc)))) * (-l / (t / sqrt(0.5d0)))))
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (t <= 1.5e+190) {
		tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
	} else {
		tmp = Math.asin((Math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / Math.sqrt(0.5)))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	tmp = 0
	if t <= 1.5e+190:
		tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))))
	else:
		tmp = math.asin((math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / math.sqrt(0.5)))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	tmp = 0.0
	if (t <= 1.5e+190)
		tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l))))));
	else
		tmp = asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc)))) * Float64(Float64(-l) / Float64(t / sqrt(0.5)))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if (t <= 1.5e+190)
		tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
	else
		tmp = asin((sqrt((1.0 - ((Om * Om) / (Omc * Omc)))) * (-l / (t / sqrt(0.5)))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.5e+190], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.5 \cdot 10^{+190}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.49999999999999991e190

    1. Initial program 84.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow284.8%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
      2. associate-*r/82.3%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    3. Applied egg-rr82.3%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    4. Step-by-step derivation
      1. unpow251.8%

        \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \]
      2. clear-num51.8%

        \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \color{blue}{\frac{1}{\frac{Omc}{Om}}}\right)\right) \]
      3. un-div-inv51.8%

        \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right) \]
    5. Applied egg-rr82.3%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{1 + 2 \cdot \frac{\frac{t}{\ell} \cdot t}{\ell}}}\right) \]

    if 1.49999999999999991e190 < t

    1. Initial program 75.1%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow275.1%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
      2. associate-*r/57.3%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    3. Applied egg-rr57.3%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    4. Taylor expanded in t around -inf 73.4%

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg73.4%

        \[\leadsto \sin^{-1} \color{blue}{\left(-\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
      2. *-commutative73.4%

        \[\leadsto \sin^{-1} \left(-\color{blue}{\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}}\right) \]
      3. unpow273.4%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. unpow273.4%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. times-frac84.5%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. unpow284.5%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      7. unpow284.5%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      8. times-frac73.4%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \color{blue}{\frac{Om \cdot Om}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      9. associate-/l*73.4%

        \[\leadsto \sin^{-1} \left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
    6. Simplified73.4%

      \[\leadsto \sin^{-1} \color{blue}{\left(-\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.5 \cdot 10^{+190}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \end{array} \]

Alternative 7: 82.2% accurate, 1.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 7 \cdot 10^{+209}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= t 7e+209)
   (asin
    (sqrt
     (/
      (- 1.0 (/ (/ Om Omc) (/ Omc Om)))
      (+ 1.0 (* 2.0 (/ (* t (/ t l)) l))))))
   (asin (* (+ 1.0 (* (pow (/ Om Omc) 2.0) -0.5)) (* (/ l t) (sqrt 0.5))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (t <= 7e+209) {
		tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
	} else {
		tmp = asin(((1.0 + (pow((Om / Omc), 2.0) * -0.5)) * ((l / t) * sqrt(0.5))));
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    real(8) :: tmp
    if (t <= 7d+209) then
        tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
    else
        tmp = asin(((1.0d0 + (((om / omc) ** 2.0d0) * (-0.5d0))) * ((l / t) * sqrt(0.5d0))))
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (t <= 7e+209) {
		tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
	} else {
		tmp = Math.asin(((1.0 + (Math.pow((Om / Omc), 2.0) * -0.5)) * ((l / t) * Math.sqrt(0.5))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	tmp = 0
	if t <= 7e+209:
		tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))))
	else:
		tmp = math.asin(((1.0 + (math.pow((Om / Omc), 2.0) * -0.5)) * ((l / t) * math.sqrt(0.5))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	tmp = 0.0
	if (t <= 7e+209)
		tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l))))));
	else
		tmp = asin(Float64(Float64(1.0 + Float64((Float64(Om / Omc) ^ 2.0) * -0.5)) * Float64(Float64(l / t) * sqrt(0.5))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if (t <= 7e+209)
		tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
	else
		tmp = asin(((1.0 + (((Om / Omc) ^ 2.0) * -0.5)) * ((l / t) * sqrt(0.5))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 7e+209], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 + N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+209}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.0000000000000005e209

    1. Initial program 84.2%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. unpow284.2%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
      2. associate-*r/81.4%

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    3. Applied egg-rr81.4%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
    4. Step-by-step derivation
      1. unpow250.9%

        \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \]
      2. clear-num50.9%

        \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \color{blue}{\frac{1}{\frac{Omc}{Om}}}\right)\right) \]
      3. un-div-inv50.9%

        \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right) \]
    5. Applied egg-rr81.4%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{1 + 2 \cdot \frac{\frac{t}{\ell} \cdot t}{\ell}}}\right) \]

    if 7.0000000000000005e209 < t

    1. Initial program 78.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in t around inf 61.7%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\ell \cdot \sqrt{0.5}}{t} \cdot \sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
    3. Step-by-step derivation
      1. *-commutative61.7%

        \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
      2. unpow261.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      3. unpow261.7%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      4. times-frac70.6%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      5. unpow270.6%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}} \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right) \]
      6. associate-/l*70.6%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      7. associate-/r/70.6%

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)}\right) \]
    4. Simplified70.6%

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)} \]
    5. Taylor expanded in Om around 0 61.7%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot \frac{{Om}^{2}}{{Omc}^{2}}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    6. Step-by-step derivation
      1. unpow261.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      2. unpow261.7%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      3. times-frac70.6%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
      4. unpow270.6%

        \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    7. Simplified70.6%

      \[\leadsto \sin^{-1} \left(\color{blue}{\left(1 + -0.5 \cdot {\left(\frac{Om}{Omc}\right)}^{2}\right)} \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 7 \cdot 10^{+209}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right)\\ \end{array} \]

Alternative 8: 81.2% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (asin
  (sqrt
   (/ (- 1.0 (/ (/ Om Omc) (/ Omc Om))) (+ 1.0 (* 2.0 (/ (* t (/ t l)) l)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	return asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
}
t = abs(t)
def code(t, l, Om, Omc):
	return math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))))
t = abs(t)
function code(t, l, Om, Omc)
	return asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l))))))
end
t = abs(t)
function tmp = code(t, l, Om, Omc)
	tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)
\end{array}
Derivation
  1. Initial program 83.7%

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
  2. Step-by-step derivation
    1. unpow283.7%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}}\right) \]
    2. associate-*r/79.6%

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
  3. Applied egg-rr79.6%

    \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \color{blue}{\frac{\frac{t}{\ell} \cdot t}{\ell}}}}\right) \]
  4. Step-by-step derivation
    1. unpow247.1%

      \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \]
    2. clear-num47.1%

      \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \color{blue}{\frac{1}{\frac{Omc}{Om}}}\right)\right) \]
    3. un-div-inv47.1%

      \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right) \]
  5. Applied egg-rr79.6%

    \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{1 + 2 \cdot \frac{\frac{t}{\ell} \cdot t}{\ell}}}\right) \]
  6. Final simplification79.6%

    \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right) \]

Alternative 9: 50.9% accurate, 2.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (asin (sqrt (- 1.0 (/ Om (* Omc (/ Omc Om)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	return asin(sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin(sqrt((1.0d0 - (om / (omc * (omc / om))))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(Math.sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
}
t = abs(t)
def code(t, l, Om, Omc):
	return math.asin(math.sqrt((1.0 - (Om / (Omc * (Omc / Om))))))
t = abs(t)
function code(t, l, Om, Omc)
	return asin(sqrt(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om))))))
end
t = abs(t)
function tmp = code(t, l, Om, Omc)
	tmp = asin(sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}\right)
\end{array}
Derivation
  1. Initial program 83.7%

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
  2. Taylor expanded in t around 0 40.6%

    \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
  3. Step-by-step derivation
    1. unpow240.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}}\right) \]
    2. unpow240.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}}\right) \]
    3. times-frac47.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}}\right) \]
    4. unpow247.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}}\right) \]
  4. Simplified47.3%

    \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)} \]
  5. Step-by-step derivation
    1. unpow247.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}}\right) \]
    2. clear-num47.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{1}{\frac{Omc}{Om}}} \cdot \frac{Om}{Omc}}\right) \]
    3. frac-times47.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{1 \cdot Om}{\frac{Omc}{Om} \cdot Omc}}}\right) \]
    4. *-un-lft-identity47.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om}}{\frac{Omc}{Om} \cdot Omc}}\right) \]
  6. Applied egg-rr47.3%

    \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{\frac{Omc}{Om} \cdot Omc}}}\right) \]
  7. Final simplification47.3%

    \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}\right) \]

Alternative 10: 50.7% accurate, 3.7× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} \left(1 + -0.5 \cdot \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (asin (+ 1.0 (* -0.5 (/ (/ Om Omc) (/ Omc Om))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	return asin((1.0 + (-0.5 * ((Om / Omc) / (Omc / Om)))));
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin((1.0d0 + ((-0.5d0) * ((om / omc) / (omc / om)))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin((1.0 + (-0.5 * ((Om / Omc) / (Omc / Om)))));
}
t = abs(t)
def code(t, l, Om, Omc):
	return math.asin((1.0 + (-0.5 * ((Om / Omc) / (Omc / Om)))))
t = abs(t)
function code(t, l, Om, Omc)
	return asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) / Float64(Omc / Om)))))
end
t = abs(t)
function tmp = code(t, l, Om, Omc)
	tmp = asin((1.0 + (-0.5 * ((Om / Omc) / (Omc / Om)))));
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(1 + -0.5 \cdot \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right)
\end{array}
Derivation
  1. Initial program 83.7%

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
  2. Taylor expanded in t around 0 40.6%

    \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{{Om}^{2}}{{Omc}^{2}}}\right)} \]
  3. Step-by-step derivation
    1. unpow240.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}}\right) \]
    2. unpow240.6%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}}\right) \]
    3. times-frac47.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{\frac{Om}{Omc} \cdot \frac{Om}{Omc}}}\right) \]
    4. unpow247.3%

      \[\leadsto \sin^{-1} \left(\sqrt{1 - \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}}\right) \]
  4. Simplified47.3%

    \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)} \]
  5. Taylor expanded in Om around 0 40.6%

    \[\leadsto \sin^{-1} \color{blue}{\left(1 + -0.5 \cdot \frac{{Om}^{2}}{{Omc}^{2}}\right)} \]
  6. Step-by-step derivation
    1. unpow230.3%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{\color{blue}{Om \cdot Om}}{{Omc}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    2. unpow230.3%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \frac{Om \cdot Om}{\color{blue}{Omc \cdot Omc}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    3. times-frac32.9%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
    4. unpow232.9%

      \[\leadsto \sin^{-1} \left(\left(1 + -0.5 \cdot \color{blue}{{\left(\frac{Om}{Omc}\right)}^{2}}\right) \cdot \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\right) \]
  7. Simplified47.1%

    \[\leadsto \sin^{-1} \color{blue}{\left(1 + -0.5 \cdot {\left(\frac{Om}{Omc}\right)}^{2}\right)} \]
  8. Step-by-step derivation
    1. unpow247.1%

      \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)}\right) \]
    2. clear-num47.1%

      \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \color{blue}{\frac{1}{\frac{Omc}{Om}}}\right)\right) \]
    3. un-div-inv47.1%

      \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right) \]
  9. Applied egg-rr47.1%

    \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \color{blue}{\frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right) \]
  10. Final simplification47.1%

    \[\leadsto \sin^{-1} \left(1 + -0.5 \cdot \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right) \]

Reproduce

?
herbie shell --seed 2023278 
(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)))))))