Toniolo and Linder, Equation (2)

Percentage Accurate: 83.7% → 98.1%
Time: 15.7s
Alternatives: 13
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

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

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

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000001e41 < (/.f64 t l) < 4.9999999999999999e100

    1. Initial program 98.7%

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

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

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

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

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

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

    if 4.9999999999999999e100 < (/.f64 t l)

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\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)} \]
  4. Final simplification98.8%

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

Alternative 4: 98.7% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000001e41 < (/.f64 t l) < 4.9999999999999999e100

    1. Initial program 98.7%

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

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

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

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

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

    if 4.9999999999999999e100 < (/.f64 t l)

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.7% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 71.0%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. sqrt-div71.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-inv71.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-sqrt71.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-def71.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. *-commutative71.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-prod70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e15 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 96.6% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 71.0%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. sqrt-div71.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-inv71.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-sqrt71.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-def71.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. *-commutative71.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-prod70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e15 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.4% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999995e211 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 93.9%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+211}:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.05:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= (/ t l) -5e+211)
   (asin (/ (sqrt 0.5) (/ t l)))
   (if (<= (/ t l) 0.05) (asin 1.0) (asin (/ (* l (sqrt 0.5)) t)))))
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t / l) <= -5e+211) {
		tmp = asin((sqrt(0.5) / (t / l)));
	} else if ((t / l) <= 0.05) {
		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 / l) <= (-5d+211)) then
        tmp = asin((sqrt(0.5d0) / (t / l)))
    else if ((t / l) <= 0.05d0) 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 / l) <= -5e+211) {
		tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
	} else if ((t / l) <= 0.05) {
		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 / l) <= -5e+211:
		tmp = math.asin((math.sqrt(0.5) / (t / l)))
	elif (t / l) <= 0.05:
		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 (Float64(t / l) <= -5e+211)
		tmp = asin(Float64(sqrt(0.5) / Float64(t / l)));
	elseif (Float64(t / l) <= 0.05)
		tmp = asin(1.0);
	else
		tmp = asin(Float64(Float64(l * sqrt(0.5)) / t));
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if ((t / l) <= -5e+211)
		tmp = asin((sqrt(0.5) / (t / l)));
	elseif ((t / l) <= 0.05)
		tmp = asin(1.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], -5e+211], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.05], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999995e211 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 93.9%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 96.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e15 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 96.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e15 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 96.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 71.0%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Step-by-step derivation
      1. sqrt-div71.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-inv71.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-sqrt71.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-def71.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. *-commutative71.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-prod70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e15 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.3% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+49} \lor \neg \left(t \leq 6.8 \cdot 10^{+137}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.0000000000000005e49 or 6.79999999999999973e137 < t

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.0000000000000005e49 < t < 6.79999999999999973e137

    1. Initial program 91.0%

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{+49} \lor \neg \left(t \leq 6.8 \cdot 10^{+137}\right):\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]

Alternative 13: 50.2% 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 86.2%

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

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

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

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

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

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

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

Reproduce

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