Toniolo and Linder, Equation (2)

Percentage Accurate: 83.4% → 98.6%
Time: 16.9s
Alternatives: 11
Speedup: 1.9×

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 11 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: 83.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.6% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 46.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 -inf 88.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. associate-*r*88.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000005e117 < (/.f64 t l) < 1.9999999999999999e124

    1. Initial program 98.5%

      \[\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. unpow298.5%

        \[\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. div-inv98.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e124 < (/.f64 t l)

    1. Initial program 50.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. sqrt-div50.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-inv50.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-sqrt50.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-def50.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. *-commutative50.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-prod50.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. unpow250.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-prod97.9%

        \[\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.9%

        \[\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.9%

      \[\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. associate-*r/97.9%

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

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

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

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

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

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

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

Alternative 2: 98.2% 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 \cdot \sqrt{2}}{\ell}\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 (sqrt 2.0)) l)))))
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 * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
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 * math.sqrt(2.0)) / l))))
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 * sqrt(2.0)) / l))))
end
t = abs(t)
function tmp = code(t, l, Om, Omc)
	tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l))));
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 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Derivation
  1. Initial program 83.9%

    \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.8%

      \[\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.8%

      \[\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-prod52.7%

      \[\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-sqrt98.2%

      \[\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-rr98.2%

    \[\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. associate-*r/98.2%

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

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

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

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

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

Alternative 3: 78.9% accurate, 1.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := {\left(\frac{t}{\ell}\right)}^{2}\\ \mathbf{if}\;t_1 \leq 0.001:\\ \;\;\;\;\sin^{-1} \left(1 - t_1\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\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 (/ t l) 2.0)))
   (if (<= t_1 0.001) (asin (- 1.0 t_1)) (asin (/ l (* t (sqrt 2.0)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double t_1 = pow((t / l), 2.0);
	double tmp;
	if (t_1 <= 0.001) {
		tmp = asin((1.0 - t_1));
	} else {
		tmp = asin((l / (t * sqrt(2.0))));
	}
	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 = (t / l) ** 2.0d0
    if (t_1 <= 0.001d0) then
        tmp = asin((1.0d0 - t_1))
    else
        tmp = asin((l / (t * sqrt(2.0d0))))
    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((t / l), 2.0);
	double tmp;
	if (t_1 <= 0.001) {
		tmp = Math.asin((1.0 - t_1));
	} else {
		tmp = Math.asin((l / (t * Math.sqrt(2.0))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	t_1 = math.pow((t / l), 2.0)
	tmp = 0
	if t_1 <= 0.001:
		tmp = math.asin((1.0 - t_1))
	else:
		tmp = math.asin((l / (t * math.sqrt(2.0))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	t_1 = Float64(t / l) ^ 2.0
	tmp = 0.0
	if (t_1 <= 0.001)
		tmp = asin(Float64(1.0 - t_1));
	else
		tmp = asin(Float64(l / Float64(t * sqrt(2.0))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	t_1 = (t / l) ^ 2.0;
	tmp = 0.0;
	if (t_1 <= 0.001)
		tmp = asin((1.0 - t_1));
	else
		tmp = asin((l / (t * sqrt(2.0))));
	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[(t / l), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 0.001], N[ArcSin[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{t}{\ell}\right)}^{2}\\
\mathbf{if}\;t_1 \leq 0.001:\\
\;\;\;\;\sin^{-1} \left(1 - t_1\right)\\

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


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

    1. Initial program 98.0%

      \[\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-div98.0%

        \[\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-inv98.0%

        \[\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-sqrt98.0%

        \[\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-def98.0%

        \[\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. *-commutative98.0%

        \[\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-prod98.0%

        \[\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. unpow298.0%

        \[\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-prod55.6%

        \[\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-sqrt98.0%

        \[\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-rr98.0%

      \[\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. associate-*r/98.0%

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{\color{blue}{1}}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right) \]
    7. Step-by-step derivation
      1. expm1-log1p-u96.7%

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t \cdot \sqrt{2}}{\ell}\right)} - 1}\right)}\right) \]
      3. associate-/l*96.7%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, e^{\mathsf{log1p}\left(\color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)} - 1\right)}\right) \]
    8. Applied egg-rr96.7%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)} - 1}\right)}\right) \]
    9. Step-by-step derivation
      1. expm1-def96.7%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)\right)}\right)}\right) \]
      2. expm1-log1p96.7%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)}\right) \]
      3. associate-/r/96.7%

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(1 + -0.5 \cdot \frac{{t}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{\ell}^{2}}\right)} \]
    12. Step-by-step derivation
      1. associate-*r/87.0%

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

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

        \[\leadsto \sin^{-1} \left(1 + \frac{-0.5 \cdot \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot {t}^{2}\right)}{{\ell}^{2}}\right) \]
      4. rem-square-sqrt87.0%

        \[\leadsto \sin^{-1} \left(1 + \frac{-0.5 \cdot \left(\color{blue}{2} \cdot {t}^{2}\right)}{{\ell}^{2}}\right) \]
      5. associate-*r*87.0%

        \[\leadsto \sin^{-1} \left(1 + \frac{\color{blue}{\left(-0.5 \cdot 2\right) \cdot {t}^{2}}}{{\ell}^{2}}\right) \]
      6. metadata-eval87.0%

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

        \[\leadsto \sin^{-1} \left(1 + \color{blue}{-1 \cdot \frac{{t}^{2}}{{\ell}^{2}}}\right) \]
      8. mul-1-neg87.0%

        \[\leadsto \sin^{-1} \left(1 + \color{blue}{\left(-\frac{{t}^{2}}{{\ell}^{2}}\right)}\right) \]
      9. unsub-neg87.0%

        \[\leadsto \sin^{-1} \color{blue}{\left(1 - \frac{{t}^{2}}{{\ell}^{2}}\right)} \]
      10. unpow287.0%

        \[\leadsto \sin^{-1} \left(1 - \frac{\color{blue}{t \cdot t}}{{\ell}^{2}}\right) \]
      11. unpow287.0%

        \[\leadsto \sin^{-1} \left(1 - \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}\right) \]
      12. times-frac96.1%

        \[\leadsto \sin^{-1} \left(1 - \color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}\right) \]
      13. unpow296.1%

        \[\leadsto \sin^{-1} \left(1 - \color{blue}{{\left(\frac{t}{\ell}\right)}^{2}}\right) \]
    13. Simplified96.1%

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

    if 1e-3 < (pow.f64 (/.f64 t l) 2)

    1. Initial program 71.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. sqrt-div71.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-inv71.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-sqrt71.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-def71.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. *-commutative71.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-prod70.9%

        \[\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. unpow270.9%

        \[\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.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-sqrt98.5%

        \[\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-rr98.5%

      \[\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. associate-*r/98.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\frac{t}{\ell}\right)}^{2} \leq 0.001:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\ \end{array} \]

Alternative 4: 97.4% accurate, 1.3× speedup?

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

    \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.8%

      \[\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.8%

      \[\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-prod52.7%

      \[\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-sqrt98.2%

      \[\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-rr98.2%

    \[\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. associate-*r/98.2%

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

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

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

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

    \[\leadsto \sin^{-1} \left(\frac{\color{blue}{1}}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right) \]
  7. Step-by-step derivation
    1. expm1-log1p-u70.6%

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

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t \cdot \sqrt{2}}{\ell}\right)} - 1}\right)}\right) \]
    3. associate-/l*70.6%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, e^{\mathsf{log1p}\left(\color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)} - 1\right)}\right) \]
  8. Applied egg-rr70.6%

    \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)} - 1}\right)}\right) \]
  9. Step-by-step derivation
    1. expm1-def70.6%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)\right)}\right)}\right) \]
    2. expm1-log1p97.4%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)}\right) \]
    3. associate-/r/97.4%

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

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

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

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

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

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

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

