Toniolo and Linder, Equation (2)

Percentage Accurate: 84.0% → 98.4%
Time: 13.8s
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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.5% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sin^{-1} \color{blue}{\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}\right)} \]
  7. Step-by-step derivation
    1. unpow283.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.0% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 64.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}\right)} \]
    7. Step-by-step derivation
      1. unpow264.7%

        \[\leadsto \sin^{-1} \left(\frac{1}{\sqrt{\mathsf{fma}\left(2, \color{blue}{\frac{t}{\ell} \cdot \frac{t}{\ell}}, 1\right)}}\right) \]
      2. times-frac58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999972e118 < (/.f64 t l) < 2e153

    1. Initial program 98.8%

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

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

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

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

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

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

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

    if 2e153 < (/.f64 t l)

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5000:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{\sqrt{2}}}{t}\right)\\

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

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


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

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\color{blue}{{\ell}^{2}}}, 1\right)}}\right) \]
      5. fma-def58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e3 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 63.8%

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

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

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

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

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

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

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

Alternative 6: 97.2% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\sqrt{\color{blue}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}}\right) \]
    6. Applied egg-rr76.0%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}\right)} \]
    7. Step-by-step derivation
      1. unpow276.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.5 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 63.8%

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

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

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

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

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

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

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

Alternative 7: 79.9% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e216 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 95.8%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.9% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e216 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 95.8%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 63.8%

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

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

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

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

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

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

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

Alternative 9: 96.9% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\sqrt{\color{blue}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}}\right) \]
    6. Applied egg-rr76.0%

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}\right)} \]
    7. Step-by-step derivation
      1. unpow276.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.5 < (/.f64 t l) < 0.050000000000000003

    1. Initial program 98.6%

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

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

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

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

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

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

    if 0.050000000000000003 < (/.f64 t l)

    1. Initial program 63.8%

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

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

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

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

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

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

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

Alternative 10: 61.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{-122}:\\
\;\;\;\;\sin^{-1} 1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -8.50000000000000003e-122 or 2.1000000000000001e40 < l

    1. Initial program 93.1%

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

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

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

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

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

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

    if -8.50000000000000003e-122 < l < 2.1000000000000001e40

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 51.1% accurate, 4.1× speedup?

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

\\
\sin^{-1} 1
\end{array}
Derivation
  1. Initial program 83.7%

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

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

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

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

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

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

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

Reproduce

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