Toniolo and Linder, Equation (2)

Percentage Accurate: 83.7% → 98.3%
Time: 16.0s
Alternatives: 13
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 83.7% 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.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{t}{\ell}}{\sqrt{0.5}}\right)\right)}\right)}\right) \]
    7. associate-/r*73.5%

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

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

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

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

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

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

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

Alternative 2: 98.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\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. Step-by-step derivation
    1. unpow298.1%

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

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

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

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

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

Alternative 3: 79.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

    if 0.10000000000000001 < (pow.f64 (/.f64 t l) 2)

    1. Initial program 68.2%

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

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

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

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

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

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

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

Alternative 4: 97.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.9% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

    if -3.9999999999999999e82 < (/.f64 t l) < 1.9999999999999999e105

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e105 < (/.f64 t l)

    1. Initial program 49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+82}:\\ \;\;\;\;-\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+105}:\\ \;\;\;\;\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 6: 97.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -10000:\\ \;\;\;\;-\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\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) -10000.0)
   (- (asin (* l (/ (sqrt 0.5) t))))
   (if (<= (/ t l) 0.0002)
     (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
     (asin (* (sqrt 0.5) (/ l t))))))
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if ((t / l) <= -10000.0) {
		tmp = -asin((l * (sqrt(0.5) / t)));
	} else if ((t / l) <= 0.0002) {
		tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
	} 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) <= (-10000.0d0)) then
        tmp = -asin((l * (sqrt(0.5d0) / t)))
    else if ((t / l) <= 0.0002d0) then
        tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
    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) <= -10000.0) {
		tmp = -Math.asin((l * (Math.sqrt(0.5) / t)));
	} else if ((t / l) <= 0.0002) {
		tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
	} else {
		tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
	}
	return tmp;
}
def code(t, l, Om, Omc):
	tmp = 0
	if (t / l) <= -10000.0:
		tmp = -math.asin((l * (math.sqrt(0.5) / t)))
	elif (t / l) <= 0.0002:
		tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))))
	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) <= -10000.0)
		tmp = Float64(-asin(Float64(l * Float64(sqrt(0.5) / t))));
	elseif (Float64(t / l) <= 0.0002)
		tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))));
	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) <= -10000.0)
		tmp = -asin((l * (sqrt(0.5) / t)));
	elseif ((t / l) <= 0.0002)
		tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
	else
		tmp = asin((sqrt(0.5) * (l / t)));
	end
	tmp_2 = tmp;
end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], (-N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $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 -10000:\\
\;\;\;\;-\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\

\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\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) < -1e4

    1. Initial program 69.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 46.7%

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

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

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

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

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

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

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

    if -1e4 < (/.f64 t l) < 2.0000000000000001e-4

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-4 < (/.f64 t l)

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -10000:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\ \;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= (/ t l) -10000.0)
   (asin (/ (- l) (/ t (sqrt 0.5))))
   (if (<= (/ t l) 0.0002)
     (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) <= -10000.0) {
		tmp = asin((-l / (t / sqrt(0.5))));
	} else if ((t / l) <= 0.0002) {
		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) <= (-10000.0d0)) then
        tmp = asin((-l / (t / sqrt(0.5d0))))
    else if ((t / l) <= 0.0002d0) 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) <= -10000.0) {
		tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
	} else if ((t / l) <= 0.0002) {
		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) <= -10000.0:
		tmp = math.asin((-l / (t / math.sqrt(0.5))))
	elif (t / l) <= 0.0002:
		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) <= -10000.0)
		tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5))));
	elseif (Float64(t / l) <= 0.0002)
		tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0)));
	else
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t)));
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if ((t / l) <= -10000.0)
		tmp = asin((-l / (t / sqrt(0.5))));
	elseif ((t / l) <= 0.0002)
		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], -10000.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 69.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 46.7%

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

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

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

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

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

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

    if -1e4 < (/.f64 t l) < 2.0000000000000001e-4

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-4 < (/.f64 t l)

    1. Initial program 66.9%

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

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

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

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

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

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

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

