Toniolo and Linder, Equation (2)

Percentage Accurate: 84.3% → 97.0%
Time: 18.8s
Alternatives: 10
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 10 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.3% 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: 97.0% accurate, 1.9× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\frac{t_m}{\ell} \leq -500:\\ \;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_m \cdot \sqrt{2}}\right)\\ \mathbf{elif}\;\frac{t_m}{\ell} \leq 0.1:\\ \;\;\;\;\sin^{-1} \left(\mathsf{fma}\left(-0.5, \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}, 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t_m}{\sqrt{0.5}}}\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (if (<= (/ t_m l) -500.0)
   (asin (/ (- l) (* t_m (sqrt 2.0))))
   (if (<= (/ t_m l) 0.1)
     (asin (fma -0.5 (/ (/ Om Omc) (/ Omc Om)) 1.0))
     (asin (/ l (/ t_m (sqrt 0.5)))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if ((t_m / l) <= -500.0) {
		tmp = asin((-l / (t_m * sqrt(2.0))));
	} else if ((t_m / l) <= 0.1) {
		tmp = asin(fma(-0.5, ((Om / Omc) / (Omc / Om)), 1.0));
	} else {
		tmp = asin((l / (t_m / sqrt(0.5))));
	}
	return tmp;
}
t_m = abs(t)
function code(t_m, l, Om, Omc)
	tmp = 0.0
	if (Float64(t_m / l) <= -500.0)
		tmp = asin(Float64(Float64(-l) / Float64(t_m * sqrt(2.0))));
	elseif (Float64(t_m / l) <= 0.1)
		tmp = asin(fma(-0.5, Float64(Float64(Om / Omc) / Float64(Omc / Om)), 1.0));
	else
		tmp = asin(Float64(l / Float64(t_m / sqrt(0.5))));
	end
	return tmp
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -500.0], N[ArcSin[N[((-l) / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.1], N[ArcSin[N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t$95$m / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|

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

\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.1:\\
\;\;\;\;\sin^{-1} \left(\mathsf{fma}\left(-0.5, \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}, 1\right)\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 2: 98.4% accurate, 0.8× speedup?

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

\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t_m}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 3: 97.3% accurate, 1.3× speedup?

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

\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, t_m \cdot \frac{\sqrt{2}}{\ell}\right)}\right)
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 4: 97.2% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 5: 72.9% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t_m}\right)\\

\mathbf{elif}\;\ell \leq 3.3 \cdot 10^{-80}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t_m}{\sqrt{0.5}}}\right)\\

\mathbf{elif}\;\ell \leq 8.6 \cdot 10^{-34}:\\
\;\;\;\;\sin^{-1} 1\\

\mathbf{elif}\;\ell \leq 85000000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 6: 96.9% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 7: 96.9% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 8: 63.9% accurate, 1.9× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\ell \leq -7.5 \cdot 10^{-178}:\\ \;\;\;\;\sin^{-1} 1\\ \mathbf{elif}\;\ell \leq 3.4 \cdot 10^{-83} \lor \neg \left(\ell \leq 7 \cdot 10^{-32}\right) \land \ell \leq 85000000000000:\\ \;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} 1\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
 :precision binary64
 (if (<= l -7.5e-178)
   (asin 1.0)
   (if (or (<= l 3.4e-83) (and (not (<= l 7e-32)) (<= l 85000000000000.0)))
     (asin (/ l (* t_m (sqrt 2.0))))
     (asin 1.0))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if (l <= -7.5e-178) {
		tmp = asin(1.0);
	} else if ((l <= 3.4e-83) || (!(l <= 7e-32) && (l <= 85000000000000.0))) {
		tmp = asin((l / (t_m * sqrt(2.0))));
	} else {
		tmp = asin(1.0);
	}
	return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: omc
    real(8) :: tmp
    if (l <= (-7.5d-178)) then
        tmp = asin(1.0d0)
    else if ((l <= 3.4d-83) .or. (.not. (l <= 7d-32)) .and. (l <= 85000000000000.0d0)) then
        tmp = asin((l / (t_m * sqrt(2.0d0))))
    else
        tmp = asin(1.0d0)
    end if
    code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
	double tmp;
	if (l <= -7.5e-178) {
		tmp = Math.asin(1.0);
	} else if ((l <= 3.4e-83) || (!(l <= 7e-32) && (l <= 85000000000000.0))) {
		tmp = Math.asin((l / (t_m * Math.sqrt(2.0))));
	} else {
		tmp = Math.asin(1.0);
	}
	return tmp;
}
t_m = math.fabs(t)
def code(t_m, l, Om, Omc):
	tmp = 0
	if l <= -7.5e-178:
		tmp = math.asin(1.0)
	elif (l <= 3.4e-83) or (not (l <= 7e-32) and (l <= 85000000000000.0)):
		tmp = math.asin((l / (t_m * math.sqrt(2.0))))
	else:
		tmp = math.asin(1.0)
	return tmp
t_m = abs(t)
function code(t_m, l, Om, Omc)
	tmp = 0.0
	if (l <= -7.5e-178)
		tmp = asin(1.0);
	elseif ((l <= 3.4e-83) || (!(l <= 7e-32) && (l <= 85000000000000.0)))
		tmp = asin(Float64(l / Float64(t_m * sqrt(2.0))));
	else
		tmp = asin(1.0);
	end
	return tmp
end
t_m = abs(t);
function tmp_2 = code(t_m, l, Om, Omc)
	tmp = 0.0;
	if (l <= -7.5e-178)
		tmp = asin(1.0);
	elseif ((l <= 3.4e-83) || (~((l <= 7e-32)) && (l <= 85000000000000.0)))
		tmp = asin((l / (t_m * sqrt(2.0))));
	else
		tmp = asin(1.0);
	end
	tmp_2 = tmp;
end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[l, -7.5e-178], N[ArcSin[1.0], $MachinePrecision], If[Or[LessEqual[l, 3.4e-83], And[N[Not[LessEqual[l, 7e-32]], $MachinePrecision], LessEqual[l, 85000000000000.0]]], N[ArcSin[N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|

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

\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{-83} \lor \neg \left(\ell \leq 7 \cdot 10^{-32}\right) \land \ell \leq 85000000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 9: 63.9% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-80}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t_m}{\sqrt{0.5}}}\right)\\

\mathbf{elif}\;\ell \leq 2.8 \cdot 10^{-34}:\\
\;\;\;\;\sin^{-1} 1\\

\mathbf{elif}\;\ell \leq 1900000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 10: 50.1% accurate, 4.1× speedup?

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

\\
\sin^{-1} 1
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Reproduce

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