Toniolo and Linder, Equation (2)

Percentage Accurate: 84.4% → 98.8%
Time: 18.9s
Alternatives: 11
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 11 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: 98.8% accurate, 1.2× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\frac{t\_m}{\ell} \leq -1 \cdot 10^{+146}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}} \cdot \left(\frac{\ell}{t\_m} \cdot \left(-\sqrt{0.5}\right)\right)\right)\\ \mathbf{elif}\;\frac{t\_m}{\ell} \leq 10^{+134}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t\_m}{\ell}}{\frac{\ell}{t\_m}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right) \cdot \frac{\ell}{t\_m \cdot {0.5}^{-0.5}}\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (if (<= (/ t_m l) -1e+146)
   (asin
    (* (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (* (/ l t_m) (- (sqrt 0.5)))))
   (if (<= (/ t_m l) 1e+134)
     (asin
      (sqrt
       (/
        (- 1.0 (pow (/ Om Omc) 2.0))
        (+ 1.0 (* 2.0 (/ (/ t_m l) (/ l t_m)))))))
     (asin (* (hypot 1.0 (/ Om Omc)) (/ l (* t_m (pow 0.5 -0.5))))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if ((t_m / l) <= -1e+146) {
		tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) * ((l / t_m) * -sqrt(0.5))));
	} else if ((t_m / l) <= 1e+134) {
		tmp = asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t_m / l) / (l / t_m)))))));
	} else {
		tmp = asin((hypot(1.0, (Om / Omc)) * (l / (t_m * pow(0.5, -0.5)))));
	}
	return tmp;
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if ((t_m / l) <= -1e+146) {
		tmp = Math.asin((Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) * ((l / t_m) * -Math.sqrt(0.5))));
	} else if ((t_m / l) <= 1e+134) {
		tmp = Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t_m / l) / (l / t_m)))))));
	} else {
		tmp = Math.asin((Math.hypot(1.0, (Om / Omc)) * (l / (t_m * Math.pow(0.5, -0.5)))));
	}
	return tmp;
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	tmp = 0
	if (t_m / l) <= -1e+146:
		tmp = math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) * ((l / t_m) * -math.sqrt(0.5))))
	elif (t_m / l) <= 1e+134:
		tmp = math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t_m / l) / (l / t_m)))))))
	else:
		tmp = math.asin((math.hypot(1.0, (Om / Omc)) * (l / (t_m * math.pow(0.5, -0.5)))))
	return tmp
t_m = abs(t)
function code(t_m, l, Om, Omc)
	tmp = 0.0
	if (Float64(t_m / l) <= -1e+146)
		tmp = asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) * Float64(Float64(l / t_m) * Float64(-sqrt(0.5)))));
	elseif (Float64(t_m / l) <= 1e+134)
		tmp = asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m / l) / Float64(l / t_m)))))));
	else
		tmp = asin(Float64(hypot(1.0, Float64(Om / Omc)) * Float64(l / Float64(t_m * (0.5 ^ -0.5)))));
	end
	return tmp
end
t_m = abs(t);
function tmp_2 = code(t_m, l, Om, Omc)
	tmp = 0.0;
	if ((t_m / l) <= -1e+146)
		tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) * ((l / t_m) * -sqrt(0.5))));
	elseif ((t_m / l) <= 1e+134)
		tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t_m / l) / (l / t_m)))))));
	else
		tmp = asin((hypot(1.0, (Om / Omc)) * (l / (t_m * (0.5 ^ -0.5)))));
	end
	tmp_2 = tmp;
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -1e+146], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(l / t$95$m), $MachinePrecision] * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 1e+134], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t$95$m / l), $MachinePrecision] / N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[1.0 ^ 2 + N[(Om / Omc), $MachinePrecision] ^ 2], $MachinePrecision] * N[(l / N[(t$95$m * N[Power[0.5, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|

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

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

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right) \cdot \frac{\ell}{t\_m \cdot {0.5}^{-0.5}}\right)\\


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

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999934e145 < (/.f64 t l) < 9.99999999999999921e133

    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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow298.0%

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

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

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

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

    if 9.99999999999999921e133 < (/.f64 t l)

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+146}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}} \cdot \left(\frac{\ell}{t} \cdot \left(-\sqrt{0.5}\right)\right)\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 10^{+134}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right) \cdot \frac{\ell}{t \cdot {0.5}^{-0.5}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.4% accurate, 0.8× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t\_m}{\ell} \cdot \sqrt{2}\right)}\right) \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (asin
  (/
   (sqrt (- 1.0 (pow (/ Om Omc) 2.0)))
   (hypot 1.0 (* (/ t_m l) (sqrt 2.0))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t_m / l) * sqrt(2.0)))));
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t_m / l) * Math.sqrt(2.0)))));
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t_m / l) * math.sqrt(2.0)))))
t_m = abs(t)
function code(t_m, l, Om, Omc)
	return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t_m / l) * sqrt(2.0)))))
