Toniolo and Linder, Equation (2)

Percentage Accurate: 84.4% → 97.8%
Time: 23.6s
Alternatives: 13
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 84.4% 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: 97.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 37.5%

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

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

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

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

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

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

    if -9.99999999999999953e157 < (/.f64 t l) < 5.00000000000000012e143

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000012e143 < (/.f64 t l)

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\[\begin{array}{l} t = |t|\\ \\ \mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)\right)\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
 :precision binary64
 (expm1 (log1p (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 expm1(log1p(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.expm1(Math.log1p(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.expm1(math.log1p(math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))))
t = abs(t)
function code(t, l, Om, Omc)
	return expm1(log1p(asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0)))))))
end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := N[(Exp[N[Log[1 + 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]], $MachinePrecision]] - 1), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)\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. Taylor expanded in Om around 0 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{1}{\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-sqrt97.1%

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

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

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

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

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

Alternative 4: 97.4% 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. Taylor expanded in Om around 0 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{1}{\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-sqrt97.1%

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

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

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

Alternative 5: 97.9% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 53.4%

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

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

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

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

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

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

    if -4.99999999999999961e80 < (/.f64 t l) < 4.99999999999999989e122

    1. Initial program 98.0%

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

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

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

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

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

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

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

    if 4.99999999999999989e122 < (/.f64 t l)

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

Alternative 6: 96.9% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -20000000000:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{-6}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \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 l) -20000000000.0)
   (asin (/ (* (sqrt 0.5) (- l)) t))
   (if (<= (/ t l) 5e-6)
     (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 / l) <= -20000000000.0) {
		tmp = asin(((sqrt(0.5) * -l) / t));
	} else if ((t / l) <= 5e-6) {
		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 / l) <= (-20000000000.0d0)) then
        tmp = asin(((sqrt(0.5d0) * -l) / t))
    else if ((t / l) <= 5d-6) 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 / l) <= -20000000000.0) {
		tmp = Math.asin(((Math.sqrt(0.5) * -l) / t));
	} else if ((t / l) <= 5e-6) {
		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 / l) <= -20000000000.0:
		tmp = math.asin(((math.sqrt(0.5) * -l) / t))
	elif (t / l) <= 5e-6:
		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 (Float64(t / l) <= -20000000000.0)
		tmp = asin(Float64(Float64(sqrt(0.5) * Float64(-l)) / t));
	elseif (Float64(t / l) <= 5e-6)
		tmp = asin(sqrt(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om))))));
	else
		tmp = asin(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 / l) <= -20000000000.0)
		tmp = asin(((sqrt(0.5) * -l) / t));
	elseif ((t / l) <= 5e-6)
		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[N[(t / l), $MachinePrecision], -20000000000.0], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e-6], N[ArcSin[N[Sqrt[N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $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}\;\frac{t}{\ell} \leq -20000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \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 3 regimes
  2. if (/.f64 t l) < -2e10

    1. Initial program 68.5%

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

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

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

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

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

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

    if -2e10 < (/.f64 t l) < 5.00000000000000041e-6

    1. Initial program 97.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-div97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\sqrt{1 - \frac{\color{blue}{Om}}{\frac{Omc \cdot Omc}{Om}}}\right) \]
      3. associate-*r/96.4%

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

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

    if 5.00000000000000041e-6 < (/.f64 t l)

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

Alternative 7: 96.3% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -20000000000:\\ \;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{-6}:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\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 l) -20000000000.0)
   (asin (* (sqrt 0.5) (/ (- l) t)))
   (if (<= (/ t l) 5e-6)
     (asin (- 1.0 (pow (/ t l) 2.0)))
     (asin (/ l (/ t (sqrt 0.5)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t / l) <= -20000000000.0) {
		tmp = asin((sqrt(0.5) * (-l / t)));
	} else if ((t / l) <= 5e-6) {
		tmp = asin((1.0 - pow((t / l), 2.0)));
	} 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 / l) <= (-20000000000.0d0)) then
        tmp = asin((sqrt(0.5d0) * (-l / t)))
    else if ((t / l) <= 5d-6) then
        tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
    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 / l) <= -20000000000.0) {
		tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
	} else if ((t / l) <= 5e-6) {
		tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
	} 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 / l) <= -20000000000.0:
		tmp = math.asin((math.sqrt(0.5) * (-l / t)))
	elif (t / l) <= 5e-6:
		tmp = math.asin((1.0 - math.pow((t / l), 2.0)))
	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 (Float64(t / l) <= -20000000000.0)
		tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t)));
	elseif (Float64(t / l) <= 5e-6)
		tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0)));
	else
		tmp = asin(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 / l) <= -20000000000.0)
		tmp = asin((sqrt(0.5) * (-l / t)));
	elseif ((t / l) <= 5e-6)
		tmp = asin((1.0 - ((t / l) ^ 2.0)));
	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[N[(t / l), $MachinePrecision], -20000000000.0], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e-6], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $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}\;\frac{t}{\ell} \leq -20000000000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e10 < (/.f64 t l) < 5.00000000000000041e-6

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000041e-6 < (/.f64 t l)

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

