
(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 8 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 85.9%
sqrt-div85.9%
add-sqr-sqrt85.9%
hypot-1-def85.9%
*-commutative85.9%
sqrt-prod85.8%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
Final simplification98.5%
(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 85.9%
sqrt-div85.9%
add-sqr-sqrt85.9%
hypot-1-def85.9%
*-commutative85.9%
sqrt-prod85.8%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 98.0%
Final simplification98.0%
(FPCore (t l Om Omc)
:precision binary64
(if (<= t 3.5e+142)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ t (* l (/ l t))))))))
(asin (* (/ 1.0 t) (/ l (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 3.5e+142) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = asin(((1.0 / t) * (l / sqrt(2.0))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (t <= 3.5d+142) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * (t / (l * (l / t))))))))
else
tmp = asin(((1.0d0 / t) * (l / sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 3.5e+142) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = Math.asin(((1.0 / t) * (l / Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 3.5e+142: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t)))))))) else: tmp = math.asin(((1.0 / t) * (l / math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 3.5e+142) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(t / Float64(l * Float64(l / t)))))))); else tmp = asin(Float64(Float64(1.0 / t) * Float64(l / sqrt(2.0)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 3.5e+142) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t)))))))); else tmp = asin(((1.0 / t) * (l / sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 3.5e+142], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(t / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 / t), $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+142}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{t}{\ell \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{t} \cdot \frac{\ell}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 3.49999999999999997e142Initial program 87.4%
unpow287.4%
clear-num87.4%
frac-times83.8%
*-un-lft-identity83.8%
Applied egg-rr83.8%
unpow254.4%
Applied egg-rr83.8%
if 3.49999999999999997e142 < t Initial program 78.3%
sqrt-div78.2%
add-sqr-sqrt78.2%
hypot-1-def78.2%
*-commutative78.2%
sqrt-prod78.2%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
Taylor expanded in Om around 0 98.4%
Taylor expanded in t around inf 67.7%
*-un-lft-identity67.7%
times-frac67.7%
Applied egg-rr67.7%
Final simplification81.2%
(FPCore (t l Om Omc)
:precision binary64
(if (<= t 4.2e+142)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* (/ 1.0 t) (/ l (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.2e+142) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin(((1.0 / t) * (l / sqrt(2.0))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (t <= 4.2d+142) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin(((1.0d0 / t) * (l / sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.2e+142) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin(((1.0 / t) * (l / Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 4.2e+142: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin(((1.0 / t) * (l / math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 4.2e+142) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(Float64(1.0 / t) * Float64(l / sqrt(2.0)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 4.2e+142) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin(((1.0 / t) * (l / sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 4.2e+142], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 / t), $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2 \cdot 10^{+142}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{t} \cdot \frac{\ell}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 4.2e142Initial program 87.4%
unpow287.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
unpow254.4%
Applied egg-rr87.4%
if 4.2e142 < t Initial program 78.3%
sqrt-div78.2%
add-sqr-sqrt78.2%
hypot-1-def78.2%
*-commutative78.2%
sqrt-prod78.2%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
Taylor expanded in Om around 0 98.4%
Taylor expanded in t around inf 67.7%
*-un-lft-identity67.7%
times-frac67.7%
Applied egg-rr67.7%
Final simplification84.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l 2.45e+16)
(asin (/ l (* t (sqrt 2.0))))
(if (<= l 4.5e+52)
(asin (sqrt (- 1.0 (* (/ Om Omc) (/ Om Omc)))))
(if (<= l 2.6e+107) (asin (* l (/ (/ 1.0 t) (sqrt 2.0)))) (asin 1.0)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 2.45e+16) {
tmp = asin((l / (t * sqrt(2.0))));
} else if (l <= 4.5e+52) {
tmp = asin(sqrt((1.0 - ((Om / Omc) * (Om / Omc)))));
} else if (l <= 2.6e+107) {
tmp = asin((l * ((1.0 / 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 <= 2.45d+16) then
tmp = asin((l / (t * sqrt(2.0d0))))
else if (l <= 4.5d+52) then
tmp = asin(sqrt((1.0d0 - ((om / omc) * (om / omc)))))
else if (l <= 2.6d+107) then
tmp = asin((l * ((1.0d0 / 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 <= 2.45e+16) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else if (l <= 4.5e+52) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) * (Om / Omc)))));
} else if (l <= 2.6e+107) {
tmp = Math.asin((l * ((1.0 / t) / Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 2.45e+16: tmp = math.asin((l / (t * math.sqrt(2.0)))) elif l <= 4.5e+52: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) * (Om / Omc))))) elif l <= 2.6e+107: tmp = math.asin((l * ((1.0 / t) / math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 2.45e+16) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); elseif (l <= 4.5e+52) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))))); elseif (l <= 2.6e+107) tmp = asin(Float64(l * Float64(Float64(1.0 / 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 <= 2.45e+16) tmp = asin((l / (t * sqrt(2.0)))); elseif (l <= 4.5e+52) tmp = asin(sqrt((1.0 - ((Om / Omc) * (Om / Omc))))); elseif (l <= 2.6e+107) tmp = asin((l * ((1.0 / t) / sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 2.45e+16], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 4.5e+52], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.6e+107], N[ArcSin[N[(l * N[(N[(1.0 / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.45 \cdot 10^{+16}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{+52}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}\right)\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+107}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\frac{1}{t}}{\sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 2.45e16Initial program 82.4%
sqrt-div82.4%
add-sqr-sqrt82.4%
hypot-1-def82.4%
*-commutative82.4%
sqrt-prod82.4%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 38.5%
if 2.45e16 < l < 4.5e52Initial program 100.0%
Taylor expanded in t around 0 100.0%
unpow2100.0%
unpow2100.0%
times-frac100.0%
unpow2100.0%
Simplified100.0%
unpow2100.0%
Applied egg-rr100.0%
if 4.5e52 < l < 2.6000000000000001e107Initial program 99.0%
sqrt-div99.2%
add-sqr-sqrt99.2%
hypot-1-def99.2%
*-commutative99.2%
sqrt-prod98.6%
sqrt-pow198.6%
metadata-eval98.6%
pow198.6%
Applied egg-rr98.6%
Taylor expanded in Om around 0 98.6%
Taylor expanded in t around inf 25.1%
associate-/r*25.3%
div-inv25.3%
*-un-lft-identity25.3%
times-frac25.3%
Applied egg-rr25.3%
if 2.6000000000000001e107 < l Initial program 98.3%
Taylor expanded in t around 0 71.4%
unpow271.4%
unpow271.4%
times-frac83.3%
unpow283.3%
Simplified83.3%
Taylor expanded in Om around 0 83.3%
Final simplification46.6%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l 2.4e+15) (and (not (<= l 1.6e+53)) (<= l 2.5e+107))) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= 2.4e+15) || (!(l <= 1.6e+53) && (l <= 2.5e+107))) {
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 <= 2.4d+15) .or. (.not. (l <= 1.6d+53)) .and. (l <= 2.5d+107)) 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 <= 2.4e+15) || (!(l <= 1.6e+53) && (l <= 2.5e+107))) {
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 <= 2.4e+15) or (not (l <= 1.6e+53) and (l <= 2.5e+107)): 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 <= 2.4e+15) || (!(l <= 1.6e+53) && (l <= 2.5e+107))) 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 <= 2.4e+15) || (~((l <= 1.6e+53)) && (l <= 2.5e+107))) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, 2.4e+15], And[N[Not[LessEqual[l, 1.6e+53]], $MachinePrecision], LessEqual[l, 2.5e+107]]], 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 2.4 \cdot 10^{+15} \lor \neg \left(\ell \leq 1.6 \cdot 10^{+53}\right) \land \ell \leq 2.5 \cdot 10^{+107}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 2.4e15 or 1.6e53 < l < 2.5000000000000001e107Initial program 83.1%
sqrt-div83.1%
add-sqr-sqrt83.1%
hypot-1-def83.1%
*-commutative83.1%
sqrt-prod83.0%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 38.0%
if 2.4e15 < l < 1.6e53 or 2.5000000000000001e107 < l Initial program 98.5%
Taylor expanded in t around 0 74.5%
unpow274.5%
unpow274.5%
times-frac85.1%
unpow285.1%
Simplified85.1%
Taylor expanded in Om around 0 85.1%
Final simplification46.6%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (/ l (* t (sqrt 2.0))))))
(if (<= l 2.9e+16)
t_1
(if (<= l 1.45e+53)
(asin (sqrt (- 1.0 (* (/ Om Omc) (/ Om Omc)))))
(if (<= l 2.5e+107) t_1 (asin 1.0))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = asin((l / (t * sqrt(2.0))));
double tmp;
if (l <= 2.9e+16) {
tmp = t_1;
} else if (l <= 1.45e+53) {
tmp = asin(sqrt((1.0 - ((Om / Omc) * (Om / Omc)))));
} else if (l <= 2.5e+107) {
tmp = t_1;
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = asin((l / (t * sqrt(2.0d0))))
if (l <= 2.9d+16) then
tmp = t_1
else if (l <= 1.45d+53) then
tmp = asin(sqrt((1.0d0 - ((om / omc) * (om / omc)))))
else if (l <= 2.5d+107) then
tmp = t_1
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin((l / (t * Math.sqrt(2.0))));
double tmp;
if (l <= 2.9e+16) {
tmp = t_1;
} else if (l <= 1.45e+53) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) * (Om / Omc)))));
} else if (l <= 2.5e+107) {
tmp = t_1;
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.asin((l / (t * math.sqrt(2.0)))) tmp = 0 if l <= 2.9e+16: tmp = t_1 elif l <= 1.45e+53: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) * (Om / Omc))))) elif l <= 2.5e+107: tmp = t_1 else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) t_1 = asin(Float64(l / Float64(t * sqrt(2.0)))) tmp = 0.0 if (l <= 2.9e+16) tmp = t_1; elseif (l <= 1.45e+53) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))))); elseif (l <= 2.5e+107) tmp = t_1; else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = asin((l / (t * sqrt(2.0)))); tmp = 0.0; if (l <= 2.9e+16) tmp = t_1; elseif (l <= 1.45e+53) tmp = asin(sqrt((1.0 - ((Om / Omc) * (Om / Omc))))); elseif (l <= 2.5e+107) tmp = t_1; else tmp = asin(1.0); 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]}, If[LessEqual[l, 2.9e+16], t$95$1, If[LessEqual[l, 1.45e+53], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.5e+107], t$95$1, N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{if}\;\ell \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+53}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}\right)\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 2.9e16 or 1.4500000000000001e53 < l < 2.5000000000000001e107Initial program 83.1%
sqrt-div83.1%
add-sqr-sqrt83.1%
hypot-1-def83.1%
*-commutative83.1%
sqrt-prod83.0%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 38.0%
if 2.9e16 < l < 1.4500000000000001e53Initial program 100.0%
Taylor expanded in t around 0 100.0%
unpow2100.0%
unpow2100.0%
times-frac100.0%
unpow2100.0%
Simplified100.0%
unpow2100.0%
Applied egg-rr100.0%
if 2.5000000000000001e107 < l Initial program 98.3%
Taylor expanded in t around 0 71.4%
unpow271.4%
unpow271.4%
times-frac83.3%
unpow283.3%
Simplified83.3%
Taylor expanded in Om around 0 83.3%
Final simplification46.6%
(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 85.9%
Taylor expanded in t around 0 43.0%
unpow243.0%
unpow243.0%
times-frac47.9%
unpow247.9%
Simplified47.9%
Taylor expanded in Om around 0 47.7%
Final simplification47.7%
herbie shell --seed 2024082
(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)))))))