Toniolo and Linder, Equation (2)

Percentage Accurate: 84.1% → 98.4%
Time: 17.4s
Alternatives: 11
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 84.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 \cdot \sqrt{2}}{\ell}\right)}\right) \end{array} \]
(FPCore (t l Om Omc)
 :precision binary64
 (asin
  (/
   (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))
   (hypot 1.0 (/ (* t (sqrt 2.0)) l)))))
double code(double t, double l, double Om, double Omc) {
	return asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
def code(t, l, Om, Omc):
	return math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
function code(t, l, Om, Omc)
	return asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l))))
end
function tmp = code(t, l, Om, Omc)
	tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t * sqrt(2.0)) / l))));
end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \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. 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. reciprocal-define73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \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(Float64(t * 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[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \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. 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. reciprocal-define73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.8% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+131}:\\
\;\;\;\;\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{\ell}{t_1}\right)\\


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

    1. Initial program 50.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000001e155 < (/.f64 t l) < 1.9999999999999998e131

    1. Initial program 98.7%

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

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

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

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

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

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

    if 1.9999999999999998e131 < (/.f64 t l)

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+155}:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\ \mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+131}:\\ \;\;\;\;\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{\ell}{t \cdot \sqrt{2}}\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{1}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\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 (/ 1.0 (/ t (/ l (sqrt 2.0))))))))
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((1.0 / (t / (l / sqrt(2.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) <= (-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((1.0d0 / (t / (l / sqrt(2.0d0)))))
    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((1.0 / (t / (l / Math.sqrt(2.0)))));
	}
	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((1.0 / (t / (l / math.sqrt(2.0)))))
	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(1.0 / Float64(t / Float64(l / sqrt(2.0)))));
	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((1.0 / (t / (l / sqrt(2.0)))));
	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[(1.0 / N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $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{1}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\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. reciprocal-define36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \left(\frac{\color{blue}{-\ell}}{t \cdot \sqrt{2}}\right) \]
    8. 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 \cdot \sqrt{2}}{\ell}\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 \cdot \sqrt{2}}{\ell}\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 \cdot \sqrt{2}}{\ell}\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. Step-by-step derivation
      1. sqrt-div74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{1}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 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{1}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\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 (/ 1.0 (/ t (/ l (sqrt 2.0))))))))
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((1.0 / (t / (l / sqrt(2.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) <= (-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((1.0d0 / (t / (l / sqrt(2.0d0)))))
    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((1.0 / (t / (l / Math.sqrt(2.0)))));
	}
	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((1.0 / (t / (l / math.sqrt(2.0)))))
	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(1.0 / Float64(t / Float64(l / sqrt(2.0)))));
	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((1.0 / (t / (l / sqrt(2.0)))));
	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[(1.0 / N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $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{1}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\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. reciprocal-define36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \color{blue}{\left(1 - {\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. Step-by-step derivation
      1. sqrt-div74.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin^{-1} \left(\frac{1}{\color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}}}\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(\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{1}{\frac{t}{\frac{\ell}{\sqrt{2}}}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 63.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{\sqrt{0.5}}\\
\mathbf{if}\;\ell \leq -7 \cdot 10^{-35}:\\
\;\;\;\;\sin^{-1} 1\\

\mathbf{elif}\;\ell \leq -3.2 \cdot 10^{-308}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\

\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{-44}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -6.99999999999999992e-35 or 8.5000000000000002e-44 < l

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

    if -6.99999999999999992e-35 < l < -3.2000000000000001e-308

    1. Initial program 80.0%

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

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

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

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

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

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

    if -3.2000000000000001e-308 < l < 8.5000000000000002e-44

    1. Initial program 72.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -7 \cdot 10^{-35}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq -3.2 \cdot 10^{-308}:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{elif}\;\ell \leq 8.5 \cdot 10^{-44}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 96.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\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{\ell}{t \cdot \sqrt{2}}\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) \]
    6. Simplified98.8%

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

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

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

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

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

        \[\leadsto \sin^{-1} \color{blue}{\left(1 - {\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. Step-by-step derivation
      1. sqrt-div50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\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{\ell}{t \cdot \sqrt{2}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 96.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\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{\ell}{t_1}\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. reciprocal-define36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin^{-1} \color{blue}{\left(1 - {\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. Step-by-step derivation
      1. sqrt-div50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{\ell}{t \cdot \sqrt{2}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 57.1% accurate, 2.0× speedup?

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

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

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


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

    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.7999999999999999e105 < 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. Step-by-step derivation
      1. sqrt-div52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 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)))))))