Toniolo and Linder, Equation (2)

Percentage Accurate: 84.2% → 98.7%
Time: 15.1s
Alternatives: 11
Speedup: 1.9×

Specification

?
\[\begin{array}{l} \\ \sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (asin
  (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
	return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc):
	return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc)
	return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0))))))
end
function tmp = code(t, l, Om, Omc)
	tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0))))));
end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\

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

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


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

    1. Initial program 51.1%

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

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

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

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

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

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

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

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

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

    if -3.9999999999999999e156 < (/.f64 t l) < 5.0000000000000001e142

    1. Initial program 98.1%

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

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

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

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

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

    if 5.0000000000000001e142 < (/.f64 t l)

    1. Initial program 48.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 Om around 0 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.3% accurate, 1.0× speedup?

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

\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 84.1%

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
  2. Step-by-step derivation
    1. sqrt-div84.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-inv84.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-sqrt84.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-def84.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. *-commutative84.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-prod83.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. unpow283.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-prod59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{\sqrt{0.5}}\\
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\

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

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


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

    1. Initial program 51.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 Om around 0 51.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(-\color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      3. distribute-neg-frac99.3%

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

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

    if -3.9999999999999999e156 < (/.f64 t l) < 5.0000000000000001e142

    1. Initial program 98.1%

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

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

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

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

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

    if 5.0000000000000001e142 < (/.f64 t l)

    1. Initial program 48.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 Om around 0 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{\sqrt{0.5}}\\
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\

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

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


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

    1. Initial program 51.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 Om around 0 51.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(-\color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      3. distribute-neg-frac99.3%

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

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

    if -3.9999999999999999e156 < (/.f64 t l) < 5.0000000000000001e142

    1. Initial program 98.1%

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{{\left(\frac{t}{\ell}\right)}^{2} \cdot 2}}\right)}\right) \]
      6. sqrt-prod97.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. unpow297.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-prod55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e142 < (/.f64 t l)

    1. Initial program 48.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 Om around 0 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{\sqrt{0.5}}\\
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\

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

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


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

    1. Initial program 51.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 Om around 0 51.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(-\color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      3. distribute-neg-frac99.3%

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

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

    if -3.9999999999999999e156 < (/.f64 t l) < 5.0000000000000001e142

    1. Initial program 98.1%

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

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

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

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

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

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

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

    if 5.0000000000000001e142 < (/.f64 t l)

    1. Initial program 48.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 Om around 0 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\ \mathbf{if}\;\ell \leq -1.15 \cdot 10^{+105}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-73}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-296}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+26}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (let* ((t_1 (asin (* l (/ (- (sqrt 0.5)) t)))))
   (if (<= l -1.15e+105)
     (asin 1.0)
     (if (<= l -1.15e-38)
       t_1
       (if (<= l -1e-73)
         (asin 1.0)
         (if (<= l -1.15e-296)
           t_1
           (if (<= l 2.9e+26) (asin (* l (/ (sqrt 0.5) t))) (asin 1.0))))))))
double code(double t, double l, double Om, double Omc) {
	double t_1 = asin((l * (-sqrt(0.5) / t)));
	double tmp;
	if (l <= -1.15e+105) {
		tmp = asin(1.0);
	} else if (l <= -1.15e-38) {
		tmp = t_1;
	} else if (l <= -1e-73) {
		tmp = asin(1.0);
	} else if (l <= -1.15e-296) {
		tmp = t_1;
	} else if (l <= 2.9e+26) {
		tmp = asin((l * (sqrt(0.5) / t)));
	} else {
		tmp = asin(1.0);
	}
	return tmp;
}
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 = asin((l * (-sqrt(0.5d0) / t)))
    if (l <= (-1.15d+105)) then
        tmp = asin(1.0d0)
    else if (l <= (-1.15d-38)) then
        tmp = t_1
    else if (l <= (-1d-73)) then
        tmp = asin(1.0d0)
    else if (l <= (-1.15d-296)) then
        tmp = t_1
    else if (l <= 2.9d+26) then
        tmp = asin((l * (sqrt(0.5d0) / t)))
    else
        tmp = asin(1.0d0)
    end if
    code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
	double t_1 = Math.asin((l * (-Math.sqrt(0.5) / t)));
	double tmp;
	if (l <= -1.15e+105) {
		tmp = Math.asin(1.0);
	} else if (l <= -1.15e-38) {
		tmp = t_1;
	} else if (l <= -1e-73) {
		tmp = Math.asin(1.0);
	} else if (l <= -1.15e-296) {
		tmp = t_1;
	} else if (l <= 2.9e+26) {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
	} else {
		tmp = Math.asin(1.0);
	}
	return tmp;
}
def code(t, l, Om, Omc):
	t_1 = math.asin((l * (-math.sqrt(0.5) / t)))
	tmp = 0
	if l <= -1.15e+105:
		tmp = math.asin(1.0)
	elif l <= -1.15e-38:
		tmp = t_1
	elif l <= -1e-73:
		tmp = math.asin(1.0)
	elif l <= -1.15e-296:
		tmp = t_1
	elif l <= 2.9e+26:
		tmp = math.asin((l * (math.sqrt(0.5) / t)))
	else:
		tmp = math.asin(1.0)
	return tmp