Alternative 8: 96.9% accurate, 1.9× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 69.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 46.7%

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

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

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

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

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

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

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

    if -1e4 < (/.f64 t l) < 2.0000000000000001e-4

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-4 < (/.f64 t l)

    1. Initial program 66.9%

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

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

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

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

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

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\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) < -1e4

    1. Initial program 69.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 46.7%

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

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

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

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

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

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

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

    if -1e4 < (/.f64 t l) < 2.0000000000000001e-4

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-4 < (/.f64 t l)

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 62.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.1 \cdot 10^{-164}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-58} \lor \neg \left(\ell \leq 3.4 \cdot 10^{+101}\right) \land \ell \leq 5.6 \cdot 10^{+110}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= l -1.1e-164)
   (asin 1.0)
   (if (or (<= l 2.45e-58) (and (not (<= l 3.4e+101)) (<= l 5.6e+110)))
     (asin (* l (/ (sqrt 0.5) t)))
     (asin 1.0))))
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (l <= -1.1e-164) {
		tmp = asin(1.0);
	} else if ((l <= 2.45e-58) || (!(l <= 3.4e+101) && (l <= 5.6e+110))) {
		tmp = asin((l * (sqrt(0.5) / 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 <= (-1.1d-164)) then
        tmp = asin(1.0d0)
    else if ((l <= 2.45d-58) .or. (.not. (l <= 3.4d+101)) .and. (l <= 5.6d+110)) then
        tmp = asin((l * (sqrt(0.5d0) / 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 <= -1.1e-164) {
		tmp = Math.asin(1.0);
	} else if ((l <= 2.45e-58) || (!(l <= 3.4e+101) && (l <= 5.6e+110))) {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
	} else {
		tmp = Math.asin(1.0);
	}
	return tmp;
}
def code(t, l, Om, Omc):
	tmp = 0
	if l <= -1.1e-164:
		tmp = math.asin(1.0)
	elif (l <= 2.45e-58) or (not (l <= 3.4e+101) and (l <= 5.6e+110)):
		tmp = math.asin((l * (math.sqrt(0.5) / t)))
	else:
		tmp = math.asin(1.0)
	return tmp
function code(t, l, Om, Omc)
	tmp = 0.0
	if (l <= -1.1e-164)
		tmp = asin(1.0);
	elseif ((l <= 2.45e-58) || (!(l <= 3.4e+101) && (l <= 5.6e+110)))
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t)));
	else
		tmp = asin(1.0);
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if (l <= -1.1e-164)
		tmp = asin(1.0);
	elseif ((l <= 2.45e-58) || (~((l <= 3.4e+101)) && (l <= 5.6e+110)))
		tmp = asin((l * (sqrt(0.5) / t)));
	else
		tmp = asin(1.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.1e-164], N[ArcSin[1.0], $MachinePrecision], If[Or[LessEqual[l, 2.45e-58], And[N[Not[LessEqual[l, 3.4e+101]], $MachinePrecision], LessEqual[l, 5.6e+110]]], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-58} \lor \neg \left(\ell \leq 3.4 \cdot 10^{+101}\right) \land \ell \leq 5.6 \cdot 10^{+110}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.09999999999999994e-164 or 2.45000000000000015e-58 < l < 3.40000000000000017e101 or 5.59999999999999973e110 < l

    1. Initial program 88.4%

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

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

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

    if -1.09999999999999994e-164 < l < 2.45000000000000015e-58 or 3.40000000000000017e101 < l < 5.59999999999999973e110

    1. Initial program 74.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 41.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.1 \cdot 10^{-164}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-58} \lor \neg \left(\ell \leq 3.4 \cdot 10^{+101}\right) \land \ell \leq 5.6 \cdot 10^{+110}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]

Alternative 11: 62.5% accurate, 1.9× speedup?

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

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

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

\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;\sin^{-1} 1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -6.50000000000000004e-164 or 2.45000000000000015e-58 < l < 3.40000000000000017e101 or 5.59999999999999973e110 < l

    1. Initial program 88.4%

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

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

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

    if -6.50000000000000004e-164 < l < 2.45000000000000015e-58

    1. Initial program 72.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 44.1%

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

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

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

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

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

    if 3.40000000000000017e101 < l < 5.59999999999999973e110

    1. Initial program 99.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.5 \cdot 10^{-164}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-58}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+101}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+110}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]