Alternative 5: 97.4% accurate, 1.3× speedup?

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

    \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.9%

      \[\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.8%

      \[\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.8%

      \[\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-prod52.7%

      \[\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-sqrt98.2%

      \[\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-rr98.2%

    \[\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. associate-*r/98.2%

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

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

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

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

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

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

Alternative 6: 98.2% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 59.3%

      \[\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 89.2%

      \[\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)} \]
    3. Step-by-step derivation
      1. associate-*r*89.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999999e52 < (/.f64 t l) < 2.00000000000000008e36

    1. Initial program 98.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. unpow298.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. div-inv98.1%

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000008e36 < (/.f64 t l)

    1. Initial program 75.3%

      \[\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-div75.3%

        \[\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-inv75.3%

        \[\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-sqrt75.3%

        \[\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-def75.3%

        \[\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. *-commutative75.3%

        \[\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-prod75.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. unpow275.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-prod98.4%

        \[\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-sqrt98.6%

        \[\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-rr98.6%

      \[\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. associate-*r/98.6%

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

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

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

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

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

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

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

Alternative 7: 97.2% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -200:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= (/ t l) -200.0)
   (asin (/ (- l) (/ t (sqrt 0.5))))
   (if (<= (/ t l) 0.002)
     (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
     (asin (/ l (* t (sqrt 2.0)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t / l) <= -200.0) {
		tmp = asin((-l / (t / sqrt(0.5))));
	} else if ((t / l) <= 0.002) {
		tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
	} else {
		tmp = asin((l / (t * sqrt(2.0))));
	}
	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 / l) <= (-200.0d0)) then
        tmp = asin((-l / (t / sqrt(0.5d0))))
    else if ((t / l) <= 0.002d0) then
        tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
    else
        tmp = asin((l / (t * sqrt(2.0d0))))
    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 / l) <= -200.0) {
		tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
	} else if ((t / l) <= 0.002) {
		tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
	} else {
		tmp = Math.asin((l / (t * Math.sqrt(2.0))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	tmp = 0
	if (t / l) <= -200.0:
		tmp = math.asin((-l / (t / math.sqrt(0.5))))
	elif (t / l) <= 0.002:
		tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))))
	else:
		tmp = math.asin((l / (t * math.sqrt(2.0))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	tmp = 0.0
	if (Float64(t / l) <= -200.0)
		tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5))));
	elseif (Float64(t / l) <= 0.002)
		tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))));
	else
		tmp = asin(Float64(l / Float64(t * sqrt(2.0))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if ((t / l) <= -200.0)
		tmp = asin((-l / (t / sqrt(0.5))));
	elseif ((t / l) <= 0.002)
		tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
	else
		tmp = asin((l / (t * sqrt(2.0))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -200.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.002], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\

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


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

    1. Initial program 63.0%

      \[\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.2%

      \[\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)} \]
    3. Step-by-step derivation
      1. associate-*r*90.2%

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

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

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

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

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

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

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

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

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

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

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

    if -200 < (/.f64 t l) < 2e-3

    1. Initial program 98.0%

      \[\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 85.1%

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

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

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

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

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

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

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

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

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

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

    if 2e-3 < (/.f64 t l)

    1. Initial program 78.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-div78.8%

        \[\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-inv78.8%

        \[\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-sqrt78.8%

        \[\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-def78.8%

        \[\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. *-commutative78.8%

        \[\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-prod78.5%

        \[\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. unpow278.5%

        \[\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-prod98.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-sqrt98.6%

        \[\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-rr98.6%

      \[\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. associate-*r/98.6%

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

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

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

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

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

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

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

Alternative 8: 97.1% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := t \cdot \sqrt{2}\\ \mathbf{if}\;\frac{t}{\ell} \leq -200:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (let* ((t_1 (* t (sqrt 2.0))))
   (if (<= (/ t l) -200.0)
     (asin (/ (- l) t_1))
     (if (<= (/ t l) 0.002)
       (asin (- 1.0 (pow (/ t l) 2.0)))
       (asin (/ l t_1))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double t_1 = t * sqrt(2.0);
	double tmp;
	if ((t / l) <= -200.0) {
		tmp = asin((-l / t_1));
	} else if ((t / l) <= 0.002) {
		tmp = asin((1.0 - pow((t / l), 2.0)));
	} else {
		tmp = asin((l / t_1));
	}
	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 = t * sqrt(2.0d0)
    if ((t / l) <= (-200.0d0)) then
        tmp = asin((-l / t_1))
    else if ((t / l) <= 0.002d0) then
        tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
    else
        tmp = asin((l / t_1))
    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 = t * Math.sqrt(2.0);
	double tmp;
	if ((t / l) <= -200.0) {
		tmp = Math.asin((-l / t_1));
	} else if ((t / l) <= 0.002) {
		tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
	} else {
		tmp = Math.asin((l / t_1));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	t_1 = t * math.sqrt(2.0)
	tmp = 0
	if (t / l) <= -200.0:
		tmp = math.asin((-l / t_1))
	elif (t / l) <= 0.002:
		tmp = math.asin((1.0 - math.pow((t / l), 2.0)))
	else:
		tmp = math.asin((l / t_1))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	t_1 = Float64(t * sqrt(2.0))
	tmp = 0.0
	if (Float64(t / l) <= -200.0)
		tmp = asin(Float64(Float64(-l) / t_1));
	elseif (Float64(t / l) <= 0.002)
		tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0)));
	else
		tmp = asin(Float64(l / t_1));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	t_1 = t * sqrt(2.0);
	tmp = 0.0;
	if ((t / l) <= -200.0)
		tmp = asin((-l / t_1));
	elseif ((t / l) <= 0.002)
		tmp = asin((1.0 - ((t / l) ^ 2.0)));
	else
		tmp = asin((l / t_1));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -200.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\


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

    1. Initial program 63.0%

      \[\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-div62.9%

        \[\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-inv62.9%

        \[\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-sqrt62.9%

        \[\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-def62.9%

        \[\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. *-commutative62.9%

        \[\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-prod62.8%

        \[\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. unpow262.8%

        \[\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-sqrt98.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-rr98.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. associate-*r/98.3%

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \frac{\ell}{t \cdot \sqrt{2}}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/99.6%

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

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

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

    if -200 < (/.f64 t l) < 2e-3

    1. Initial program 98.0%

      \[\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-div98.0%

        \[\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-inv98.0%

        \[\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-sqrt98.0%

        \[\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-def98.0%

        \[\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. *-commutative98.0%

        \[\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-prod98.0%

        \[\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. unpow298.0%

        \[\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-prod54.8%

        \[\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-sqrt98.0%

        \[\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-rr98.0%

      \[\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. associate-*r/98.0%

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{\color{blue}{1}}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right) \]
    7. Step-by-step derivation
      1. expm1-log1p-u96.0%

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t \cdot \sqrt{2}}{\ell}\right)} - 1}\right)}\right) \]
      3. associate-/l*96.0%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, e^{\mathsf{log1p}\left(\color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)} - 1\right)}\right) \]
    8. Applied egg-rr96.0%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)} - 1}\right)}\right) \]
    9. Step-by-step derivation
      1. expm1-def96.0%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)\right)}\right)}\right) \]
      2. expm1-log1p96.8%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)}\right) \]
      3. associate-/r/96.8%

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(1 + -0.5 \cdot \frac{{t}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{\ell}^{2}}\right)} \]
    12. Step-by-step derivation
      1. associate-*r/86.7%

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

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

        \[\leadsto \sin^{-1} \left(1 + \frac{-0.5 \cdot \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot {t}^{2}\right)}{{\ell}^{2}}\right) \]
      4. rem-square-sqrt86.7%

        \[\leadsto \sin^{-1} \left(1 + \frac{-0.5 \cdot \left(\color{blue}{2} \cdot {t}^{2}\right)}{{\ell}^{2}}\right) \]
      5. associate-*r*86.7%

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

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

        \[\leadsto \sin^{-1} \left(1 + \color{blue}{-1 \cdot \frac{{t}^{2}}{{\ell}^{2}}}\right) \]
      8. mul-1-neg86.7%

        \[\leadsto \sin^{-1} \left(1 + \color{blue}{\left(-\frac{{t}^{2}}{{\ell}^{2}}\right)}\right) \]
      9. unsub-neg86.7%

        \[\leadsto \sin^{-1} \color{blue}{\left(1 - \frac{{t}^{2}}{{\ell}^{2}}\right)} \]
      10. unpow286.7%

        \[\leadsto \sin^{-1} \left(1 - \frac{\color{blue}{t \cdot t}}{{\ell}^{2}}\right) \]
      11. unpow286.7%

        \[\leadsto \sin^{-1} \left(1 - \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}\right) \]
      12. times-frac95.7%

        \[\leadsto \sin^{-1} \left(1 - \color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}\right) \]
      13. unpow295.7%

        \[\leadsto \sin^{-1} \left(1 - \color{blue}{{\left(\frac{t}{\ell}\right)}^{2}}\right) \]
    13. Simplified95.7%

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

    if 2e-3 < (/.f64 t l)

    1. Initial program 78.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-div78.8%

        \[\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-inv78.8%

        \[\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-sqrt78.8%

        \[\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-def78.8%

        \[\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. *-commutative78.8%

        \[\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-prod78.5%

        \[\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. unpow278.5%

        \[\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-prod98.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-sqrt98.6%

        \[\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-rr98.6%

      \[\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. associate-*r/98.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -200:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\ \end{array} \]

Alternative 9: 97.1% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -200:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= (/ t l) -200.0)
   (asin (/ (- l) (/ t (sqrt 0.5))))
   (if (<= (/ t l) 0.002)
     (asin (- 1.0 (pow (/ t l) 2.0)))
     (asin (/ l (* t (sqrt 2.0)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t / l) <= -200.0) {
		tmp = asin((-l / (t / sqrt(0.5))));
	} else if ((t / l) <= 0.002) {
		tmp = asin((1.0 - pow((t / l), 2.0)));
	} else {
		tmp = asin((l / (t * sqrt(2.0))));
	}
	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 / l) <= (-200.0d0)) then
        tmp = asin((-l / (t / sqrt(0.5d0))))
    else if ((t / l) <= 0.002d0) then
        tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
    else
        tmp = asin((l / (t * sqrt(2.0d0))))
    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 / l) <= -200.0) {
		tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
	} else if ((t / l) <= 0.002) {
		tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
	} else {
		tmp = Math.asin((l / (t * Math.sqrt(2.0))));
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	tmp = 0
	if (t / l) <= -200.0:
		tmp = math.asin((-l / (t / math.sqrt(0.5))))
	elif (t / l) <= 0.002:
		tmp = math.asin((1.0 - math.pow((t / l), 2.0)))
	else:
		tmp = math.asin((l / (t * math.sqrt(2.0))))
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	tmp = 0.0
	if (Float64(t / l) <= -200.0)
		tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5))));
	elseif (Float64(t / l) <= 0.002)
		tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0)));
	else
		tmp = asin(Float64(l / Float64(t * sqrt(2.0))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if ((t / l) <= -200.0)
		tmp = asin((-l / (t / sqrt(0.5))));
	elseif ((t / l) <= 0.002)
		tmp = asin((1.0 - ((t / l) ^ 2.0)));
	else
		tmp = asin((l / (t * sqrt(2.0))));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -200.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\

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


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

    1. Initial program 63.0%

      \[\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.2%

      \[\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)} \]
    3. Step-by-step derivation
      1. associate-*r*90.2%

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

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

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

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

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

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

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

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

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

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

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

    if -200 < (/.f64 t l) < 2e-3

    1. Initial program 98.0%

      \[\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-div98.0%

        \[\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-inv98.0%

        \[\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-sqrt98.0%

        \[\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-def98.0%

        \[\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. *-commutative98.0%

        \[\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-prod98.0%

        \[\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. unpow298.0%

        \[\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-prod54.8%

        \[\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-sqrt98.0%

        \[\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-rr98.0%

      \[\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. associate-*r/98.0%

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{\color{blue}{1}}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right) \]
    7. Step-by-step derivation
      1. expm1-log1p-u96.0%

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t \cdot \sqrt{2}}{\ell}\right)} - 1}\right)}\right) \]
      3. associate-/l*96.0%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, e^{\mathsf{log1p}\left(\color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)} - 1\right)}\right) \]
    8. Applied egg-rr96.0%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{e^{\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)} - 1}\right)}\right) \]
    9. Step-by-step derivation
      1. expm1-def96.0%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\frac{\ell}{\sqrt{2}}}\right)\right)}\right)}\right) \]
      2. expm1-log1p96.8%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)}\right) \]
      3. associate-/r/96.8%

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(1 + -0.5 \cdot \frac{{t}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{\ell}^{2}}\right)} \]
    12. Step-by-step derivation
      1. associate-*r/86.7%

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

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

        \[\leadsto \sin^{-1} \left(1 + \frac{-0.5 \cdot \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot {t}^{2}\right)}{{\ell}^{2}}\right) \]
      4. rem-square-sqrt86.7%

        \[\leadsto \sin^{-1} \left(1 + \frac{-0.5 \cdot \left(\color{blue}{2} \cdot {t}^{2}\right)}{{\ell}^{2}}\right) \]
      5. associate-*r*86.7%

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

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

        \[\leadsto \sin^{-1} \left(1 + \color{blue}{-1 \cdot \frac{{t}^{2}}{{\ell}^{2}}}\right) \]
      8. mul-1-neg86.7%

        \[\leadsto \sin^{-1} \left(1 + \color{blue}{\left(-\frac{{t}^{2}}{{\ell}^{2}}\right)}\right) \]
      9. unsub-neg86.7%

        \[\leadsto \sin^{-1} \color{blue}{\left(1 - \frac{{t}^{2}}{{\ell}^{2}}\right)} \]
      10. unpow286.7%

        \[\leadsto \sin^{-1} \left(1 - \frac{\color{blue}{t \cdot t}}{{\ell}^{2}}\right) \]
      11. unpow286.7%

        \[\leadsto \sin^{-1} \left(1 - \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}\right) \]
      12. times-frac95.7%

        \[\leadsto \sin^{-1} \left(1 - \color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}\right) \]
      13. unpow295.7%

        \[\leadsto \sin^{-1} \left(1 - \color{blue}{{\left(\frac{t}{\ell}\right)}^{2}}\right) \]
    13. Simplified95.7%

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

    if 2e-3 < (/.f64 t l)

    1. Initial program 78.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-div78.8%

        \[\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-inv78.8%

        \[\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-sqrt78.8%

        \[\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-def78.8%

        \[\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. *-commutative78.8%

        \[\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-prod78.5%

        \[\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. unpow278.5%

        \[\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-prod98.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-sqrt98.6%

        \[\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-rr98.6%

      \[\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. associate-*r/98.6%

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

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

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

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

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

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

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

Alternative 10: 64.4% accurate, 2.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.2 \cdot 10^{-158}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+73}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= l -4.2e-158)
   (asin 1.0)
   (if (<= l 8.5e+73) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (l <= -4.2e-158) {
		tmp = asin(1.0);
	} else if (l <= 8.5e+73) {
		tmp = asin((l / (t * sqrt(2.0))));
	} else {
		tmp = asin(1.0);
	}
	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 (l <= (-4.2d-158)) then
        tmp = asin(1.0d0)
    else if (l <= 8.5d+73) then
        tmp = asin((l / (t * sqrt(2.0d0))))
    else
        tmp = asin(1.0d0)
    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 (l <= -4.2e-158) {
		tmp = Math.asin(1.0);
	} else if (l <= 8.5e+73) {
		tmp = Math.asin((l / (t * Math.sqrt(2.0))));
	} else {
		tmp = Math.asin(1.0);
	}
	return tmp;
}
t = abs(t)
def code(t, l, Om, Omc):
	tmp = 0
	if l <= -4.2e-158:
		tmp = math.asin(1.0)
	elif l <= 8.5e+73:
		tmp = math.asin((l / (t * math.sqrt(2.0))))
	else:
		tmp = math.asin(1.0)
	return tmp
t = abs(t)
function code(t, l, Om, Omc)
	tmp = 0.0
	if (l <= -4.2e-158)
		tmp = asin(1.0);
	elseif (l <= 8.5e+73)
		tmp = asin(Float64(l / Float64(t * sqrt(2.0))));
	else
		tmp = asin(1.0);
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if (l <= -4.2e-158)
		tmp = asin(1.0);
	elseif (l <= 8.5e+73)
		tmp = asin((l / (t * sqrt(2.0))));
	else
		tmp = asin(1.0);
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -4.2e-158], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 8.5e+73], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{-158}:\\
\;\;\;\;\sin^{-1} 1\\

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

\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.19999999999999983e-158 or 8.4999999999999998e73 < l

    1. Initial program 90.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 60.0%

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{1} \]

    if -4.19999999999999983e-158 < l < 8.4999999999999998e73

    1. Initial program 73.5%

      \[\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-div73.5%

        \[\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-inv73.5%

        \[\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-sqrt73.5%

        \[\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-def73.5%

        \[\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. *-commutative73.5%

        \[\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-prod73.4%

        \[\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. unpow273.4%

        \[\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-prod42.8%

        \[\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-sqrt98.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-rr98.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. associate-*r/98.1%

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

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

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

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

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

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

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

Alternative 11: 50.3% accurate, 4.1× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} 1 \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc) :precision binary64 (asin 1.0))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	return asin(1.0);
}
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)
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(1.0);
}
t = abs(t)
def code(t, l, Om, Omc):
	return math.asin(1.0)
t = abs(t)
function code(t, l, Om, Omc)
	return asin(1.0)
end
t = abs(t)
function tmp = code(t, l, Om, Omc)
	tmp = asin(1.0);
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} 1
\end{array}
Derivation
  1. Initial program 83.9%

    \[\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 42.9%

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

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

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

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

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

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

    \[\leadsto \sin^{-1} \color{blue}{1} \]
  6. Final simplification48.0%

    \[\leadsto \sin^{-1} 1 \]

Reproduce

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