end
t_m = abs(t);
function tmp = code(t_m, l, Om, Omc)
	tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t_m / l) * sqrt(2.0)))));
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, 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$95$m / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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) \]
  8. Add Preprocessing

Alternative 3: 96.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 4: 98.8% accurate, 1.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} t_1 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\ \mathbf{if}\;\frac{t\_m}{\ell} \leq -2 \cdot 10^{+143}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{t\_1} \cdot \left(\frac{\ell}{t\_m} \cdot \left(-\sqrt{0.5}\right)\right)\right)\\ \mathbf{elif}\;\frac{t\_m}{\ell} \leq 5 \cdot 10^{+149}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{t\_1}{1 + 2 \cdot \frac{1}{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right) \cdot \frac{\ell}{t\_m \cdot {0.5}^{-0.5}}\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (let* ((t_1 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
   (if (<= (/ t_m l) -2e+143)
     (asin (* (sqrt t_1) (* (/ l t_m) (- (sqrt 0.5)))))
     (if (<= (/ t_m l) 5e+149)
       (asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ 1.0 (* (/ l t_m) (/ l t_m))))))))
       (asin (* (hypot 1.0 (/ Om Omc)) (/ l (* t_m (pow 0.5 -0.5)))))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
	double tmp;
	if ((t_m / l) <= -2e+143) {
		tmp = asin((sqrt(t_1) * ((l / t_m) * -sqrt(0.5))));
	} else if ((t_m / l) <= 5e+149) {
		tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
	} else {
		tmp = asin((hypot(1.0, (Om / Omc)) * (l / (t_m * pow(0.5, -0.5)))));
	}
	return tmp;
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
	double tmp;
	if ((t_m / l) <= -2e+143) {
		tmp = Math.asin((Math.sqrt(t_1) * ((l / t_m) * -Math.sqrt(0.5))));
	} else if ((t_m / l) <= 5e+149) {
		tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
	} else {
		tmp = Math.asin((Math.hypot(1.0, (Om / Omc)) * (l / (t_m * Math.pow(0.5, -0.5)))));
	}
	return tmp;
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	t_1 = 1.0 - ((Om / Omc) / (Omc / Om))
	tmp = 0
	if (t_m / l) <= -2e+143:
		tmp = math.asin((math.sqrt(t_1) * ((l / t_m) * -math.sqrt(0.5))))
	elif (t_m / l) <= 5e+149:
		tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))))
	else:
		tmp = math.asin((math.hypot(1.0, (Om / Omc)) * (l / (t_m * math.pow(0.5, -0.5)))))
	return tmp
t_m = abs(t)
function code(t_m, l, Om, Omc)
	t_1 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))
	tmp = 0.0
	if (Float64(t_m / l) <= -2e+143)
		tmp = asin(Float64(sqrt(t_1) * Float64(Float64(l / t_m) * Float64(-sqrt(0.5)))));
	elseif (Float64(t_m / l) <= 5e+149)
		tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t_m) * Float64(l / t_m))))))));
	else
		tmp = asin(Float64(hypot(1.0, Float64(Om / Omc)) * Float64(l / Float64(t_m * (0.5 ^ -0.5)))));
	end
	return tmp