Alternative 12: 62.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.4 \cdot 10^{-165}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-59}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+101}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+110}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (if (<= l -1.4e-165)
   (asin 1.0)
   (if (<= l 5.8e-59)
     (asin (* l (/ (sqrt 0.5) t)))
     (if (<= l 2.7e+101)
       (asin 1.0)
       (if (<= l 5.6e+110) (asin (/ (* l (sqrt 0.5)) t)) (asin 1.0))))))
double code(double t, double l, double Om, double Omc) {
	double tmp;
	if (l <= -1.4e-165) {
		tmp = asin(1.0);
	} else if (l <= 5.8e-59) {
		tmp = asin((l * (sqrt(0.5) / t)));
	} else if (l <= 2.7e+101) {
		tmp = asin(1.0);
	} else if (l <= 5.6e+110) {
		tmp = asin(((l * sqrt(0.5)) / 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 <= (-1.4d-165)) then
        tmp = asin(1.0d0)
    else if (l <= 5.8d-59) then
        tmp = asin((l * (sqrt(0.5d0) / t)))
    else if (l <= 2.7d+101) then
        tmp = asin(1.0d0)
    else if (l <= 5.6d+110) then
        tmp = asin(((l * sqrt(0.5d0)) / 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 <= -1.4e-165) {
		tmp = Math.asin(1.0);
	} else if (l <= 5.8e-59) {
		tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
	} else if (l <= 2.7e+101) {
		tmp = Math.asin(1.0);
	} else if (l <= 5.6e+110) {
		tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
	} else {
		tmp = Math.asin(1.0);
	}
	return tmp;
}
def code(t, l, Om, Omc):
	tmp = 0
	if l <= -1.4e-165:
		tmp = math.asin(1.0)
	elif l <= 5.8e-59:
		tmp = math.asin((l * (math.sqrt(0.5) / t)))
	elif l <= 2.7e+101:
		tmp = math.asin(1.0)
	elif l <= 5.6e+110:
		tmp = math.asin(((l * math.sqrt(0.5)) / t))
	else:
		tmp = math.asin(1.0)
	return tmp
function code(t, l, Om, Omc)
	tmp = 0.0
	if (l <= -1.4e-165)
		tmp = asin(1.0);
	elseif (l <= 5.8e-59)
		tmp = asin(Float64(l * Float64(sqrt(0.5) / t)));
	elseif (l <= 2.7e+101)
		tmp = asin(1.0);
	elseif (l <= 5.6e+110)
		tmp = asin(Float64(Float64(l * sqrt(0.5)) / t));
	else
		tmp = asin(1.0);
	end
	return tmp
end
function tmp_2 = code(t, l, Om, Omc)
	tmp = 0.0;
	if (l <= -1.4e-165)
		tmp = asin(1.0);
	elseif (l <= 5.8e-59)
		tmp = asin((l * (sqrt(0.5) / t)));
	elseif (l <= 2.7e+101)
		tmp = asin(1.0);
	elseif (l <= 5.6e+110)
		tmp = asin(((l * sqrt(0.5)) / t));
	else
		tmp = asin(1.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.4e-165], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 5.8e-59], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.7e+101], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 5.6e+110], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+101}:\\
\;\;\;\;\sin^{-1} 1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.4e-165 or 5.80000000000000033e-59 < l < 2.70000000000000006e101 or 5.59999999999999973e110 < l

    1. Initial program 88.4%

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

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

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

    if -1.4e-165 < l < 5.80000000000000033e-59

    1. Initial program 72.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 44.1%

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

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

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

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

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

    if 2.70000000000000006e101 < l < 5.59999999999999973e110

    1. Initial program 99.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.4 \cdot 10^{-165}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-59}:\\ \;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\ \mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+101}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+110}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]

Alternative 13: 49.7% 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.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 63.5%

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

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

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

Reproduce

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