
(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 10 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 79.8%
sqrt-div79.8%
div-inv79.8%
add-sqr-sqrt79.8%
hypot-1-def79.8%
*-commutative79.8%
sqrt-prod79.8%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (+ 1.0 (* (pow (/ Om Omc) 2.0) -0.5)) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin(((1.0 + (pow((Om / Omc), 2.0) * -0.5)) / 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.pow((Om / Omc), 2.0) * -0.5)) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin(((1.0 + (math.pow((Om / Omc), 2.0) * -0.5)) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(Float64(1.0 + Float64((Float64(Om / Omc) ^ 2.0) * -0.5)) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(((1.0 + (((Om / Omc) ^ 2.0) * -0.5)) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[(1.0 + N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $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{1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 79.8%
sqrt-div79.8%
div-inv79.8%
add-sqr-sqrt79.8%
hypot-1-def79.8%
*-commutative79.8%
sqrt-prod79.8%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in Om around 0 88.1%
*-commutative88.1%
unpow288.1%
unpow288.1%
times-frac98.1%
unpow298.1%
Simplified98.1%
(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 79.8%
sqrt-div79.8%
div-inv79.8%
add-sqr-sqrt79.8%
hypot-1-def79.8%
*-commutative79.8%
sqrt-prod79.8%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in Om around 0 97.8%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* t (/ (sqrt 2.0) l))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, (t * (sqrt(2.0) / l)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, (t * (Math.sqrt(2.0) / l)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, (t * (math.sqrt(2.0) / l)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(t * Float64(sqrt(2.0) / l))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, (t * (sqrt(2.0) / l))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{\sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 79.8%
clear-num79.8%
sqrt-div79.7%
metadata-eval79.7%
+-commutative79.7%
fma-define79.7%
Applied egg-rr79.7%
Taylor expanded in Om around 0 62.9%
metadata-eval62.9%
*-commutative62.9%
unpow262.9%
unpow262.9%
times-frac79.3%
rem-square-sqrt79.3%
swap-sqr79.4%
hypot-undefine97.8%
associate-*l/97.8%
associate-/l*97.8%
Simplified97.8%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l 1.45e-162)
(asin (/ l (* t (sqrt 2.0))))
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.45e-162) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (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 <= 1.45d-162) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.45e-162) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 1.45e-162: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 1.45e-162) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 1.45e-162) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 1.45e-162], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.45 \cdot 10^{-162}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\end{array}
\end{array}
if l < 1.4500000000000001e-162Initial program 75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
+-commutative75.0%
fma-define75.0%
Applied egg-rr75.0%
Taylor expanded in Om around 0 55.6%
metadata-eval55.6%
*-commutative55.6%
unpow255.6%
unpow255.6%
times-frac75.0%
rem-square-sqrt75.0%
swap-sqr75.0%
hypot-undefine98.0%
associate-*l/98.0%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in t around inf 47.6%
if 1.4500000000000001e-162 < l Initial program 87.4%
unpow287.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
unpow287.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 1.6e-162) (asin (/ l (* t (sqrt 2.0)))) (asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.6e-162) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) / (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 <= 1.6d-162) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.6e-162) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 1.6e-162: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) / (l / t))))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 1.6e-162) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 1.6e-162) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) / (l / t))))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 1.6e-162], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.6 \cdot 10^{-162}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\end{array}
\end{array}
if l < 1.59999999999999988e-162Initial program 75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
+-commutative75.0%
fma-define75.0%
Applied egg-rr75.0%
Taylor expanded in Om around 0 55.6%
metadata-eval55.6%
*-commutative55.6%
unpow255.6%
unpow255.6%
times-frac75.0%
rem-square-sqrt75.0%
swap-sqr75.0%
hypot-undefine98.0%
associate-*l/98.0%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in t around inf 47.6%
if 1.59999999999999988e-162 < l Initial program 87.4%
unpow287.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
Taylor expanded in Om around 0 86.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 3.5e+80) (asin (/ l (* t (sqrt 2.0)))) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 3.5e+80) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
}
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 <= 3.5d+80) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 3.5e+80) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 3.5e+80: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 3.5e+80) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 3.5e+80) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 3.5e+80], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.5 \cdot 10^{+80}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\end{array}
\end{array}
if l < 3.49999999999999994e80Initial program 75.4%
clear-num75.4%
sqrt-div75.4%
metadata-eval75.4%
+-commutative75.4%
fma-define75.4%
Applied egg-rr75.4%
Taylor expanded in Om around 0 59.5%
metadata-eval59.5%
*-commutative59.5%
unpow259.5%
unpow259.5%
times-frac75.4%
rem-square-sqrt75.3%
swap-sqr75.4%
hypot-undefine98.2%
associate-*l/98.2%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
if 3.49999999999999994e80 < l Initial program 98.3%
Taylor expanded in t around 0 71.1%
unpow271.1%
unpow271.1%
times-frac87.2%
unpow287.2%
Simplified87.2%
unpow298.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr87.2%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 2.3e+80) (asin (/ l (* t (sqrt 2.0)))) (asin (+ 1.0 (* (pow (/ Om Omc) 2.0) -0.5)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 2.3e+80) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin((1.0 + (pow((Om / Omc), 2.0) * -0.5)));
}
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 <= 2.3d+80) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin((1.0d0 + (((om / omc) ** 2.0d0) * (-0.5d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 2.3e+80) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin((1.0 + (Math.pow((Om / Omc), 2.0) * -0.5)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 2.3e+80: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin((1.0 + (math.pow((Om / Omc), 2.0) * -0.5))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 2.3e+80) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(Float64(1.0 + Float64((Float64(Om / Omc) ^ 2.0) * -0.5))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 2.3e+80) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin((1.0 + (((Om / Omc) ^ 2.0) * -0.5))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 2.3e+80], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(1.0 + N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.3 \cdot 10^{+80}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right)\\
\end{array}
\end{array}
if l < 2.30000000000000004e80Initial program 75.4%
clear-num75.4%
sqrt-div75.4%
metadata-eval75.4%
+-commutative75.4%
fma-define75.4%
Applied egg-rr75.4%
Taylor expanded in Om around 0 59.5%
metadata-eval59.5%
*-commutative59.5%
unpow259.5%
unpow259.5%
times-frac75.4%
rem-square-sqrt75.3%
swap-sqr75.4%
hypot-undefine98.2%
associate-*l/98.2%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
if 2.30000000000000004e80 < l Initial program 98.3%
Taylor expanded in t around 0 71.1%
unpow271.1%
unpow271.1%
times-frac87.2%
unpow287.2%
Simplified87.2%
Taylor expanded in Om around 0 70.3%
*-commutative77.7%
unpow277.7%
unpow277.7%
times-frac97.5%
unpow297.5%
Simplified86.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 1.9e+80) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.9e+80) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= 1.9d+80) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.9e+80) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 1.9e+80: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 1.9e+80) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 1.9e+80) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 1.9e+80], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.9 \cdot 10^{+80}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 1.89999999999999999e80Initial program 75.4%
clear-num75.4%
sqrt-div75.4%
metadata-eval75.4%
+-commutative75.4%
fma-define75.4%
Applied egg-rr75.4%
Taylor expanded in Om around 0 59.5%
metadata-eval59.5%
*-commutative59.5%
unpow259.5%
unpow259.5%
times-frac75.4%
rem-square-sqrt75.3%
swap-sqr75.4%
hypot-undefine98.2%
associate-*l/98.2%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
if 1.89999999999999999e80 < l Initial program 98.3%
Taylor expanded in t around 0 71.1%
unpow271.1%
unpow271.1%
times-frac87.2%
unpow287.2%
Simplified87.2%
Taylor expanded in Om around 0 85.8%
(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 79.8%
Taylor expanded in t around 0 39.0%
unpow239.0%
unpow239.0%
times-frac46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in Om around 0 46.2%
herbie shell --seed 2024147
(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)))))))