
(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 9 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}
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+166)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 1e+79)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (/ (/ l t) (sqrt 2.0))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+166) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 1e+79) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin(((l / t) / sqrt(2.0)));
}
return tmp;
}
NOTE: t should be positive before calling this function
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) <= (-2d+166)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 1d+79) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin(((l / t) / sqrt(2.0d0)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+166) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 1e+79) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+166: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 1e+79: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin(((l / t) / math.sqrt(2.0))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+166) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 1e+79) 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))))))); else tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+166) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 1e+79) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin(((l / t) / sqrt(2.0))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+166], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+79], 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], N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+166}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+79}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.99999999999999988e166Initial program 43.6%
sqrt-div43.6%
div-inv43.6%
add-sqr-sqrt43.6%
hypot-1-def43.6%
*-commutative43.6%
sqrt-prod43.6%
unpow243.6%
sqrt-prod0.0%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
unpow297.0%
times-frac86.0%
unpow286.0%
unpow286.0%
associate-*r/86.0%
*-rgt-identity86.0%
unpow286.0%
unpow286.0%
times-frac97.0%
unpow297.0%
Simplified97.0%
Taylor expanded in Om around 0 96.7%
Taylor expanded in t around -inf 98.9%
associate-*r/98.9%
mul-1-neg98.9%
Simplified98.9%
if -1.99999999999999988e166 < (/.f64 t l) < 9.99999999999999967e78Initial program 97.4%
unpow297.4%
clear-num97.4%
un-div-inv97.5%
Applied egg-rr97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
if 9.99999999999999967e78 < (/.f64 t l) Initial program 50.0%
sqrt-div50.0%
div-inv50.0%
add-sqr-sqrt50.0%
hypot-1-def50.0%
*-commutative50.0%
sqrt-prod50.0%
unpow250.0%
sqrt-prod97.2%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
unpow297.3%
times-frac83.4%
unpow283.4%
unpow283.4%
associate-*r/83.4%
*-rgt-identity83.4%
unpow283.4%
unpow283.4%
times-frac97.3%
unpow297.3%
Simplified97.3%
Taylor expanded in Om around 0 96.3%
Taylor expanded in t around inf 98.6%
associate-/r*98.7%
Simplified98.7%
Final simplification97.9%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
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)))));
}
t = Math.abs(t);
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)))));
}
t = abs(t) 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)))))
t = abs(t) 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
t = abs(t) 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
NOTE: t should be positive before calling this function 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}
t = |t|\\
\\
\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 81.8%
sqrt-div81.7%
div-inv81.7%
add-sqr-sqrt81.7%
hypot-1-def81.7%
*-commutative81.7%
sqrt-prod81.7%
unpow281.7%
sqrt-prod55.8%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
unpow297.5%
times-frac86.8%
unpow286.8%
unpow286.8%
associate-*r/86.8%
*-rgt-identity86.8%
unpow286.8%
unpow286.8%
times-frac97.5%
unpow297.5%
Simplified97.5%
Final simplification97.5%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
t = Math.abs(t);
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)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
NOTE: t should be positive before calling this function 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}
t = |t|\\
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 81.8%
sqrt-div81.7%
div-inv81.7%
add-sqr-sqrt81.7%
hypot-1-def81.7%
*-commutative81.7%
sqrt-prod81.7%
unpow281.7%
sqrt-prod55.8%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
unpow297.5%
times-frac86.8%
unpow286.8%
unpow286.8%
associate-*r/86.8%
*-rgt-identity86.8%
unpow286.8%
unpow286.8%
times-frac97.5%
unpow297.5%
Simplified97.5%
Taylor expanded in Om around 0 96.4%
Final simplification96.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2000000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.0005)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (/ l t) (sqrt 2.0))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2000000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.0005) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l / t) / sqrt(2.0)));
}
return tmp;
}
NOTE: t should be positive before calling this function
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) <= (-2000000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.0005d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin(((l / t) / sqrt(2.0d0)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2000000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.0005) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2000000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.0005: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l / t) / math.sqrt(2.0))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2000000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.0005) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2000000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.0005) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l / t) / sqrt(2.0))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2000000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0005], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0005:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e6Initial program 67.5%
sqrt-div67.4%
div-inv67.4%
add-sqr-sqrt67.4%
hypot-1-def67.4%
*-commutative67.4%
sqrt-prod67.4%
unpow267.4%
sqrt-prod0.0%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
unpow297.9%
times-frac85.9%
unpow285.9%
unpow285.9%
associate-*r/85.9%
*-rgt-identity85.9%
unpow285.9%
unpow285.9%
times-frac97.9%
unpow297.9%
Simplified97.9%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around -inf 99.1%
associate-*r/99.1%
mul-1-neg99.1%
Simplified99.1%
if -2e6 < (/.f64 t l) < 5.0000000000000001e-4Initial program 97.4%
sqrt-div97.1%
div-inv97.1%
add-sqr-sqrt97.1%
hypot-1-def97.1%
*-commutative97.1%
sqrt-prod97.1%
unpow297.1%
sqrt-prod64.3%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
unpow297.1%
times-frac87.4%
unpow287.4%
unpow287.4%
associate-*r/87.4%
*-rgt-identity87.4%
unpow287.4%
unpow287.4%
times-frac97.1%
unpow297.1%
Simplified97.1%
Taylor expanded in Om around 0 95.4%
Taylor expanded in t around 0 86.6%
associate-*r/86.6%
*-commutative86.6%
unpow286.6%
rem-square-sqrt86.6%
associate-*r*86.6%
metadata-eval86.6%
associate-*r/86.6%
mul-1-neg86.6%
unpow286.6%
unpow286.6%
times-frac95.2%
unpow295.2%
Simplified95.2%
if 5.0000000000000001e-4 < (/.f64 t l) Initial program 65.1%
sqrt-div65.1%
div-inv65.1%
add-sqr-sqrt65.0%
hypot-1-def65.0%
*-commutative65.0%
sqrt-prod65.1%
unpow265.1%
sqrt-prod97.7%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
unpow297.9%
times-frac86.6%
unpow286.6%
unpow286.6%
associate-*r/86.6%
*-rgt-identity86.6%
unpow286.6%
unpow286.6%
times-frac97.8%
unpow297.8%
Simplified97.8%
Taylor expanded in Om around 0 97.2%
Taylor expanded in t around inf 95.4%
associate-/r*95.5%
Simplified95.5%
Final simplification96.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= t 4.2e+25)
(asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))
(if (or (<= t 1.05e+115) (not (<= t 6e+131)))
(asin (/ l (* t (sqrt 2.0))))
(asin 1.0))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.2e+25) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else if ((t <= 1.05e+115) || !(t <= 6e+131)) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
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+25) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else if ((t <= 1.05d+115) .or. (.not. (t <= 6d+131))) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.2e+25) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else if ((t <= 1.05e+115) || !(t <= 6e+131)) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 4.2e+25: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) elif (t <= 1.05e+115) or not (t <= 6e+131): tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 4.2e+25) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); elseif ((t <= 1.05e+115) || !(t <= 6e+131)) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 4.2e+25) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); elseif ((t <= 1.05e+115) || ~((t <= 6e+131))) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 4.2e+25], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[t, 1.05e+115], N[Not[LessEqual[t, 6e+131]], $MachinePrecision]], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2 \cdot 10^{+25}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+115} \lor \neg \left(t \leq 6 \cdot 10^{+131}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if t < 4.1999999999999998e25Initial program 86.9%
Taylor expanded in t around 0 53.7%
unpow253.7%
unpow253.7%
times-frac59.5%
unpow259.5%
Simplified59.5%
Taylor expanded in Om around 0 53.7%
unpow253.7%
unpow253.7%
Simplified53.7%
times-frac59.4%
Applied egg-rr59.4%
if 4.1999999999999998e25 < t < 1.05000000000000002e115 or 6.0000000000000003e131 < t Initial program 62.7%
sqrt-div62.6%
div-inv62.6%
add-sqr-sqrt62.6%
hypot-1-def62.6%
*-commutative62.6%
sqrt-prod62.7%
unpow262.7%
sqrt-prod50.7%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
unpow298.1%
times-frac90.5%
unpow290.5%
unpow290.5%
associate-*r/90.4%
*-rgt-identity90.4%
unpow290.4%
unpow290.4%
times-frac98.1%
unpow298.1%
Simplified98.1%
Taylor expanded in Om around 0 97.3%
Taylor expanded in t around inf 65.3%
if 1.05000000000000002e115 < t < 6.0000000000000003e131Initial program 81.0%
Taylor expanded in t around 0 61.5%
unpow261.5%
unpow261.5%
times-frac61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in Om around 0 61.5%
Final simplification60.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= t 4e+25)
(asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))
(if (or (<= t 1.1e+114) (not (<= t 5.2e+131)))
(asin (/ (/ l t) (sqrt 2.0)))
(asin 1.0))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4e+25) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else if ((t <= 1.1e+114) || !(t <= 5.2e+131)) {
tmp = asin(((l / t) / sqrt(2.0)));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
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 <= 4d+25) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else if ((t <= 1.1d+114) .or. (.not. (t <= 5.2d+131))) then
tmp = asin(((l / t) / sqrt(2.0d0)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4e+25) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else if ((t <= 1.1e+114) || !(t <= 5.2e+131)) {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 4e+25: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) elif (t <= 1.1e+114) or not (t <= 5.2e+131): tmp = math.asin(((l / t) / math.sqrt(2.0))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 4e+25) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); elseif ((t <= 1.1e+114) || !(t <= 5.2e+131)) tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 4e+25) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); elseif ((t <= 1.1e+114) || ~((t <= 5.2e+131))) tmp = asin(((l / t) / sqrt(2.0))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 4e+25], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[t, 1.1e+114], N[Not[LessEqual[t, 5.2e+131]], $MachinePrecision]], N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4 \cdot 10^{+25}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+114} \lor \neg \left(t \leq 5.2 \cdot 10^{+131}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if t < 4.00000000000000036e25Initial program 86.9%
Taylor expanded in t around 0 53.7%
unpow253.7%
unpow253.7%
times-frac59.5%
unpow259.5%
Simplified59.5%
Taylor expanded in Om around 0 53.7%
unpow253.7%
unpow253.7%
Simplified53.7%
times-frac59.4%
Applied egg-rr59.4%
if 4.00000000000000036e25 < t < 1.1e114 or 5.2e131 < t Initial program 62.7%
sqrt-div62.6%
div-inv62.6%
add-sqr-sqrt62.6%
hypot-1-def62.6%
*-commutative62.6%
sqrt-prod62.7%
unpow262.7%
sqrt-prod50.7%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
unpow298.1%
times-frac90.5%
unpow290.5%
unpow290.5%
associate-*r/90.4%
*-rgt-identity90.4%
unpow290.4%
unpow290.4%
times-frac98.1%
unpow298.1%
Simplified98.1%
Taylor expanded in Om around 0 97.3%
Taylor expanded in t around inf 65.3%
associate-/r*65.4%
Simplified65.4%
if 1.1e114 < t < 5.2e131Initial program 81.0%
Taylor expanded in t around 0 61.5%
unpow261.5%
unpow261.5%
times-frac61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in Om around 0 61.5%
Final simplification60.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))))
(if (<= l -1.7e-19)
t_1
(if (<= l -4.2e-300)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= l 4.5e+83) (asin (/ (/ l t) (sqrt 2.0))) t_1)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
double tmp;
if (l <= -1.7e-19) {
tmp = t_1;
} else if (l <= -4.2e-300) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if (l <= 4.5e+83) {
tmp = asin(((l / t) / sqrt(2.0)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: t should be positive before calling this function
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 + ((-0.5d0) * ((om / omc) * (om / omc)))))
if (l <= (-1.7d-19)) then
tmp = t_1
else if (l <= (-4.2d-300)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if (l <= 4.5d+83) then
tmp = asin(((l / t) / sqrt(2.0d0)))
else
tmp = t_1
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
double tmp;
if (l <= -1.7e-19) {
tmp = t_1;
} else if (l <= -4.2e-300) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if (l <= 4.5e+83) {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
} else {
tmp = t_1;
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) tmp = 0 if l <= -1.7e-19: tmp = t_1 elif l <= -4.2e-300: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif l <= 4.5e+83: tmp = math.asin(((l / t) / math.sqrt(2.0))) else: tmp = t_1 return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))) tmp = 0.0 if (l <= -1.7e-19) tmp = t_1; elseif (l <= -4.2e-300) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (l <= 4.5e+83) tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); else tmp = t_1; end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); tmp = 0.0; if (l <= -1.7e-19) tmp = t_1; elseif (l <= -4.2e-300) tmp = asin((-l / (t * sqrt(2.0)))); elseif (l <= 4.5e+83) tmp = asin(((l / t) / sqrt(2.0))); else tmp = t_1; end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.7e-19], t$95$1, If[LessEqual[l, -4.2e-300], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 4.5e+83], N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -4.2 \cdot 10^{-300}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{+83}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -1.7000000000000001e-19 or 4.4999999999999999e83 < l Initial program 93.8%
Taylor expanded in t around 0 73.8%
unpow273.8%
unpow273.8%
times-frac80.8%
unpow280.8%
Simplified80.8%
Taylor expanded in Om around 0 73.8%
unpow273.8%
unpow273.8%
Simplified73.8%
times-frac80.8%
Applied egg-rr80.8%
if -1.7000000000000001e-19 < l < -4.20000000000000007e-300Initial program 72.1%
sqrt-div71.8%
div-inv71.8%
add-sqr-sqrt71.8%
hypot-1-def71.8%
*-commutative71.8%
sqrt-prod71.8%
unpow271.8%
sqrt-prod52.0%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
unpow296.1%
times-frac78.6%
unpow278.6%
unpow278.6%
associate-*r/78.6%
*-rgt-identity78.6%
unpow278.6%
unpow278.6%
times-frac96.1%
unpow296.1%
Simplified96.1%
Taylor expanded in Om around 0 95.0%
Taylor expanded in t around -inf 55.9%
associate-*r/55.9%
mul-1-neg55.9%
Simplified55.9%
if -4.20000000000000007e-300 < l < 4.4999999999999999e83Initial program 71.8%
sqrt-div71.7%
div-inv71.7%
add-sqr-sqrt71.7%
hypot-1-def71.7%
*-commutative71.7%
sqrt-prod71.7%
unpow271.7%
sqrt-prod50.7%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
unpow296.9%
times-frac88.4%
unpow288.4%
unpow288.4%
associate-*r/88.4%
*-rgt-identity88.4%
unpow288.4%
unpow288.4%
times-frac96.9%
unpow296.9%
Simplified96.9%
Taylor expanded in Om around 0 95.4%
Taylor expanded in t around inf 42.6%
associate-/r*42.6%
Simplified42.6%
Final simplification62.5%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
}
NOTE: t should be positive before calling this function
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 + ((-0.5d0) * ((om / omc) * (om / omc)))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)
\end{array}
Initial program 81.8%
Taylor expanded in t around 0 45.0%
unpow245.0%
unpow245.0%
times-frac50.0%
unpow250.0%
Simplified50.0%
Taylor expanded in Om around 0 45.1%
unpow245.1%
unpow245.1%
Simplified45.1%
times-frac50.0%
Applied egg-rr50.0%
Final simplification50.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin 1.0))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin(1.0);
}
NOTE: t should be positive before calling this function
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
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
t = abs(t) def code(t, l, Om, Omc): return math.asin(1.0)
t = abs(t) function code(t, l, Om, Omc) return asin(1.0) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} 1
\end{array}
Initial program 81.8%
Taylor expanded in t around 0 45.0%
unpow245.0%
unpow245.0%
times-frac50.0%
unpow250.0%
Simplified50.0%
Taylor expanded in Om around 0 49.3%
Final simplification49.3%
herbie shell --seed 2023293
(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)))))))