Toniolo and Linder, Equation (2)

Percentage Accurate: 84.2% → 98.4%
Time: 14.6s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 84.2% 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.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e156 < (/.f64 t l) < 5.00000000000000008e115

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

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

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

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

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

    if 5.00000000000000008e115 < (/.f64 t l)

    1. Initial program 58.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 86.9%

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u86.9%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\right)} - 1} \]
      3. associate-*r/35.4%

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \sqrt{0.5}}{\frac{t}{\ell}}\right)}\right)} - 1 \]
      4. pow1/235.4%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{{\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right)}^{0.5} \cdot \color{blue}{{0.5}^{0.5}}}{\frac{t}{\ell}}\right)\right)} - 1 \]
      8. pow-prod-down42.2%

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{\color{blue}{{\left(\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5\right)}^{0.5}}}{\frac{t}{\ell}}\right)\right)} - 1 \]
    6. Applied egg-rr42.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{{\left(\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5\right)}^{0.5}}{\frac{t}{\ell}}\right)\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+156}:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+115}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5}}{\frac{t}{\ell}}\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 84.4%

    \[\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-div84.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-inv84.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-sqrt84.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-def84.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. *-commutative84.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-prod84.3%

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

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

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

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

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

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

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

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

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

    \[\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: 98.3% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000045e24 < (/.f64 t l) < 9.9999999999999994e38

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

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

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

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

    if 9.9999999999999994e38 < (/.f64 t l)

    1. Initial program 67.2%

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u87.9%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\right)} - 1} \]
      3. associate-*r/28.5%

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \sqrt{0.5}}{\frac{t}{\ell}}\right)}\right)} - 1 \]
      4. pow1/228.5%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{{\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right)}^{0.5} \cdot \color{blue}{{0.5}^{0.5}}}{\frac{t}{\ell}}\right)\right)} - 1 \]
      8. pow-prod-down33.8%

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{\color{blue}{{\left(\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5\right)}^{0.5}}}{\frac{t}{\ell}}\right)\right)} - 1 \]
    6. Applied egg-rr33.8%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\frac{{\left(\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5\right)}^{0.5}}{\frac{t}{\ell}}\right)\right)\right)} \]
      2. expm1-log1p99.5%

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

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

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

Alternative 4: 97.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

    1. Initial program 72.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 inf 86.7%

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u86.8%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\right)} - 1} \]
      3. associate-*r/27.3%

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}} \cdot \sqrt{0.5}}{\frac{t}{\ell}}\right)}\right)} - 1 \]
      4. pow1/227.3%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{{\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right)}^{0.5} \cdot \color{blue}{{0.5}^{0.5}}}{\frac{t}{\ell}}\right)\right)} - 1 \]
      8. pow-prod-down31.8%

        \[\leadsto e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{\color{blue}{{\left(\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5\right)}^{0.5}}}{\frac{t}{\ell}}\right)\right)} - 1 \]
    6. Applied egg-rr31.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\frac{{\left(\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5\right)}^{0.5}}{\frac{t}{\ell}}\right)\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def97.7%

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

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

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

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

Alternative 5: 97.0% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

    1. Initial program 72.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 inf 86.7%

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

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

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

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

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

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

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

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

Alternative 6: 79.7% accurate, 1.9× speedup?

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

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


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

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

    if -1e221 < (/.f64 t l) < 2e-8

    1. Initial program 94.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 65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.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 inf 86.7%

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

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

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

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

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

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

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

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

Alternative 8: 96.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.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 inf 86.7%

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

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

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

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

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

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

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

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

Alternative 9: 64.2% accurate, 2.0× speedup?

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

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


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

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.34e73 < t

    1. Initial program 72.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 34.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)} \]
    8. Taylor expanded in l around 0 60.6%

      \[\leadsto \color{blue}{\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \ell}{t}\right)} \]
    9. Step-by-step derivation
      1. associate-*l/60.6%

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

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

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

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

Alternative 10: 64.2% accurate, 2.0× speedup?

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

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


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

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6e72 < t

    1. Initial program 72.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 34.8%

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

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

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

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

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

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

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

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

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

Alternative 11: 64.2% accurate, 2.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.18 \cdot 10^{+73}:\\ \;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\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 1.18e+73)
   (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))
   (asin (/ l (* t (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (t <= 1.18e+73) {
		tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
	} 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 <= 1.18d+73) then
        tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
    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 <= 1.18e+73) {
		tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
	} 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 <= 1.18e+73:
		tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))))
	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 (t <= 1.18e+73)
		tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc)))));
	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 <= 1.18e+73)
		tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
	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[t, 1.18e+73], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $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}\;t \leq 1.18 \cdot 10^{+73}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\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 t < 1.18000000000000004e73

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.18000000000000004e73 < t

    1. Initial program 72.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-div72.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-inv72.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-sqrt72.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-def72.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. *-commutative72.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-prod71.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. unpow271.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-prod58.3%

        \[\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 t around inf 50.9%

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

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

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

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

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

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

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

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

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

Alternative 12: 51.1% accurate, 3.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 50.8% 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 84.4%

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

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

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

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

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

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

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

Reproduce

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