function code(t, l, Om, Omc)
	t_1 = asin(Float64(l * Float64(Float64(-sqrt(0.5)) / t)))
	tmp = 0.0
	if (l <= -1.15e+105)
		tmp = asin(1.0);
	elseif (l <= -1.15e-38)
		tmp = t_1;
	elseif (l <= -1e-73)
		tmp = asin(1.0);
	elseif (l <= -1.15e-296)
		tmp = t_1;
	elseif (l <= 2.9e+26)
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t)));
	else
		tmp = asin(1.0);
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	t_1 = asin((l * (-sqrt(0.5) / t)));
	tmp = 0.0;
	if (l <= -1.15e+105)
		tmp = asin(1.0);
	elseif (l <= -1.15e-38)
		tmp = t_1;
	elseif (l <= -1e-73)
		tmp = asin(1.0);
	elseif (l <= -1.15e-296)
		tmp = t_1;
	elseif (l <= 2.9e+26)
		tmp = asin((l * (sqrt(0.5) / t)));
	else
		tmp = asin(1.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[(l * N[((-N[Sqrt[0.5], $MachinePrecision]) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.15e+105], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.15e-38], t$95$1, If[LessEqual[l, -1e-73], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.15e-296], t$95$1, If[LessEqual[l, 2.9e+26], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+105}:\\
\;\;\;\;\sin^{-1} 1\\

\mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-73}:\\
\;\;\;\;\sin^{-1} 1\\

\mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-296}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+26}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.1499999999999999e105 or -1.15000000000000001e-38 < l < -9.99999999999999997e-74 or 2.9e26 < l

    1. Initial program 95.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 Om around 0 68.8%

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

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

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

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

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

    if -1.1499999999999999e105 < l < -1.15000000000000001e-38 or -9.99999999999999997e-74 < l < -1.15000000000000002e-296

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

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

    if -1.15000000000000002e-296 < l < 2.9e26

    1. Initial program 81.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 Om around 0 67.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.15 \cdot 10^{+105}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-38}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-73}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-296}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+26}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]

Alternative 7: 58.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\sqrt{0.5}\\ \mathbf{if}\;\ell \leq -1.2 \cdot 10^{+105}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -2.1 \cdot 10^{-38}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{t_1}{t}\right)\\ \mathbf{elif}\;\ell \leq -3.8 \cdot 10^{-75}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-296}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot t_1\right)\\ \mathbf{elif}\;\ell \leq 8 \cdot 10^{+29}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (let* ((t_1 (- (sqrt 0.5))))
   (if (<= l -1.2e+105)
     (asin 1.0)
     (if (<= l -2.1e-38)
       (asin (* l (/ t_1 t)))
       (if (<= l -3.8e-75)
         (asin 1.0)
         (if (<= l -1.15e-296)
           (asin (* (/ l t) t_1))
           (if (<= l 8e+29) (asin (* l (/ (sqrt 0.5) t))) (asin 1.0))))))))
