
(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:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 82.9%
sqrt-div82.9%
div-inv82.9%
add-sqr-sqrt82.9%
hypot-1-def82.9%
*-commutative82.9%
sqrt-prod82.8%
unpow282.8%
sqrt-prod51.9%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
unpow297.9%
times-frac82.5%
unpow282.5%
unpow282.5%
associate-*r/82.5%
*-rgt-identity82.5%
unpow282.5%
unpow282.5%
times-frac97.9%
unpow297.9%
Simplified97.9%
Final simplification97.9%
(FPCore (t l Om Omc) :precision binary64 (expm1 (log1p (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))))
double code(double t, double l, double Om, double Omc) {
return expm1(log1p(asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.expm1(Math.log1p(Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))))));
}
def code(t, l, Om, Omc): return math.expm1(math.log1p(math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))))
function code(t, l, Om, Omc) return expm1(log1p(asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))))) end
code[t_, l_, Om_, Omc_] := N[(Exp[N[Log[1 + N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)\right)\right)
\end{array}
Initial program 82.9%
Taylor expanded in Om around 0 66.4%
unpow266.4%
unpow266.4%
Simplified66.4%
sqrt-div66.4%
metadata-eval66.4%
+-commutative66.4%
times-frac81.8%
unpow281.8%
fma-udef81.8%
Applied egg-rr81.8%
fma-udef81.8%
*-commutative81.8%
unpow281.8%
rem-square-sqrt81.7%
swap-sqr81.7%
unpow281.7%
+-commutative81.7%
unpow281.7%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
expm1-log1p-u96.8%
Applied egg-rr96.8%
Final simplification96.8%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -20000.0)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= (/ t l) 2e-6)
(asin (sqrt (- 1.0 (pow (/ Om Omc) 2.0))))
(asin (/ (* l (sqrt 0.5)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -20000.0) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if ((t / l) <= 2e-6) {
tmp = asin(sqrt((1.0 - pow((Om / Omc), 2.0))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-20000.0d0)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if ((t / l) <= 2d-6) then
tmp = asin(sqrt((1.0d0 - ((om / omc) ** 2.0d0))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -20000.0) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 2e-6) {
tmp = Math.asin(Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -20000.0: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif (t / l) <= 2e-6: tmp = math.asin(math.sqrt((1.0 - math.pow((Om / Omc), 2.0)))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -20000.0) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (Float64(t / l) <= 2e-6) tmp = asin(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -20000.0) tmp = asin(((-l / t) / sqrt(2.0))); elseif ((t / l) <= 2e-6) tmp = asin(sqrt((1.0 - ((Om / Omc) ^ 2.0)))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -20000.0], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-6], N[ArcSin[N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -20000:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e4Initial program 67.3%
Taylor expanded in Om around 0 43.6%
unpow243.6%
unpow243.6%
Simplified43.6%
sqrt-div43.6%
metadata-eval43.6%
+-commutative43.6%
times-frac67.3%
unpow267.3%
fma-udef67.3%
Applied egg-rr67.3%
fma-udef67.3%
*-commutative67.3%
unpow267.3%
rem-square-sqrt67.2%
swap-sqr67.3%
unpow267.3%
+-commutative67.3%
unpow267.3%
hypot-1-def98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around -inf 98.6%
mul-1-neg98.6%
distribute-neg-frac98.6%
associate-/r*98.7%
Simplified98.7%
if -2e4 < (/.f64 t l) < 1.99999999999999991e-6Initial program 97.6%
Taylor expanded in t around 0 78.3%
unpow278.3%
unpow278.3%
times-frac96.6%
unpow296.6%
Simplified96.6%
if 1.99999999999999991e-6 < (/.f64 t l) Initial program 65.1%
Taylor expanded in Om around 0 42.2%
unpow242.2%
unpow242.2%
Simplified42.2%
Taylor expanded in t around inf 97.3%
Final simplification97.3%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 82.9%
Taylor expanded in Om around 0 66.4%
unpow266.4%
unpow266.4%
Simplified66.4%
sqrt-div66.4%
metadata-eval66.4%
+-commutative66.4%
times-frac81.8%
unpow281.8%
fma-udef81.8%
Applied egg-rr81.8%
fma-udef81.8%
*-commutative81.8%
unpow281.8%
rem-square-sqrt81.7%
swap-sqr81.7%
unpow281.7%
+-commutative81.7%
unpow281.7%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
Final simplification96.8%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+33)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= (/ t l) 10000000000.0)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+33) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if ((t / l) <= 10000000000.0) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-1d+33)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if ((t / l) <= 10000000000.0d0) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+33) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 10000000000.0) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+33: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif (t / l) <= 10000000000.0: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+33) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (Float64(t / l) <= 10000000000.0) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+33) tmp = asin(((-l / t) / sqrt(2.0))); elseif ((t / l) <= 10000000000.0) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1e+33], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 10000000000.0], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+33}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10000000000:\\
\;\;\;\;\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 \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.9999999999999995e32Initial program 65.4%
Taylor expanded in Om around 0 43.2%
unpow243.2%
unpow243.2%
Simplified43.2%
sqrt-div43.3%
metadata-eval43.3%
+-commutative43.3%
times-frac65.4%
unpow265.4%
fma-udef65.4%
Applied egg-rr65.4%
fma-udef65.4%
*-commutative65.4%
unpow265.4%
rem-square-sqrt65.2%
swap-sqr65.4%
unpow265.4%
+-commutative65.4%
unpow265.4%
hypot-1-def98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in t around -inf 99.4%
mul-1-neg99.4%
distribute-neg-frac99.4%
associate-/r*99.5%
Simplified99.5%
if -9.9999999999999995e32 < (/.f64 t l) < 1e10Initial program 97.5%
Taylor expanded in Om around 0 85.8%
unpow285.8%
unpow285.8%
Simplified85.8%
times-frac95.5%
Applied egg-rr95.5%
if 1e10 < (/.f64 t l) Initial program 64.1%
Taylor expanded in Om around 0 41.8%
unpow241.8%
unpow241.8%
Simplified41.8%
Taylor expanded in t around inf 99.5%
Final simplification97.3%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (/ (- l) (* t (sqrt 2.0)))))
(t_2 (asin (/ 1.0 (+ 1.0 (* t (/ t (* l l))))))))
(if (<= l -8.5e+39)
t_2
(if (<= l -30000000000000.0)
t_1
(if (<= l -2.5e-146)
t_2
(if (<= l -1e-310)
t_1
(if (<= l 7e+43) (asin (/ (* l (sqrt 0.5)) t)) t_2)))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = asin((-l / (t * sqrt(2.0))));
double t_2 = asin((1.0 / (1.0 + (t * (t / (l * l))))));
double tmp;
if (l <= -8.5e+39) {
tmp = t_2;
} else if (l <= -30000000000000.0) {
tmp = t_1;
} else if (l <= -2.5e-146) {
tmp = t_2;
} else if (l <= -1e-310) {
tmp = t_1;
} else if (l <= 7e+43) {
tmp = asin(((l * sqrt(0.5)) / t));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = asin((-l / (t * sqrt(2.0d0))))
t_2 = asin((1.0d0 / (1.0d0 + (t * (t / (l * l))))))
if (l <= (-8.5d+39)) then
tmp = t_2
else if (l <= (-30000000000000.0d0)) then
tmp = t_1
else if (l <= (-2.5d-146)) then
tmp = t_2
else if (l <= (-1d-310)) then
tmp = t_1
else if (l <= 7d+43) then
tmp = asin(((l * sqrt(0.5d0)) / t))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin((-l / (t * Math.sqrt(2.0))));
double t_2 = Math.asin((1.0 / (1.0 + (t * (t / (l * l))))));
double tmp;
if (l <= -8.5e+39) {
tmp = t_2;
} else if (l <= -30000000000000.0) {
tmp = t_1;
} else if (l <= -2.5e-146) {
tmp = t_2;
} else if (l <= -1e-310) {
tmp = t_1;
} else if (l <= 7e+43) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = t_2;
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.asin((-l / (t * math.sqrt(2.0)))) t_2 = math.asin((1.0 / (1.0 + (t * (t / (l * l)))))) tmp = 0 if l <= -8.5e+39: tmp = t_2 elif l <= -30000000000000.0: tmp = t_1 elif l <= -2.5e-146: tmp = t_2 elif l <= -1e-310: tmp = t_1 elif l <= 7e+43: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = t_2 return tmp
function code(t, l, Om, Omc) t_1 = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))) t_2 = asin(Float64(1.0 / Float64(1.0 + Float64(t * Float64(t / Float64(l * l)))))) tmp = 0.0 if (l <= -8.5e+39) tmp = t_2; elseif (l <= -30000000000000.0) tmp = t_1; elseif (l <= -2.5e-146) tmp = t_2; elseif (l <= -1e-310) tmp = t_1; elseif (l <= 7e+43) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = t_2; end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = asin((-l / (t * sqrt(2.0)))); t_2 = asin((1.0 / (1.0 + (t * (t / (l * l)))))); tmp = 0.0; if (l <= -8.5e+39) tmp = t_2; elseif (l <= -30000000000000.0) tmp = t_1; elseif (l <= -2.5e-146) tmp = t_2; elseif (l <= -1e-310) tmp = t_1; elseif (l <= 7e+43) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = t_2; end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[ArcSin[N[(1.0 / N[(1.0 + N[(t * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -8.5e+39], t$95$2, If[LessEqual[l, -30000000000000.0], t$95$1, If[LessEqual[l, -2.5e-146], t$95$2, If[LessEqual[l, -1e-310], t$95$1, If[LessEqual[l, 7e+43], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
t_2 := \sin^{-1} \left(\frac{1}{1 + t \cdot \frac{t}{\ell \cdot \ell}}\right)\\
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{+39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -30000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -2.5 \cdot 10^{-146}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+43}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if l < -8.49999999999999971e39 or -3e13 < l < -2.49999999999999979e-146 or 7.0000000000000002e43 < l Initial program 93.4%
Taylor expanded in Om around 0 79.4%
unpow279.4%
unpow279.4%
Simplified79.4%
sqrt-div79.4%
metadata-eval79.4%
+-commutative79.4%
times-frac91.7%
unpow291.7%
fma-udef91.7%
Applied egg-rr91.7%
fma-udef91.7%
*-commutative91.7%
unpow291.7%
rem-square-sqrt91.6%
swap-sqr91.7%
unpow291.7%
+-commutative91.7%
unpow291.7%
hypot-1-def96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in t around 0 74.4%
associate-*r/74.4%
*-commutative74.4%
unpow274.4%
rem-square-sqrt74.4%
associate-*r*74.4%
metadata-eval74.4%
*-lft-identity74.4%
unpow274.4%
associate-*r/77.3%
unpow277.3%
Simplified77.3%
if -8.49999999999999971e39 < l < -3e13 or -2.49999999999999979e-146 < l < -9.999999999999969e-311Initial program 71.6%
Taylor expanded in Om around 0 40.0%
unpow240.0%
unpow240.0%
Simplified40.0%
sqrt-div40.0%
metadata-eval40.0%
+-commutative40.0%
times-frac71.5%
unpow271.5%
fma-udef71.5%
Applied egg-rr71.5%
fma-udef71.5%
*-commutative71.5%
unpow271.5%
rem-square-sqrt71.4%
swap-sqr71.4%
unpow271.4%
+-commutative71.4%
unpow271.4%
hypot-1-def96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in t around -inf 55.8%
mul-1-neg55.8%
Simplified55.8%
if -9.999999999999969e-311 < l < 7.0000000000000002e43Initial program 66.9%
Taylor expanded in Om around 0 52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
Taylor expanded in t around inf 40.9%
Final simplification64.0%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (/ 1.0 (+ 1.0 (* t (/ t (* l l))))))))
(if (<= l -9.5e+39)
t_1
(if (<= l -1150000000.0)
(asin (* (/ (- l) t) (sqrt 0.5)))
(if (<= l -1.02e-146)
t_1
(if (<= l -1e-310)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= l 9.5e+44) (asin (/ (* l (sqrt 0.5)) t)) t_1)))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = asin((1.0 / (1.0 + (t * (t / (l * l))))));
double tmp;
if (l <= -9.5e+39) {
tmp = t_1;
} else if (l <= -1150000000.0) {
tmp = asin(((-l / t) * sqrt(0.5)));
} else if (l <= -1.02e-146) {
tmp = t_1;
} else if (l <= -1e-310) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if (l <= 9.5e+44) {
tmp = asin(((l * sqrt(0.5)) / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = asin((1.0d0 / (1.0d0 + (t * (t / (l * l))))))
if (l <= (-9.5d+39)) then
tmp = t_1
else if (l <= (-1150000000.0d0)) then
tmp = asin(((-l / t) * sqrt(0.5d0)))
else if (l <= (-1.02d-146)) then
tmp = t_1
else if (l <= (-1d-310)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if (l <= 9.5d+44) then
tmp = asin(((l * sqrt(0.5d0)) / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin((1.0 / (1.0 + (t * (t / (l * l))))));
double tmp;
if (l <= -9.5e+39) {
tmp = t_1;
} else if (l <= -1150000000.0) {
tmp = Math.asin(((-l / t) * Math.sqrt(0.5)));
} else if (l <= -1.02e-146) {
tmp = t_1;
} else if (l <= -1e-310) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if (l <= 9.5e+44) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.asin((1.0 / (1.0 + (t * (t / (l * l)))))) tmp = 0 if l <= -9.5e+39: tmp = t_1 elif l <= -1150000000.0: tmp = math.asin(((-l / t) * math.sqrt(0.5))) elif l <= -1.02e-146: tmp = t_1 elif l <= -1e-310: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif l <= 9.5e+44: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = t_1 return tmp
function code(t, l, Om, Omc) t_1 = asin(Float64(1.0 / Float64(1.0 + Float64(t * Float64(t / Float64(l * l)))))) tmp = 0.0 if (l <= -9.5e+39) tmp = t_1; elseif (l <= -1150000000.0) tmp = asin(Float64(Float64(Float64(-l) / t) * sqrt(0.5))); elseif (l <= -1.02e-146) tmp = t_1; elseif (l <= -1e-310) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (l <= 9.5e+44) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = asin((1.0 / (1.0 + (t * (t / (l * l)))))); tmp = 0.0; if (l <= -9.5e+39) tmp = t_1; elseif (l <= -1150000000.0) tmp = asin(((-l / t) * sqrt(0.5))); elseif (l <= -1.02e-146) tmp = t_1; elseif (l <= -1e-310) tmp = asin((-l / (t * sqrt(2.0)))); elseif (l <= 9.5e+44) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[(1.0 / N[(1.0 + N[(t * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -9.5e+39], t$95$1, If[LessEqual[l, -1150000000.0], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -1.02e-146], t$95$1, If[LessEqual[l, -1e-310], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 9.5e+44], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\frac{1}{1 + t \cdot \frac{t}{\ell \cdot \ell}}\right)\\
\mathbf{if}\;\ell \leq -9.5 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -1150000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{elif}\;\ell \leq -1.02 \cdot 10^{-146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+44}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -9.50000000000000011e39 or -1.15e9 < l < -1.0199999999999999e-146 or 9.5000000000000004e44 < l Initial program 93.4%
Taylor expanded in Om around 0 79.4%
unpow279.4%
unpow279.4%
Simplified79.4%
sqrt-div79.4%
metadata-eval79.4%
+-commutative79.4%
times-frac91.7%
unpow291.7%
fma-udef91.7%
Applied egg-rr91.7%
fma-udef91.7%
*-commutative91.7%
unpow291.7%
rem-square-sqrt91.6%
swap-sqr91.7%
unpow291.7%
+-commutative91.7%
unpow291.7%
hypot-1-def96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in t around 0 74.4%
associate-*r/74.4%
*-commutative74.4%
unpow274.4%
rem-square-sqrt74.4%
associate-*r*74.4%
metadata-eval74.4%
*-lft-identity74.4%
unpow274.4%
associate-*r/77.3%
unpow277.3%
Simplified77.3%
if -9.50000000000000011e39 < l < -1.15e9Initial program 46.6%
Taylor expanded in Om around 0 32.9%
unpow232.9%
unpow232.9%
Simplified32.9%
Taylor expanded in t around -inf 44.7%
mul-1-neg44.7%
associate-/l*44.7%
associate-/r/44.5%
distribute-rgt-neg-in44.5%
Simplified44.5%
if -1.0199999999999999e-146 < l < -9.999999999999969e-311Initial program 77.6%
Taylor expanded in Om around 0 41.8%
unpow241.8%
unpow241.8%
Simplified41.8%
sqrt-div41.8%
metadata-eval41.8%
+-commutative41.8%
times-frac77.5%
unpow277.5%
fma-udef77.5%
Applied egg-rr77.5%
fma-udef77.5%
*-commutative77.5%
unpow277.5%
rem-square-sqrt77.4%
swap-sqr77.4%
unpow277.4%
+-commutative77.4%
unpow277.4%
hypot-1-def96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around -inf 58.4%
mul-1-neg58.4%
Simplified58.4%
if -9.999999999999969e-311 < l < 9.5000000000000004e44Initial program 66.9%
Taylor expanded in Om around 0 52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
Taylor expanded in t around inf 40.9%
Final simplification64.0%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -20000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 2e-6)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (* l (sqrt 0.5)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -20000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 2e-6) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-20000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 2d-6) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -20000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 2e-6) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -20000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 2e-6: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -20000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 2e-6) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -20000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 2e-6) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -20000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-6], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -20000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e4Initial program 67.3%
Taylor expanded in Om around 0 43.6%
unpow243.6%
unpow243.6%
Simplified43.6%
sqrt-div43.6%
metadata-eval43.6%
+-commutative43.6%
times-frac67.3%
unpow267.3%
fma-udef67.3%
Applied egg-rr67.3%
fma-udef67.3%
*-commutative67.3%
unpow267.3%
rem-square-sqrt67.2%
swap-sqr67.3%
unpow267.3%
+-commutative67.3%
unpow267.3%
hypot-1-def98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around -inf 98.6%
mul-1-neg98.6%
Simplified98.6%
if -2e4 < (/.f64 t l) < 1.99999999999999991e-6Initial program 97.6%
Taylor expanded in Om around 0 87.4%
unpow287.4%
unpow287.4%
Simplified87.4%
Taylor expanded in t around 0 87.4%
mul-1-neg87.4%
unpow287.4%
unpow287.4%
times-frac94.8%
unpow294.8%
unsub-neg94.8%
Simplified94.8%
if 1.99999999999999991e-6 < (/.f64 t l) Initial program 65.1%
Taylor expanded in Om around 0 42.2%
unpow242.2%
unpow242.2%
Simplified42.2%
Taylor expanded in t around inf 97.3%
Final simplification96.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -20000.0)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= (/ t l) 2e-6)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (* l (sqrt 0.5)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -20000.0) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if ((t / l) <= 2e-6) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-20000.0d0)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if ((t / l) <= 2d-6) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -20000.0) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 2e-6) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -20000.0: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif (t / l) <= 2e-6: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -20000.0) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (Float64(t / l) <= 2e-6) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -20000.0) tmp = asin(((-l / t) / sqrt(2.0))); elseif ((t / l) <= 2e-6) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -20000.0], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-6], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -20000:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e4Initial program 67.3%
Taylor expanded in Om around 0 43.6%
unpow243.6%
unpow243.6%
Simplified43.6%
sqrt-div43.6%
metadata-eval43.6%
+-commutative43.6%
times-frac67.3%
unpow267.3%
fma-udef67.3%
Applied egg-rr67.3%
fma-udef67.3%
*-commutative67.3%
unpow267.3%
rem-square-sqrt67.2%
swap-sqr67.3%
unpow267.3%
+-commutative67.3%
unpow267.3%
hypot-1-def98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around -inf 98.6%
mul-1-neg98.6%
distribute-neg-frac98.6%
associate-/r*98.7%
Simplified98.7%
if -2e4 < (/.f64 t l) < 1.99999999999999991e-6Initial program 97.6%
Taylor expanded in Om around 0 87.4%
unpow287.4%
unpow287.4%
Simplified87.4%
Taylor expanded in t around 0 87.4%
mul-1-neg87.4%
unpow287.4%
unpow287.4%
times-frac94.8%
unpow294.8%
unsub-neg94.8%
Simplified94.8%
if 1.99999999999999991e-6 < (/.f64 t l) Initial program 65.1%
Taylor expanded in Om around 0 42.2%
unpow242.2%
unpow242.2%
Simplified42.2%
Taylor expanded in t around inf 97.3%
Final simplification96.4%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l -1e-310) (not (<= l 1.65e+46))) (asin (/ 1.0 (+ 1.0 (* t (/ t (* l l)))))) (asin (* (sqrt 0.5) (/ l t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -1e-310) || !(l <= 1.65e+46)) {
tmp = asin((1.0 / (1.0 + (t * (t / (l * l))))));
} else {
tmp = asin((sqrt(0.5) * (l / t)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((l <= (-1d-310)) .or. (.not. (l <= 1.65d+46))) then
tmp = asin((1.0d0 / (1.0d0 + (t * (t / (l * l))))))
else
tmp = asin((sqrt(0.5d0) * (l / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -1e-310) || !(l <= 1.65e+46)) {
tmp = Math.asin((1.0 / (1.0 + (t * (t / (l * l))))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (l <= -1e-310) or not (l <= 1.65e+46): tmp = math.asin((1.0 / (1.0 + (t * (t / (l * l)))))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((l <= -1e-310) || !(l <= 1.65e+46)) tmp = asin(Float64(1.0 / Float64(1.0 + Float64(t * Float64(t / Float64(l * l)))))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((l <= -1e-310) || ~((l <= 1.65e+46))) tmp = asin((1.0 / (1.0 + (t * (t / (l * l)))))); else tmp = asin((sqrt(0.5) * (l / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, -1e-310], N[Not[LessEqual[l, 1.65e+46]], $MachinePrecision]], N[ArcSin[N[(1.0 / N[(1.0 + N[(t * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-310} \lor \neg \left(\ell \leq 1.65 \cdot 10^{+46}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{1}{1 + t \cdot \frac{t}{\ell \cdot \ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if l < -9.999999999999969e-311 or 1.6499999999999999e46 < l Initial program 89.1%
Taylor expanded in Om around 0 71.7%
unpow271.7%
unpow271.7%
Simplified71.7%
sqrt-div71.7%
metadata-eval71.7%
+-commutative71.7%
times-frac87.7%
unpow287.7%
fma-udef87.7%
Applied egg-rr87.7%
fma-udef87.7%
*-commutative87.7%
unpow287.7%
rem-square-sqrt87.7%
swap-sqr87.7%
unpow287.7%
+-commutative87.7%
unpow287.7%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 66.4%
associate-*r/66.4%
*-commutative66.4%
unpow266.4%
rem-square-sqrt66.4%
associate-*r*66.4%
metadata-eval66.4%
*-lft-identity66.4%
unpow266.4%
associate-*r/68.9%
unpow268.9%
Simplified68.9%
if -9.999999999999969e-311 < l < 1.6499999999999999e46Initial program 66.9%
Taylor expanded in Om around 0 52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
Taylor expanded in t around inf 40.9%
associate-/l*40.9%
associate-/r/40.8%
Simplified40.8%
Final simplification61.0%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l -1e-310) (not (<= l 4.8e+43))) (asin (/ 1.0 (+ 1.0 (* t (/ t (* l l)))))) (asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -1e-310) || !(l <= 4.8e+43)) {
tmp = asin((1.0 / (1.0 + (t * (t / (l * l))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((l <= (-1d-310)) .or. (.not. (l <= 4.8d+43))) then
tmp = asin((1.0d0 / (1.0d0 + (t * (t / (l * l))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -1e-310) || !(l <= 4.8e+43)) {
tmp = Math.asin((1.0 / (1.0 + (t * (t / (l * l))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (l <= -1e-310) or not (l <= 4.8e+43): tmp = math.asin((1.0 / (1.0 + (t * (t / (l * l)))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((l <= -1e-310) || !(l <= 4.8e+43)) tmp = asin(Float64(1.0 / Float64(1.0 + Float64(t * Float64(t / Float64(l * l)))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((l <= -1e-310) || ~((l <= 4.8e+43))) tmp = asin((1.0 / (1.0 + (t * (t / (l * l)))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, -1e-310], N[Not[LessEqual[l, 4.8e+43]], $MachinePrecision]], N[ArcSin[N[(1.0 / N[(1.0 + N[(t * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-310} \lor \neg \left(\ell \leq 4.8 \cdot 10^{+43}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{1}{1 + t \cdot \frac{t}{\ell \cdot \ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if l < -9.999999999999969e-311 or 4.80000000000000046e43 < l Initial program 89.1%
Taylor expanded in Om around 0 71.7%
unpow271.7%
unpow271.7%
Simplified71.7%
sqrt-div71.7%
metadata-eval71.7%
+-commutative71.7%
times-frac87.7%
unpow287.7%
fma-udef87.7%
Applied egg-rr87.7%
fma-udef87.7%
*-commutative87.7%
unpow287.7%
rem-square-sqrt87.7%
swap-sqr87.7%
unpow287.7%
+-commutative87.7%
unpow287.7%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 66.4%
associate-*r/66.4%
*-commutative66.4%
unpow266.4%
rem-square-sqrt66.4%
associate-*r*66.4%
metadata-eval66.4%
*-lft-identity66.4%
unpow266.4%
associate-*r/68.9%
unpow268.9%
Simplified68.9%
if -9.999999999999969e-311 < l < 4.80000000000000046e43Initial program 66.9%
Taylor expanded in Om around 0 52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
Taylor expanded in t around inf 40.9%
Final simplification61.0%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 3.3e-153) (asin 1.0) (asin (/ 1.0 (+ 1.0 (* t (/ t (* l l))))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 3.3e-153) {
tmp = asin(1.0);
} else {
tmp = asin((1.0 / (1.0 + (t * (t / (l * l))))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (t <= 3.3d-153) then
tmp = asin(1.0d0)
else
tmp = asin((1.0d0 / (1.0d0 + (t * (t / (l * l))))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 3.3e-153) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((1.0 / (1.0 + (t * (t / (l * l))))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 3.3e-153: tmp = math.asin(1.0) else: tmp = math.asin((1.0 / (1.0 + (t * (t / (l * l)))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 3.3e-153) tmp = asin(1.0); else tmp = asin(Float64(1.0 / Float64(1.0 + Float64(t * Float64(t / Float64(l * l)))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 3.3e-153) tmp = asin(1.0); else tmp = asin((1.0 / (1.0 + (t * (t / (l * l)))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 3.3e-153], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(1.0 / N[(1.0 + N[(t * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.3 \cdot 10^{-153}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{1 + t \cdot \frac{t}{\ell \cdot \ell}}\right)\\
\end{array}
\end{array}
if t < 3.29999999999999988e-153Initial program 84.9%
Taylor expanded in Om around 0 66.4%
unpow266.4%
unpow266.4%
Simplified66.4%
sqrt-div66.4%
metadata-eval66.4%
+-commutative66.4%
times-frac84.7%
unpow284.7%
fma-udef84.7%
Applied egg-rr84.7%
fma-udef84.7%
*-commutative84.7%
unpow284.7%
rem-square-sqrt84.5%
swap-sqr84.6%
unpow284.6%
+-commutative84.6%
unpow284.6%
hypot-1-def97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in t around 0 54.5%
if 3.29999999999999988e-153 < t Initial program 79.5%
Taylor expanded in Om around 0 66.5%
unpow266.5%
unpow266.5%
Simplified66.5%
sqrt-div66.5%
metadata-eval66.5%
+-commutative66.5%
times-frac76.8%
unpow276.8%
fma-udef76.8%
Applied egg-rr76.8%
fma-udef76.8%
*-commutative76.8%
unpow276.8%
rem-square-sqrt76.8%
swap-sqr76.8%
unpow276.8%
+-commutative76.8%
unpow276.8%
hypot-1-def95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around 0 63.1%
associate-*r/63.1%
*-commutative63.1%
unpow263.1%
rem-square-sqrt63.1%
associate-*r*63.1%
metadata-eval63.1%
*-lft-identity63.1%
unpow263.1%
associate-*r/64.9%
unpow264.9%
Simplified64.9%
Final simplification58.3%
(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}
Initial program 82.9%
Taylor expanded in Om around 0 66.4%
unpow266.4%
unpow266.4%
Simplified66.4%
sqrt-div66.4%
metadata-eval66.4%
+-commutative66.4%
times-frac81.8%
unpow281.8%
fma-udef81.8%
Applied egg-rr81.8%
fma-udef81.8%
*-commutative81.8%
unpow281.8%
rem-square-sqrt81.7%
swap-sqr81.7%
unpow281.7%
+-commutative81.7%
unpow281.7%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 52.3%
Final simplification52.3%
herbie shell --seed 2023297
(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)))))))