Toniolo and Linder, Equation (2)

Percentage Accurate: 84.2% → 98.2%
Time: 11.9s
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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e163 < (/.f64 t l) < 1.9999999999999998e131

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

    if 1.9999999999999998e131 < (/.f64 t l)

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.8% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 5.00000000000000014e-307 or 1.6499999999999999e-165 < l

    1. Initial program 89.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. unpow289.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000014e-307 < l < 1.6499999999999999e-165

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (asin
  (/
   (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))
   (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 - ((Om / Omc) / (Omc / Om)))) / 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 - ((Om / Omc) / (Omc / Om)))) / 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 - ((Om / Omc) / (Omc / Om)))) / 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(Float64(Om / Omc) / Float64(Omc / Om)))) / 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) / (Omc / Om)))) / 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[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.7% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 5.00000000000000014e-307 or 1.4e-165 < l

    1. Initial program 89.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. unpow289.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000014e-307 < l < 1.4e-165

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.2% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 64.5% accurate, 2.0× speedup?

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

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


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

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000002e29 < t

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 31.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 31.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 31.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 0.0% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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