double code(double t, double l, double Om, double Omc) {
	double t_1 = -sqrt(0.5);
	double tmp;
	if (l <= -1.2e+105) {
		tmp = asin(1.0);
	} else if (l <= -2.1e-38) {
		tmp = asin((l * (t_1 / t)));
	} else if (l <= -3.8e-75) {
		tmp = asin(1.0);
	} else if (l <= -1.15e-296) {
		tmp = asin(((l / t) * t_1));
	} else if (l <= 8e+29) {
		tmp = asin((l * (sqrt(0.5) / t)));
	} else {
		tmp = asin(1.0);
	}
	return tmp;
}
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 = -sqrt(0.5d0)
    if (l <= (-1.2d+105)) then
        tmp = asin(1.0d0)
    else if (l <= (-2.1d-38)) then
        tmp = asin((l * (t_1 / t)))
    else if (l <= (-3.8d-75)) then
        tmp = asin(1.0d0)
    else if (l <= (-1.15d-296)) then
        tmp = asin(((l / t) * t_1))
    else if (l <= 8d+29) then
        tmp = asin((l * (sqrt(0.5d0) / t)))
    else
        tmp = asin(1.0d0)
    end if
    code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
	double t_1 = -Math.sqrt(0.5);
	double tmp;
	if (l <= -1.2e+105) {
		tmp = Math.asin(1.0);
	} else if (l <= -2.1e-38) {
		tmp = Math.asin((l * (t_1 / t)));
	} else if (l <= -3.8e-75) {
		tmp = Math.asin(1.0);
	} else if (l <= -1.15e-296) {
		tmp = Math.asin(((l / t) * t_1));
	} else if (l <= 8e+29) {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
	} else {
		tmp = Math.asin(1.0);
	}
	return tmp;
}
def code(t, l, Om, Omc):
	t_1 = -math.sqrt(0.5)
	tmp = 0
	if l <= -1.2e+105:
		tmp = math.asin(1.0)
	elif l <= -2.1e-38:
		tmp = math.asin((l * (t_1 / t)))
	elif l <= -3.8e-75:
		tmp = math.asin(1.0)
	elif l <= -1.15e-296:
		tmp = math.asin(((l / t) * t_1))
	elif l <= 8e+29:
		tmp = math.asin((l * (math.sqrt(0.5) / t)))
	else:
		tmp = math.asin(1.0)
	return tmp
function code(t, l, Om, Omc)
	t_1 = Float64(-sqrt(0.5))
	tmp = 0.0
	if (l <= -1.2e+105)
		tmp = asin(1.0);
	elseif (l <= -2.1e-38)
		tmp = asin(Float64(l * Float64(t_1 / t)));
	elseif (l <= -3.8e-75)
		tmp = asin(1.0);
	elseif (l <= -1.15e-296)
		tmp = asin(Float64(Float64(l / t) * t_1));
	elseif (l <= 8e+29)
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t)));
	else
		tmp = asin(1.0);
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	t_1 = -sqrt(0.5);
	tmp = 0.0;
	if (l <= -1.2e+105)
		tmp = asin(1.0);
	elseif (l <= -2.1e-38)
		tmp = asin((l * (t_1 / t)));
	elseif (l <= -3.8e-75)
		tmp = asin(1.0);
	elseif (l <= -1.15e-296)
		tmp = asin(((l / t) * t_1));
	elseif (l <= 8e+29)
		tmp = asin((l * (sqrt(0.5) / t)));
	else
		tmp = asin(1.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = (-N[Sqrt[0.5], $MachinePrecision])}, If[LessEqual[l, -1.2e+105], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -2.1e-38], N[ArcSin[N[(l * N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -3.8e-75], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.15e-296], N[ArcSin[N[(N[(l / t), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 8e+29], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\sqrt{0.5}\\
\mathbf{if}\;\ell \leq -1.2 \cdot 10^{+105}:\\
\;\;\;\;\sin^{-1} 1\\

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

\mathbf{elif}\;\ell \leq -3.8 \cdot 10^{-75}:\\
\;\;\;\;\sin^{-1} 1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.19999999999999987e105 or -2.10000000000000013e-38 < l < -3.79999999999999994e-75 or 7.99999999999999931e29 < l

    1. Initial program 95.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 Om around 0 68.8%

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

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

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

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

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

    if -1.19999999999999987e105 < l < -2.10000000000000013e-38

    1. Initial program 73.5%

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg15.8%

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

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

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

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

    if -3.79999999999999994e-75 < l < -1.15000000000000002e-296

    1. Initial program 70.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 Om around 0 44.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(-\color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      3. associate-/r/49.7%

        \[\leadsto \sin^{-1} \left(-\color{blue}{\frac{\ell}{t} \cdot \sqrt{0.5}}\right) \]
      4. distribute-lft-neg-in49.7%

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

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

    if -1.15000000000000002e-296 < l < 7.99999999999999931e29

    1. Initial program 81.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 Om around 0 67.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.2 \cdot 10^{+105}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -2.1 \cdot 10^{-38}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\ell \leq -3.8 \cdot 10^{-75}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{-296}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \left(-\sqrt{0.5}\right)\right)\\ \mathbf{elif}\;\ell \leq 8 \cdot 10^{+29}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]

Alternative 8: 97.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\

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

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


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

    1. Initial program 77.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 Om around 0 40.0%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.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 Om around 0 79.8%

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(1 + -1 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg79.8%

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

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

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

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

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

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

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

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

    1. Initial program 68.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 Om around 0 49.3%

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

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

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

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

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

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

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

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

Alternative 9: 97.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\

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

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


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

    1. Initial program 77.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 Om around 0 40.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(-\color{blue}{\frac{\ell}{\frac{t}{\sqrt{0.5}}}}\right) \]
      3. distribute-neg-frac96.4%

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

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

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

    1. Initial program 97.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 Om around 0 79.8%

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(1 + -1 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg79.8%

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

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

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

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

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

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

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

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

    1. Initial program 68.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 Om around 0 49.3%

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

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

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

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

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

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

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

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

Alternative 10: 56.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 6000000000 \lor \neg \left(t \leq 2.5 \cdot 10^{+35}\right) \land t \leq 3.1 \cdot 10^{+89}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (if (or (<= t 6000000000.0) (and (not (<= t 2.5e+35)) (<= t 3.1e+89)))
   (asin 1.0)
   (asin (* l (/ (sqrt 0.5) t)))))
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t <= 6000000000.0) || (!(t <= 2.5e+35) && (t <= 3.1e+89))) {
		tmp = asin(1.0);
	} else {
		tmp = asin((l * (sqrt(0.5) / t)));
	}
	return tmp;
}
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 <= 6000000000.0d0) .or. (.not. (t <= 2.5d+35)) .and. (t <= 3.1d+89)) then
        tmp = asin(1.0d0)
    else
        tmp = asin((l * (sqrt(0.5d0) / t)))
    end if
    code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t <= 6000000000.0) || (!(t <= 2.5e+35) && (t <= 3.1e+89))) {
		tmp = Math.asin(1.0);
	} else {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
	}
	return tmp;
}
def code(t, l, Om, Omc):
	tmp = 0
	if (t <= 6000000000.0) or (not (t <= 2.5e+35) and (t <= 3.1e+89)):
		tmp = math.asin(1.0)
	else:
		tmp = math.asin((l * (math.sqrt(0.5) / t)))
	return tmp