end
t_m = abs(t);
function tmp_2 = code(t_m, l, Om, Omc)
	t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
	tmp = 0.0;
	if ((t_m / l) <= -2e+143)
		tmp = asin((sqrt(t_1) * ((l / t_m) * -sqrt(0.5))));
	elseif ((t_m / l) <= 5e+149)
		tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
	else
		tmp = asin((hypot(1.0, (Om / Omc)) * (l / (t_m * (0.5 ^ -0.5)))));
	end
	tmp_2 = tmp;
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -2e+143], N[ArcSin[N[(N[Sqrt[t$95$1], $MachinePrecision] * N[(N[(l / t$95$m), $MachinePrecision] * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 5e+149], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(1.0 / N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[1.0 ^ 2 + N[(Om / Omc), $MachinePrecision] ^ 2], $MachinePrecision] * N[(l / N[(t$95$m * N[Power[0.5, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|

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

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

\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right) \cdot \frac{\ell}{t\_m \cdot {0.5}^{-0.5}}\right)\\


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

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e143 < (/.f64 t l) < 4.9999999999999999e149

    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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow298.1%

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999999e149 < (/.f64 t l)

    1. Initial program 43.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+143}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}} \cdot \left(\frac{\ell}{t} \cdot \left(-\sqrt{0.5}\right)\right)\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+149}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{1}{\frac{\ell}{t} \cdot \frac{\ell}{t}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right) \cdot \frac{\ell}{t \cdot {0.5}^{-0.5}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.3% accurate, 1.9× speedup?

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

\\
\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(t\_m \cdot \left(\frac{t\_m}{\ell} \cdot \frac{1}{\ell}\right)\right)}}\right)
\end{array}
Derivation
  1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.4% accurate, 1.9× speedup?

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

\\
\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{1}{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}}}\right)
\end{array}
Derivation
  1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.5% accurate, 1.9× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} t_1 := \frac{\sqrt{0.5}}{t\_m}\\ \mathbf{if}\;t\_m \leq 1.65 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\ \mathbf{elif}\;t\_m \leq 5.5 \cdot 10^{+161}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \left(-t\_1\right)\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (let* ((t_1 (/ (sqrt 0.5) t_m)))
   (if (<= t_m 1.65e+27)
     (asin (hypot 1.0 (/ Om Omc)))
     (if (<= t_m 5.5e+161) (asin (* l t_1)) (asin (* l (- t_1)))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double t_1 = sqrt(0.5) / t_m;
	double tmp;
	if (t_m <= 1.65e+27) {
		tmp = asin(hypot(1.0, (Om / Omc)));
	} else if (t_m <= 5.5e+161) {
		tmp = asin((l * t_1));
	} else {
		tmp = asin((l * -t_1));
	}
	return tmp;
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	double t_1 = Math.sqrt(0.5) / t_m;
	double tmp;
	if (t_m <= 1.65e+27) {
		tmp = Math.asin(Math.hypot(1.0, (Om / Omc)));
	} else if (t_m <= 5.5e+161) {
		tmp = Math.asin((l * t_1));
	} else {
		tmp = Math.asin((l * -t_1));
	}
	return tmp;
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	t_1 = math.sqrt(0.5) / t_m
	tmp = 0
	if t_m <= 1.65e+27:
		tmp = math.asin(math.hypot(1.0, (Om / Omc)))
	elif t_m <= 5.5e+161:
		tmp = math.asin((l * t_1))
	else:
		tmp = math.asin((l * -t_1))
	return tmp
t_m = abs(t)
function code(t_m, l, Om, Omc)
	t_1 = Float64(sqrt(0.5) / t_m)
	tmp = 0.0
	if (t_m <= 1.65e+27)
		tmp = asin(hypot(1.0, Float64(Om / Omc)));
	elseif (t_m <= 5.5e+161)
		tmp = asin(Float64(l * t_1));
	else
		tmp = asin(Float64(l * Float64(-t_1)));
	end
	return tmp
end
t_m = abs(t);
function tmp_2 = code(t_m, l, Om, Omc)
	t_1 = sqrt(0.5) / t_m;
	tmp = 0.0;
	if (t_m <= 1.65e+27)
		tmp = asin(hypot(1.0, (Om / Omc)));
	elseif (t_m <= 5.5e+161)
		tmp = asin((l * t_1));
	else
		tmp = asin((l * -t_1));
	end
	tmp_2 = tmp;
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := Block[{t$95$1 = N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]}, If[LessEqual[t$95$m, 1.65e+27], N[ArcSin[N[Sqrt[1.0 ^ 2 + N[(Om / Omc), $MachinePrecision] ^ 2], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$m, 5.5e+161], N[ArcSin[N[(l * t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * (-t$95$1)), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
t_1 := \frac{\sqrt{0.5}}{t\_m}\\
\mathbf{if}\;t\_m \leq 1.65 \cdot 10^{+27}:\\
\;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\

\mathbf{elif}\;t\_m \leq 5.5 \cdot 10^{+161}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.6499999999999999e27

    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. Add Preprocessing
    3. Taylor expanded in t around 0 52.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\right)} - 1} \]
    7. Applied egg-rr58.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def58.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)\right)} \]
      2. expm1-log1p58.3%

        \[\leadsto \color{blue}{\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)} \]
    9. Simplified58.3%

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

    if 1.6499999999999999e27 < t < 5.5000000000000005e161

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\ell \cdot \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\sqrt{0.5}} \cdot \sqrt{\sqrt{0.5}}}}{t}\right)} - 1\right)\right) \]
      7. add-sqr-sqrt25.6%

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

      \[\leadsto \sin^{-1} \left(\ell \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{0.5}}{t}\right)} - 1\right)}\right) \]
    11. Step-by-step derivation
      1. expm1-def55.0%

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

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

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

    if 5.5000000000000005e161 < t

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.65 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+161}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.5% accurate, 1.9× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;t\_m \leq 1.25 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\ \mathbf{elif}\;t\_m \leq 10^{+162}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{-t\_m}{\sqrt{0.5}}}\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (if (<= t_m 1.25e+27)
   (asin (hypot 1.0 (/ Om Omc)))
   (if (<= t_m 1e+162)
     (asin (* l (/ (sqrt 0.5) t_m)))
     (asin (/ l (/ (- t_m) (sqrt 0.5)))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if (t_m <= 1.25e+27) {
		tmp = asin(hypot(1.0, (Om / Omc)));
	} else if (t_m <= 1e+162) {
		tmp = asin((l * (sqrt(0.5) / t_m)));
	} else {
		tmp = asin((l / (-t_m / sqrt(0.5))));
	}
	return tmp;
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if (t_m <= 1.25e+27) {
		tmp = Math.asin(Math.hypot(1.0, (Om / Omc)));
	} else if (t_m <= 1e+162) {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t_m)));
	} else {
		tmp = Math.asin((l / (-t_m / Math.sqrt(0.5))));
	}
	return tmp;
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	tmp = 0
	if t_m <= 1.25e+27:
		tmp = math.asin(math.hypot(1.0, (Om / Omc)))
	elif t_m <= 1e+162:
		tmp = math.asin((l * (math.sqrt(0.5) / t_m)))
	else:
		tmp = math.asin((l / (-t_m / math.sqrt(0.5))))
	return tmp
