
(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 11 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 84.1%
sqrt-div84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod84.0%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* t (/ (sqrt 2.0) l))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, (t * (sqrt(2.0) / l)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, (t * (Math.sqrt(2.0) / l)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, (t * (math.sqrt(2.0) / l)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(t * Float64(sqrt(2.0) / l))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, (t * (sqrt(2.0) / l))))); 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[(t * N[(N[Sqrt[2.0], $MachinePrecision] / l), $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, t \cdot \frac{\sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 84.1%
sqrt-div84.0%
div-inv84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod84.0%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*l/98.7%
associate-/l*98.6%
Simplified98.6%
(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 84.1%
sqrt-div84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod84.0%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 97.6%
(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 84.1%
sqrt-div84.0%
div-inv84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod84.0%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*l/98.7%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.6%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l 1.55e-105)
(asin (/ 1.0 (/ (* t (sqrt 2.0)) l)))
(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.55e-105) {
tmp = asin((1.0 / ((t * sqrt(2.0)) / l)));
} 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.55d-105) then
tmp = asin((1.0d0 / ((t * sqrt(2.0d0)) / l)))
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.55e-105) {
tmp = Math.asin((1.0 / ((t * Math.sqrt(2.0)) / l)));
} 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.55e-105: tmp = math.asin((1.0 / ((t * math.sqrt(2.0)) / l))) 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.55e-105) tmp = asin(Float64(1.0 / Float64(Float64(t * sqrt(2.0)) / l))); 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.55e-105) tmp = asin((1.0 / ((t * sqrt(2.0)) / l))); 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.55e-105], N[ArcSin[N[(1.0 / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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.55 \cdot 10^{-105}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\frac{t \cdot \sqrt{2}}{\ell}}\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.55000000000000007e-105Initial program 79.7%
sqrt-div79.6%
add-sqr-sqrt79.6%
hypot-1-def79.6%
*-commutative79.6%
sqrt-prod79.6%
sqrt-pow198.6%
metadata-eval98.6%
pow198.6%
Applied egg-rr98.6%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 35.7%
if 1.55000000000000007e-105 < l Initial program 93.3%
unpow293.3%
clear-num93.4%
un-div-inv93.4%
Applied egg-rr93.4%
unpow293.4%
clear-num93.4%
un-div-inv93.4%
Applied egg-rr93.4%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l 6.6e-105)
(asin (/ 1.0 (/ (* t (sqrt 2.0)) l)))
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* t (/ (/ t l) l)))))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 6.6e-105) {
tmp = asin((1.0 / ((t * sqrt(2.0)) / l)));
} else {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.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 (l <= 6.6d-105) then
tmp = asin((1.0d0 / ((t * sqrt(2.0d0)) / l)))
else
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.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 (l <= 6.6e-105) {
tmp = Math.asin((1.0 / ((t * Math.sqrt(2.0)) / l)));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l)))))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 6.6e-105: tmp = math.asin((1.0 / ((t * math.sqrt(2.0)) / l))) else: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l))))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 6.6e-105) tmp = asin(Float64(1.0 / Float64(Float64(t * sqrt(2.0)) / l))); else tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(t * Float64(Float64(t / l) / l))))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 6.6e-105) tmp = asin((1.0 / ((t * sqrt(2.0)) / l))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l))))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 6.6e-105], N[ArcSin[N[(1.0 / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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[(t * N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.6 \cdot 10^{-105}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\frac{t \cdot \sqrt{2}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(t \cdot \frac{\frac{t}{\ell}}{\ell}\right)}}\right)\\
\end{array}
\end{array}
if l < 6.5999999999999997e-105Initial program 79.7%
sqrt-div79.6%
add-sqr-sqrt79.6%
hypot-1-def79.6%
*-commutative79.6%
sqrt-prod79.6%
sqrt-pow198.6%
metadata-eval98.6%
pow198.6%
Applied egg-rr98.6%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 35.7%
if 6.5999999999999997e-105 < l Initial program 93.3%
unpow293.3%
clear-num93.4%
un-div-inv93.4%
Applied egg-rr93.4%
unpow293.4%
clear-num93.4%
un-div-inv93.4%
Applied egg-rr93.4%
associate-/r/93.3%
Applied egg-rr93.3%
Final simplification54.1%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 4.5e-105) (asin (/ 1.0 (/ (* t (sqrt 2.0)) l))) (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 <= 4.5e-105) {
tmp = asin((1.0 / ((t * sqrt(2.0)) / l)));
} 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 <= 4.5d-105) then
tmp = asin((1.0d0 / ((t * sqrt(2.0d0)) / l)))
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 <= 4.5e-105) {
tmp = Math.asin((1.0 / ((t * Math.sqrt(2.0)) / l)));
} 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 <= 4.5e-105: tmp = math.asin((1.0 / ((t * math.sqrt(2.0)) / l))) 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 <= 4.5e-105) tmp = asin(Float64(1.0 / Float64(Float64(t * sqrt(2.0)) / l))); 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 <= 4.5e-105) tmp = asin((1.0 / ((t * sqrt(2.0)) / l))); 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, 4.5e-105], N[ArcSin[N[(1.0 / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 4.5 \cdot 10^{-105}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\frac{t \cdot \sqrt{2}}{\ell}}\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 < 4.4999999999999997e-105Initial program 79.7%
sqrt-div79.6%
add-sqr-sqrt79.6%
hypot-1-def79.6%
*-commutative79.6%
sqrt-prod79.6%
sqrt-pow198.6%
metadata-eval98.6%
pow198.6%
Applied egg-rr98.6%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 35.7%
if 4.4999999999999997e-105 < l Initial program 93.3%
unpow293.3%
clear-num93.4%
un-div-inv93.4%
Applied egg-rr93.4%
Taylor expanded in Om around 0 91.2%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 9e-57) (asin (/ 1.0 (/ (* t (sqrt 2.0)) l))) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 9e-57) {
tmp = asin((1.0 / ((t * sqrt(2.0)) / l)));
} 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 <= 9d-57) then
tmp = asin((1.0d0 / ((t * sqrt(2.0d0)) / l)))
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 <= 9e-57) {
tmp = Math.asin((1.0 / ((t * Math.sqrt(2.0)) / l)));
} else {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 9e-57: tmp = math.asin((1.0 / ((t * math.sqrt(2.0)) / l))) 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 <= 9e-57) tmp = asin(Float64(1.0 / Float64(Float64(t * sqrt(2.0)) / l))); 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 <= 9e-57) tmp = asin((1.0 / ((t * sqrt(2.0)) / l))); else tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 9e-57], N[ArcSin[N[(1.0 / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 9 \cdot 10^{-57}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\frac{t \cdot \sqrt{2}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\end{array}
\end{array}
if l < 8.99999999999999945e-57Initial program 80.4%
sqrt-div80.3%
add-sqr-sqrt80.3%
hypot-1-def80.3%
*-commutative80.3%
sqrt-prod80.3%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 35.2%
if 8.99999999999999945e-57 < l Initial program 93.7%
Taylor expanded in t around 0 65.5%
unpow265.5%
unpow265.5%
times-frac73.9%
unpow273.9%
Simplified73.9%
unpow293.7%
clear-num93.7%
un-div-inv93.7%
Applied egg-rr73.9%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 1.06e-56) (asin (/ 1.0 (/ (* t (sqrt 2.0)) l))) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.06e-56) {
tmp = asin((1.0 / ((t * sqrt(2.0)) / l)));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= 1.06d-56) then
tmp = asin((1.0d0 / ((t * sqrt(2.0d0)) / l)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.06e-56) {
tmp = Math.asin((1.0 / ((t * Math.sqrt(2.0)) / l)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 1.06e-56: tmp = math.asin((1.0 / ((t * math.sqrt(2.0)) / l))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 1.06e-56) tmp = asin(Float64(1.0 / Float64(Float64(t * sqrt(2.0)) / l))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 1.06e-56) tmp = asin((1.0 / ((t * sqrt(2.0)) / l))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 1.06e-56], N[ArcSin[N[(1.0 / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.06 \cdot 10^{-56}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\frac{t \cdot \sqrt{2}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 1.0599999999999999e-56Initial program 80.4%
sqrt-div80.3%
add-sqr-sqrt80.3%
hypot-1-def80.3%
*-commutative80.3%
sqrt-prod80.3%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 35.2%
if 1.0599999999999999e-56 < l Initial program 93.7%
Taylor expanded in t around 0 65.5%
unpow265.5%
unpow265.5%
times-frac73.9%
unpow273.9%
Simplified73.9%
Taylor expanded in Om around 0 72.4%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 5.6e-58) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 5.6e-58) {
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 <= 5.6d-58) 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 <= 5.6e-58) {
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 <= 5.6e-58: 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 <= 5.6e-58) 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 <= 5.6e-58) 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, 5.6e-58], 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 5.6 \cdot 10^{-58}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 5.6000000000000001e-58Initial program 80.4%
sqrt-div80.3%
add-sqr-sqrt80.3%
hypot-1-def80.3%
*-commutative80.3%
sqrt-prod80.3%
sqrt-pow198.7%
metadata-eval98.7%
pow198.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 35.6%
if 5.6000000000000001e-58 < l Initial program 93.7%
Taylor expanded in t around 0 65.5%
unpow265.5%
unpow265.5%
times-frac73.9%
unpow273.9%
Simplified73.9%
Taylor expanded in Om around 0 72.4%
(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 84.1%
Taylor expanded in t around 0 46.9%
unpow246.9%
unpow246.9%
times-frac53.7%
unpow253.7%
Simplified53.7%
Taylor expanded in Om around 0 52.9%
herbie shell --seed 2024123
(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)))))))