Toniolo and Linder, Equation (2)

Percentage Accurate: 84.1% → 98.4%
Time: 17.5s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 84.1% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{t}{\ell}}{\frac{1}{\color{blue}{{2}^{0.5}}}}\right)}\right) \]
    6. pow-flip97.9%

      \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{t}{\ell}}{\color{blue}{{2}^{\left(-0.5\right)}}}\right)}\right) \]
    7. metadata-eval97.9%

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

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

    \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{t}{\ell}}{{2}^{-0.5}}\right)}\right) \]
  11. Add Preprocessing

Alternative 3: 97.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.7% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.9999999999999998e141 < (/.f64 t l) < 1.00000000000000001e43

    1. Initial program 98.6%

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

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

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

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

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

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

    if 1.00000000000000001e43 < (/.f64 t l)

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.7% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\

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


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

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e10 < (/.f64 t l) < 0.20000000000000001

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

    if 0.20000000000000001 < (/.f64 t l)

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 96.4% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e10 < (/.f64 t l) < 0.20000000000000001

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{t}{\ell}}{\frac{1}{\color{blue}{{2}^{0.5}}}}\right)}\right) \]
      6. pow-flip97.9%

        \[\leadsto \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{t}{\ell}}{\color{blue}{{2}^{\left(-0.5\right)}}}\right)}\right) \]
      7. metadata-eval97.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\frac{1}{1 + \frac{1 \cdot \color{blue}{\left(t \cdot t\right)}}{\ell \cdot \ell}}\right) \]
      9. associate-*l*89.8%

        \[\leadsto \sin^{-1} \left(\frac{1}{1 + \frac{\color{blue}{\left(1 \cdot t\right) \cdot t}}{\ell \cdot \ell}}\right) \]
      10. *-lft-identity89.8%

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

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

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

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

    if 0.20000000000000001 < (/.f64 t l)

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.3% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 72.6%

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
    5. 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.8%

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
    8. 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-*r/98.8%

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

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

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

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

    if -5e10 < (/.f64 t l) < 0.20000000000000001

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

    if 0.20000000000000001 < (/.f64 t l)

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 96.3% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e10 < (/.f64 t l) < 0.20000000000000001

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

    if 0.20000000000000001 < (/.f64 t l)

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.4% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 t l) < -4.9999999999999995e211 or 0.20000000000000001 < (/.f64 t l)

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

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

    if -4.9999999999999995e211 < (/.f64 t l) < 0.20000000000000001

    1. Initial program 95.3%

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+211} \lor \neg \left(\frac{t}{\ell} \leq 0.2\right):\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 96.1% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 72.6%

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
    5. 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.8%

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

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

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

      \[\leadsto \sin^{-1} \color{blue}{\left(-1 \cdot \frac{\ell \cdot \sqrt{0.5}}{t}\right)} \]
    8. 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-*r/98.8%

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

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

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

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

    if -5e10 < (/.f64 t l) < 0.20000000000000001

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

    if 0.20000000000000001 < (/.f64 t l)

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 57.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.62 \cdot 10^{+106}:\\
\;\;\;\;\sin^{-1} 1\\

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


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

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

    if 1.62e106 < t

    1. Initial program 82.3%

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

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

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

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

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

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

Alternative 12: 50.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 86.5%

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

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

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

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

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

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

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

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

    \[\leadsto \sin^{-1} 1 \]
  8. Add Preprocessing

Reproduce

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