Toniolo and Linder, Equation (2)

Percentage Accurate: 83.9% → 98.4%
Time: 15.3s
Alternatives: 10
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 83.9% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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) \]
    11. associate-*l/98.3%

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

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

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

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

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

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

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

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

Alternative 2: 89.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+104}:\\
\;\;\;\;\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{\sqrt{\ell \cdot 0.5}}{\frac{t}{\sqrt{\ell}}}\right)\\


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

    1. Initial program 67.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 49.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. unpow249.7%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified49.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.6%

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

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

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

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

    if -3.9999999999999998e60 < (/.f64 t l) < 4.9999999999999997e104

    1. Initial program 98.2%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 72.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. unpow272.5%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified72.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-frac95.9%

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

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

    if 4.9999999999999997e104 < (/.f64 t l)

    1. Initial program 64.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 59.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+60}:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell \cdot \sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+104}:\\ \;\;\;\;\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{\sqrt{\ell \cdot 0.5}}{\frac{t}{\sqrt{\ell}}}\right)\\ \end{array} \]

Alternative 3: 97.4% accurate, 1.3× speedup?

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

\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \sqrt{2} \cdot \frac{t}{\ell}\right)}\right)
\end{array}
Derivation
  1. Initial program 85.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 65.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. unpow265.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.9% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 67.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 49.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. unpow249.7%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified49.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.6%

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

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

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

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

    if -3.9999999999999998e60 < (/.f64 t l) < 9.99999999999999944e57

    1. Initial program 98.1%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 75.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. unpow275.4%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified75.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-frac96.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-rr96.0%

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

    if 9.99999999999999944e57 < (/.f64 t l)

    1. Initial program 70.0%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 53.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. unpow253.7%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified53.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 98.8%

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

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

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

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

Alternative 5: 97.0% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 75.3%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 50.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. unpow250.3%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified50.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 98.4%

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

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

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

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

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

    1. Initial program 97.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 82.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. unpow282.6%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified82.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 82.6%

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

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

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

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

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

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

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

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

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

    1. Initial program 74.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 49.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. unpow249.5%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified49.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 98.1%

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

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

Alternative 6: 79.6% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\
\;\;\;\;\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 3 regimes
  2. if (/.f64 t l) < -5.0000000000000002e221

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.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 72.1%

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

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

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

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

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

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

    1. Initial program 74.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 49.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. unpow249.5%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified49.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 98.1%

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

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

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

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

Alternative 7: 79.6% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.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 72.1%

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

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

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

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

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

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

    1. Initial program 74.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 49.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. unpow249.5%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified49.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 98.1%

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

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

Alternative 8: 96.8% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 75.3%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 50.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. unpow250.3%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified50.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 98.4%

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

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

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

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

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

    1. Initial program 97.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 82.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. unpow282.6%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified82.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 93.8%

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

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

    1. Initial program 74.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 49.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. unpow249.5%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified49.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 98.1%

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

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

Alternative 9: 56.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.9 \cdot 10^{+135}:\\
\;\;\;\;\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 < 1.9000000000000001e135

    1. Initial program 86.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 68.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. unpow268.2%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified68.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 0 54.2%

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

    if 1.9000000000000001e135 < t

    1. Initial program 81.8%

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right) \]
    2. Taylor expanded in Om around 0 53.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. unpow253.6%

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

        \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
    4. Simplified53.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 inf 65.4%

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

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

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

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

Alternative 10: 50.4% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \sin^{-1} 1 \end{array} \]
(FPCore (t l Om Omc) :precision binary64 (asin 1.0))
double code(double t, double l, double Om, double Omc) {
	return asin(1.0);
}
real(8) function code(t, l, om, omc)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    code = asin(1.0d0)
end function
public static double code(double t, double l, double Om, double Omc) {
	return Math.asin(1.0);
}
def code(t, l, Om, Omc):
	return math.asin(1.0)
function code(t, l, Om, Omc)
	return asin(1.0)
end
function tmp = code(t, l, Om, Omc)
	tmp = asin(1.0);
end
code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}

\\
\sin^{-1} 1
\end{array}
Derivation
  1. Initial program 85.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 65.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. unpow265.6%

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

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\color{blue}{\ell \cdot \ell}}}}\right) \]
  4. Simplified65.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 47.7%

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

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

Reproduce

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