Toniolo and Linder, Equation (2)

Percentage Accurate: 84.1% → 98.6%
Time: 13.6s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 84.1% accurate, 1.0× speedup?

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

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

Alternative 1: 98.6% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 53.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. clear-num53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e155 < (/.f64 t l) < 1e133

    1. Initial program 98.5%

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

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

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

    if 1e133 < (/.f64 t l)

    1. Initial program 56.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-div56.1%

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in Om around 0 99.7%

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

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

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

Alternative 2: 98.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.9% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e20 < (/.f64 t l) < 2.00000000000000012e-9

    1. Initial program 98.1%

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

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

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

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

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

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

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

    if 2.00000000000000012e-9 < (/.f64 t l)

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in Om around 0 99.5%

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

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

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

Alternative 4: 97.3% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\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. Taylor expanded in Om around 0 97.4%

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

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

Alternative 5: 97.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 53.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. clear-num53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e155 < (/.f64 t l) < 1e133

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e133 < (/.f64 t l)

    1. Initial program 56.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-div56.1%

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in Om around 0 99.7%

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

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

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

Alternative 6: 97.9% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e34 < (/.f64 t l) < 1e133

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e133 < (/.f64 t l)

    1. Initial program 56.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-div56.1%

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in Om around 0 99.7%

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

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

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

Alternative 7: 79.5% accurate, 1.9× speedup?

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

        \[\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. Taylor expanded in Om around 0 98.8%

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

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

    if -4.9999999999999998e213 < (/.f64 t l) < 2.00000000000000012e-9

    1. Initial program 92.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. sqrt-div92.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 94.9% accurate, 1.9× speedup?

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

\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e20 < (/.f64 t l) < 2.00000000000000012e-9

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000012e-9 < (/.f64 t l)

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in Om around 0 99.5%

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

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

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

Alternative 9: 95.1% accurate, 1.9× speedup?

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

\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e20 < (/.f64 t l) < 2.00000000000000012e-9

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000012e-9 < (/.f64 t l)

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in Om around 0 99.5%

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

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

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

Alternative 10: 50.6% accurate, 4.1× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\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. Taylor expanded in Om around 0 97.4%

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

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

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

Reproduce

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