Alternative 8: 96.3% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -20000000000:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{-6}:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\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 l) -20000000000.0)
   (asin (/ (* (sqrt 0.5) (- l)) t))
   (if (<= (/ t l) 5e-6)
     (asin (- 1.0 (pow (/ t l) 2.0)))
     (asin (/ l (/ t (sqrt 0.5)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t / l) <= -20000000000.0) {
		tmp = asin(((sqrt(0.5) * -l) / t));
	} else if ((t / l) <= 5e-6) {
		tmp = asin((1.0 - pow((t / l), 2.0)));
	} 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 / l) <= (-20000000000.0d0)) then
        tmp = asin(((sqrt(0.5d0) * -l) / t))
    else if ((t / l) <= 5d-6) then
        tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
    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 / l) <= -20000000000.0) {
		tmp = Math.asin(((Math.sqrt(0.5) * -l) / t));
	} else if ((t / l) <= 5e-6) {
		tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
	} 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 / l) <= -20000000000.0:
		tmp = math.asin(((math.sqrt(0.5) * -l) / t))
	elif (t / l) <= 5e-6:
		tmp = math.asin((1.0 - math.pow((t / l), 2.0)))
	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 (Float64(t / l) <= -20000000000.0)
		tmp = asin(Float64(Float64(sqrt(0.5) * Float64(-l)) / t));
	elseif (Float64(t / l) <= 5e-6)
		tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0)));
	else
		tmp = asin(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 / l) <= -20000000000.0)
		tmp = asin(((sqrt(0.5) * -l) / t));
	elseif ((t / l) <= 5e-6)
		tmp = asin((1.0 - ((t / l) ^ 2.0)));
	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[N[(t / l), $MachinePrecision], -20000000000.0], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e-6], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $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}\;\frac{t}{\ell} \leq -20000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

    if -2e10 < (/.f64 t l) < 5.00000000000000041e-6

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000041e-6 < (/.f64 t l)

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

Alternative 9: 80.1% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e209 < (/.f64 t l) < 5.00000000000000041e-6

    1. Initial program 91.7%

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

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

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

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

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

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

    if 5.00000000000000041e-6 < (/.f64 t l)

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

Alternative 10: 96.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e10 < (/.f64 t l) < 5.00000000000000041e-6

    1. Initial program 97.5%

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

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

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

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

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

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

    if 5.00000000000000041e-6 < (/.f64 t l)

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

Alternative 11: 63.8% accurate, 2.0× speedup?

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

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


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

    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 Om around 0 70.7%

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

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

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

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

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

    if 9.2000000000000002e126 < t

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.9% accurate, 2.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.55 \cdot 10^{+124}:\\ \;\;\;\;\sin^{-1} 1\\ \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 1.55e+124) (asin 1.0) (asin (/ l (/ t (sqrt 0.5))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (t <= 1.55e+124) {
		tmp = asin(1.0);
	} 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 <= 1.55d+124) then
        tmp = asin(1.0d0)
    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 <= 1.55e+124) {
		tmp = Math.asin(1.0);
	} 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 <= 1.55e+124:
		tmp = math.asin(1.0)
	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 <= 1.55e+124)
		tmp = asin(1.0);
	else
		tmp = asin(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 <= 1.55e+124)
		tmp = asin(1.0);
	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, 1.55e+124], N[ArcSin[1.0], $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 1.55 \cdot 10^{+124}:\\
\;\;\;\;\sin^{-1} 1\\

\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 < 1.5500000000000001e124

    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 Om around 0 70.7%

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

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

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

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

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

    if 1.5500000000000001e124 < t

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

Alternative 13: 51.4% 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. Taylor expanded in Om around 0 66.7%

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

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

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

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

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

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

Reproduce

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