function code(t, l, Om, Omc)
	tmp = 0.0
	if ((t <= 6000000000.0) || (!(t <= 2.5e+35) && (t <= 3.1e+89)))
		tmp = asin(1.0);
	else
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t)));
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if ((t <= 6000000000.0) || (~((t <= 2.5e+35)) && (t <= 3.1e+89)))
		tmp = asin(1.0);
	else
		tmp = asin((l * (sqrt(0.5) / t)));
	end
	tmp_2 = tmp;
end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[t, 6000000000.0], And[N[Not[LessEqual[t, 2.5e+35]], $MachinePrecision], LessEqual[t, 3.1e+89]]], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 6000000000 \lor \neg \left(t \leq 2.5 \cdot 10^{+35}\right) \land t \leq 3.1 \cdot 10^{+89}:\\
\;\;\;\;\sin^{-1} 1\\

\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 < 6e9 or 2.50000000000000011e35 < t < 3.1e89

    1. Initial program 87.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 Om around 0 66.1%

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

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

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

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

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

    if 6e9 < t < 2.50000000000000011e35 or 3.1e89 < t

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6000000000 \lor \neg \left(t \leq 2.5 \cdot 10^{+35}\right) \land t \leq 3.1 \cdot 10^{+89}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \end{array} \]

Alternative 11: 51.1% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \sin^{-1} 1 \end{array} \]
(FPCore (t l Om Omc) :precision binary64 (asin 1.0))
double code(double t, double l, double Om, double Omc) {
	return asin(1.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(1.0d0)
end function
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(1.0);
}
def code(t, l, Om, Omc):
	return math.asin(1.0)
function code(t, l, Om, Omc)
	return asin(1.0)
end
function tmp = code(t, l, Om, Omc)
	tmp = asin(1.0);
end
code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}

\\
\sin^{-1} 1
\end{array}
Derivation
  1. Initial program 84.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 Om around 0 62.6%

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

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

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

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

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

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

Reproduce

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