t_m = abs(t)
function code(t_m, l, Om, Omc)
	tmp = 0.0
	if (t_m <= 1.25e+27)
		tmp = asin(hypot(1.0, Float64(Om / Omc)));
	elseif (t_m <= 1e+162)
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t_m)));
	else
		tmp = asin(Float64(l / Float64(Float64(-t_m) / sqrt(0.5))));
	end
	return tmp
end
t_m = abs(t);
function tmp_2 = code(t_m, l, Om, Omc)
	tmp = 0.0;
	if (t_m <= 1.25e+27)
		tmp = asin(hypot(1.0, (Om / Omc)));
	elseif (t_m <= 1e+162)
		tmp = asin((l * (sqrt(0.5) / t_m)));
	else
		tmp = asin((l / (-t_m / sqrt(0.5))));
	end
	tmp_2 = tmp;
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[t$95$m, 1.25e+27], N[ArcSin[N[Sqrt[1.0 ^ 2 + N[(Om / Omc), $MachinePrecision] ^ 2], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$m, 1e+162], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[((-t$95$m) / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 1.25 \cdot 10^{+27}:\\
\;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.24999999999999995e27

    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. Add Preprocessing
    3. Taylor expanded in t around 0 52.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\right)} - 1} \]
    7. Applied egg-rr58.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def58.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)\right)} \]
      2. expm1-log1p58.3%

        \[\leadsto \color{blue}{\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)} \]
    9. Simplified58.3%

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

    if 1.24999999999999995e27 < t < 9.9999999999999994e161

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\ell \cdot \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\sqrt{0.5}} \cdot \sqrt{\sqrt{0.5}}}}{t}\right)} - 1\right)\right) \]
      7. add-sqr-sqrt25.6%

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

      \[\leadsto \sin^{-1} \left(\ell \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{0.5}}{t}\right)} - 1\right)}\right) \]
    11. Step-by-step derivation
      1. expm1-def55.0%

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

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

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

    if 9.9999999999999994e161 < t

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.25 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\ \mathbf{elif}\;t \leq 10^{+162}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{-t}{\sqrt{0.5}}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 63.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 9.5 \cdot 10^{+27}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\

\mathbf{elif}\;t\_m \leq 2.6 \cdot 10^{+162}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 9.4999999999999997e27

    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. Add Preprocessing
    3. Taylor expanded in t around 0 52.2%

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

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

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

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

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

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

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

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

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

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

    if 9.4999999999999997e27 < t < 2.6e162

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\ell \cdot \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\sqrt{0.5}} \cdot \sqrt{\sqrt{0.5}}}}{t}\right)} - 1\right)\right) \]
      7. add-sqr-sqrt25.6%

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

      \[\leadsto \sin^{-1} \left(\ell \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{0.5}}{t}\right)} - 1\right)}\right) \]
    11. Step-by-step derivation
      1. expm1-def55.0%

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

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

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

    if 2.6e162 < t

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9.5 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+162}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{-t}{\sqrt{0.5}}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 62.3% accurate, 2.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;t\_m \leq 4.1 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (if (<= t_m 4.1e+27)
   (asin (hypot 1.0 (/ Om Omc)))
   (asin (* l (/ (sqrt 0.5) t_m)))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if (t_m <= 4.1e+27) {
		tmp = asin(hypot(1.0, (Om / Omc)));
	} else {
		tmp = asin((l * (sqrt(0.5) / t_m)));
	}
	return tmp;
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if (t_m <= 4.1e+27) {
		tmp = Math.asin(Math.hypot(1.0, (Om / Omc)));
	} else {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t_m)));
	}
	return tmp;
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	tmp = 0
	if t_m <= 4.1e+27:
		tmp = math.asin(math.hypot(1.0, (Om / Omc)))
	else:
		tmp = math.asin((l * (math.sqrt(0.5) / t_m)))
	return tmp
t_m = abs(t)
function code(t_m, l, Om, Omc)
	tmp = 0.0
	if (t_m <= 4.1e+27)
		tmp = asin(hypot(1.0, Float64(Om / Omc)));
	else
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t_m)));
	end
	return tmp
end
t_m = abs(t);
function tmp_2 = code(t_m, l, Om, Omc)
	tmp = 0.0;
	if (t_m <= 4.1e+27)
		tmp = asin(hypot(1.0, (Om / Omc)));
	else
		tmp = asin((l * (sqrt(0.5) / t_m)));
	end
	tmp_2 = tmp;
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[t$95$m, 4.1e+27], N[ArcSin[N[Sqrt[1.0 ^ 2 + N[(Om / Omc), $MachinePrecision] ^ 2], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 4.1 \cdot 10^{+27}:\\
\;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in t around 0 52.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\right)} - 1} \]
    7. Applied egg-rr58.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def58.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)\right)} \]
      2. expm1-log1p58.3%

        \[\leadsto \color{blue}{\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)} \]
    9. Simplified58.3%

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

    if 4.1000000000000002e27 < t

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \left(\ell \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{0.5}}{t}\right)} - 1\right)}\right) \]
    11. Step-by-step derivation
      1. expm1-def53.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4.1 \cdot 10^{+27}:\\ \;\;\;\;\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 50.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\right)} - 1} \]
  7. Applied egg-rr48.4%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)} - 1} \]
  8. Step-by-step derivation
    1. expm1-def48.4%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)\right)\right)} \]
    2. expm1-log1p48.4%

      \[\leadsto \color{blue}{\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)} \]
  9. Simplified48.4%

    \[\leadsto \color{blue}{\sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right)} \]
  10. Final simplification48.4%

    \[\leadsto \sin^{-1} \left(\mathsf{hypot}\left(1, \frac{Om}{Omc}\right)\right) \]
  11. Add Preprocessing

Reproduce

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