
(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 12 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
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0))) (t_2 (sqrt t_1)))
(if (<= (/ t l) -4e+188)
(asin (* t_2 (/ (/ (- l) t) (sqrt 2.0))))
(if (<= (/ t l) 2e+153)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* t_2 (/ l (* t (sqrt 2.0)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double t_2 = sqrt(t_1);
double tmp;
if ((t / l) <= -4e+188) {
tmp = asin((t_2 * ((-l / t) / sqrt(2.0))));
} else if ((t / l) <= 2e+153) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((t_2 * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) ** 2.0d0)
t_2 = sqrt(t_1)
if ((t / l) <= (-4d+188)) then
tmp = asin((t_2 * ((-l / t) / sqrt(2.0d0))))
else if ((t / l) <= 2d+153) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((t_2 * (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 t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double t_2 = Math.sqrt(t_1);
double tmp;
if ((t / l) <= -4e+188) {
tmp = Math.asin((t_2 * ((-l / t) / Math.sqrt(2.0))));
} else if ((t / l) <= 2e+153) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((t_2 * (l / (t * Math.sqrt(2.0)))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) t_2 = math.sqrt(t_1) tmp = 0 if (t / l) <= -4e+188: tmp = math.asin((t_2 * ((-l / t) / math.sqrt(2.0)))) elif (t / l) <= 2e+153: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((t_2 * (l / (t * math.sqrt(2.0))))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) t_2 = sqrt(t_1) tmp = 0.0 if (Float64(t / l) <= -4e+188) tmp = asin(Float64(t_2 * Float64(Float64(Float64(-l) / t) / sqrt(2.0)))); elseif (Float64(t / l) <= 2e+153) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(t_2 * Float64(l / Float64(t * sqrt(2.0))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); t_2 = sqrt(t_1); tmp = 0.0; if ((t / l) <= -4e+188) tmp = asin((t_2 * ((-l / t) / sqrt(2.0)))); elseif ((t / l) <= 2e+153) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((t_2 * (l / (t * sqrt(2.0))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -4e+188], N[ArcSin[N[(t$95$2 * N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+153], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(t$95$2 * N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
t_2 := \sqrt{t_1}\\
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+188}:\\
\;\;\;\;\sin^{-1} \left(t_2 \cdot \frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+153}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t_2 \cdot \frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.0000000000000001e188Initial program 62.7%
sqrt-div62.7%
div-inv62.7%
add-sqr-sqrt62.7%
hypot-1-def62.7%
*-commutative62.7%
sqrt-prod62.7%
unpow262.7%
sqrt-prod0.0%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
unpow297.5%
times-frac87.2%
unpow287.2%
unpow287.2%
associate-*r/87.2%
*-rgt-identity87.2%
unpow287.2%
unpow287.2%
times-frac97.5%
unpow297.5%
Simplified97.5%
Taylor expanded in t around -inf 89.5%
mul-1-neg89.5%
*-commutative89.5%
distribute-rgt-neg-in89.5%
unpow289.5%
unpow289.5%
times-frac99.9%
unpow299.9%
*-commutative99.9%
associate-/r*99.8%
Simplified99.8%
if -4.0000000000000001e188 < (/.f64 t l) < 2e153Initial program 96.9%
unpow296.9%
clear-num96.9%
un-div-inv97.0%
Applied egg-rr97.0%
if 2e153 < (/.f64 t l) Initial program 55.6%
sqrt-div55.6%
div-inv55.6%
add-sqr-sqrt55.6%
hypot-1-def55.6%
*-commutative55.6%
sqrt-prod55.6%
unpow255.6%
sqrt-prod99.5%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
unpow299.6%
times-frac89.3%
unpow289.3%
unpow289.3%
associate-*r/89.3%
*-rgt-identity89.3%
unpow289.3%
unpow289.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in t around inf 89.3%
*-commutative89.3%
unpow289.3%
unpow289.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
Final simplification97.6%
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 88.4%
sqrt-div88.3%
div-inv88.3%
add-sqr-sqrt88.3%
hypot-1-def88.3%
*-commutative88.3%
sqrt-prod88.3%
unpow288.3%
sqrt-prod51.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
unpow298.7%
times-frac86.1%
unpow286.1%
unpow286.1%
associate-*r/86.1%
*-rgt-identity86.1%
unpow286.1%
unpow286.1%
times-frac98.7%
unpow298.7%
Simplified98.7%
Final simplification98.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0))))
(if (<= (/ t l) -1e+146)
(asin
(*
(pow (- 1.0 (/ (* Om Om) (* Omc Omc))) 0.5)
(/ (* (sqrt 0.5) (- l)) t)))
(if (<= (/ t l) 2e+153)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* (sqrt t_1) (/ l (* t (sqrt 2.0)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+146) {
tmp = asin((pow((1.0 - ((Om * Om) / (Omc * Omc))), 0.5) * ((sqrt(0.5) * -l) / t)));
} else if ((t / l) <= 2e+153) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((sqrt(t_1) * (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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) ** 2.0d0)
if ((t / l) <= (-1d+146)) then
tmp = asin((((1.0d0 - ((om * om) / (omc * omc))) ** 0.5d0) * ((sqrt(0.5d0) * -l) / t)))
else if ((t / l) <= 2d+153) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((sqrt(t_1) * (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 t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+146) {
tmp = Math.asin((Math.pow((1.0 - ((Om * Om) / (Omc * Omc))), 0.5) * ((Math.sqrt(0.5) * -l) / t)));
} else if ((t / l) <= 2e+153) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((Math.sqrt(t_1) * (l / (t * Math.sqrt(2.0)))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -1e+146: tmp = math.asin((math.pow((1.0 - ((Om * Om) / (Omc * Omc))), 0.5) * ((math.sqrt(0.5) * -l) / t))) elif (t / l) <= 2e+153: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((math.sqrt(t_1) * (l / (t * math.sqrt(2.0))))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) tmp = 0.0 if (Float64(t / l) <= -1e+146) tmp = asin(Float64((Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc))) ^ 0.5) * Float64(Float64(sqrt(0.5) * Float64(-l)) / t))); elseif (Float64(t / l) <= 2e+153) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(sqrt(t_1) * Float64(l / Float64(t * sqrt(2.0))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); tmp = 0.0; if ((t / l) <= -1e+146) tmp = asin((((1.0 - ((Om * Om) / (Omc * Omc))) ^ 0.5) * ((sqrt(0.5) * -l) / t))); elseif ((t / l) <= 2e+153) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((sqrt(t_1) * (l / (t * sqrt(2.0))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+146], N[ArcSin[N[(N[Power[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+153], N[ArcSin[N[Sqrt[N[(t$95$1 / 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[Sqrt[t$95$1], $MachinePrecision] * N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left({\left(1 - \frac{Om \cdot Om}{Omc \cdot Omc}\right)}^{0.5} \cdot \frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+153}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t_1} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999934e145Initial program 57.1%
Taylor expanded in t around -inf 87.8%
pow1/287.8%
unpow287.8%
unpow287.8%
Applied egg-rr87.8%
if -9.99999999999999934e145 < (/.f64 t l) < 2e153Initial program 98.8%
unpow298.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
if 2e153 < (/.f64 t l) Initial program 55.6%
sqrt-div55.6%
div-inv55.6%
add-sqr-sqrt55.6%
hypot-1-def55.6%
*-commutative55.6%
sqrt-prod55.6%
unpow255.6%
sqrt-prod99.5%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
unpow299.6%
times-frac89.3%
unpow289.3%
unpow289.3%
associate-*r/89.3%
*-rgt-identity89.3%
unpow289.3%
unpow289.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in t around inf 89.3%
*-commutative89.3%
unpow289.3%
unpow289.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
Final simplification97.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0))) (t_2 (sqrt t_1)))
(if (<= (/ t l) -1e+146)
(asin (* t_2 (/ (- (sqrt 0.5)) (/ t l))))
(if (<= (/ t l) 2e+153)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* t_2 (/ l (* t (sqrt 2.0)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double t_2 = sqrt(t_1);
double tmp;
if ((t / l) <= -1e+146) {
tmp = asin((t_2 * (-sqrt(0.5) / (t / l))));
} else if ((t / l) <= 2e+153) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((t_2 * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) ** 2.0d0)
t_2 = sqrt(t_1)
if ((t / l) <= (-1d+146)) then
tmp = asin((t_2 * (-sqrt(0.5d0) / (t / l))))
else if ((t / l) <= 2d+153) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((t_2 * (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 t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double t_2 = Math.sqrt(t_1);
double tmp;
if ((t / l) <= -1e+146) {
tmp = Math.asin((t_2 * (-Math.sqrt(0.5) / (t / l))));
} else if ((t / l) <= 2e+153) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((t_2 * (l / (t * Math.sqrt(2.0)))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) t_2 = math.sqrt(t_1) tmp = 0 if (t / l) <= -1e+146: tmp = math.asin((t_2 * (-math.sqrt(0.5) / (t / l)))) elif (t / l) <= 2e+153: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((t_2 * (l / (t * math.sqrt(2.0))))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) t_2 = sqrt(t_1) tmp = 0.0 if (Float64(t / l) <= -1e+146) tmp = asin(Float64(t_2 * Float64(Float64(-sqrt(0.5)) / Float64(t / l)))); elseif (Float64(t / l) <= 2e+153) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(t_2 * Float64(l / Float64(t * sqrt(2.0))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); t_2 = sqrt(t_1); tmp = 0.0; if ((t / l) <= -1e+146) tmp = asin((t_2 * (-sqrt(0.5) / (t / l)))); elseif ((t / l) <= 2e+153) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((t_2 * (l / (t * sqrt(2.0))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+146], N[ArcSin[N[(t$95$2 * N[((-N[Sqrt[0.5], $MachinePrecision]) / N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+153], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(t$95$2 * N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
t_2 := \sqrt{t_1}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left(t_2 \cdot \frac{-\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+153}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t_2 \cdot \frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999934e145Initial program 57.1%
Taylor expanded in t around -inf 87.8%
mul-1-neg87.8%
*-commutative87.8%
distribute-rgt-neg-in87.8%
unpow287.8%
unpow287.8%
times-frac99.5%
unpow299.5%
associate-/l*97.7%
Simplified97.7%
if -9.99999999999999934e145 < (/.f64 t l) < 2e153Initial program 98.8%
unpow298.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
if 2e153 < (/.f64 t l) Initial program 55.6%
sqrt-div55.6%
div-inv55.6%
add-sqr-sqrt55.6%
hypot-1-def55.6%
*-commutative55.6%
sqrt-prod55.6%
unpow255.6%
sqrt-prod99.5%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
unpow299.6%
times-frac89.3%
unpow289.3%
unpow289.3%
associate-*r/89.3%
*-rgt-identity89.3%
unpow289.3%
unpow289.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in t around inf 89.3%
*-commutative89.3%
unpow289.3%
unpow289.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
Final simplification98.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+146)
(asin
(* (pow (- 1.0 (/ (* Om Om) (* Omc Omc))) 0.5) (/ (* (sqrt 0.5) (- l)) t)))
(asin
(sqrt
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+146) {
tmp = asin((pow((1.0 - ((Om * Om) / (Omc * Omc))), 0.5) * ((sqrt(0.5) * -l) / t)));
} else {
tmp = asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
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) <= (-1d+146)) then
tmp = asin((((1.0d0 - ((om * om) / (omc * omc))) ** 0.5d0) * ((sqrt(0.5d0) * -l) / t)))
else
tmp = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
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) <= -1e+146) {
tmp = Math.asin((Math.pow((1.0 - ((Om * Om) / (Omc * Omc))), 0.5) * ((Math.sqrt(0.5) * -l) / t)));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+146: tmp = math.asin((math.pow((1.0 - ((Om * Om) / (Omc * Omc))), 0.5) * ((math.sqrt(0.5) * -l) / t))) else: tmp = math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+146) tmp = asin(Float64((Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc))) ^ 0.5) * Float64(Float64(sqrt(0.5) * Float64(-l)) / t))); else tmp = asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+146) tmp = asin((((1.0 - ((Om * Om) / (Omc * Omc))) ^ 0.5) * ((sqrt(0.5) * -l) / t))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))); 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], -1e+146], N[ArcSin[N[(N[Power[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left({\left(1 - \frac{Om \cdot Om}{Omc \cdot Omc}\right)}^{0.5} \cdot \frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999934e145Initial program 57.1%
Taylor expanded in t around -inf 87.8%
pow1/287.8%
unpow287.8%
unpow287.8%
Applied egg-rr87.8%
if -9.99999999999999934e145 < (/.f64 t l) Initial program 93.1%
unpow293.1%
clear-num93.1%
un-div-inv93.2%
Applied egg-rr93.2%
Final simplification92.5%
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)) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t))))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
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(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
end function
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)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))))
t = abs(t) 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(Float64(t / l) / Float64(l / t))))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))); end
NOTE: t should be positive before calling this function 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[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)
\end{array}
Initial program 88.4%
unpow288.4%
clear-num88.4%
un-div-inv88.4%
Applied egg-rr88.4%
Final simplification88.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ 1.0 (* (/ l t) (/ l t)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t))))))));
}
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(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t) * (l / t))))))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t))))))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t))))))))
t = abs(t) function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t) * Float64(l / t)))))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t)))))))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := 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[(1.0 / N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{1}{\frac{\ell}{t} \cdot \frac{\ell}{t}}}}\right)
\end{array}
Initial program 88.4%
unpow288.4%
clear-num88.4%
clear-num88.3%
frac-times88.4%
metadata-eval88.4%
Applied egg-rr88.4%
unpow252.3%
clear-num52.3%
un-div-inv52.3%
Applied egg-rr88.4%
Final simplification88.4%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 3.4e-142) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))) (asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (/ (* t t) (* l l)))))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 3.4e-142) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l)))))));
}
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 <= 3.4d-142) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t * t) / (l * l)))))))
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 <= 3.4e-142) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l)))))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 3.4e-142: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l))))))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 3.4e-142) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t * t) / Float64(l * l))))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 3.4e-142) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l))))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 3.4e-142], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t * t), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.4 \cdot 10^{-142}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\ell \cdot \ell}}}\right)\\
\end{array}
\end{array}
if t < 3.40000000000000029e-142Initial program 90.2%
Taylor expanded in t around 0 51.0%
unpow251.0%
unpow251.0%
times-frac58.3%
unpow258.3%
Simplified58.3%
unpow257.3%
clear-num57.3%
un-div-inv57.3%
Applied egg-rr58.3%
if 3.40000000000000029e-142 < t Initial program 84.3%
unpow284.3%
clear-num84.3%
clear-num84.2%
frac-times84.2%
metadata-eval84.2%
Applied egg-rr84.2%
Taylor expanded in Om around 0 69.5%
associate-*r/69.5%
associate-/l*69.5%
unpow269.5%
unpow269.5%
times-frac82.6%
unpow282.6%
unpow282.6%
times-frac69.5%
unpow269.5%
unpow269.5%
associate-/l*69.5%
associate-*r/69.5%
*-commutative69.5%
associate-*l/69.5%
rem-square-sqrt69.3%
unpow269.3%
*-commutative69.3%
Simplified69.5%
Final simplification61.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 1.25e+171) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))) (asin (* (pow (/ Om Omc) 2.0) -0.5))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.25e+171) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((pow((Om / Omc), 2.0) * -0.5));
}
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 <= 1.25d+171) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((((om / omc) ** 2.0d0) * (-0.5d0)))
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 <= 1.25e+171) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((Math.pow((Om / Omc), 2.0) * -0.5));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 1.25e+171: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((math.pow((Om / Omc), 2.0) * -0.5)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.25e+171) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64((Float64(Om / Omc) ^ 2.0) * -0.5)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1.25e+171) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((((Om / Omc) ^ 2.0) * -0.5)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.25e+171], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+171}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left({\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right)\\
\end{array}
\end{array}
if t < 1.2500000000000001e171Initial program 88.9%
Taylor expanded in t around 0 48.7%
unpow248.7%
unpow248.7%
times-frac55.9%
unpow255.9%
Simplified55.9%
unpow255.1%
clear-num55.1%
un-div-inv55.1%
Applied egg-rr55.9%
if 1.2500000000000001e171 < t Initial program 80.8%
Taylor expanded in t around 0 8.9%
unpow28.9%
unpow28.9%
times-frac15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in Om around 0 8.9%
unpow28.9%
unpow28.9%
times-frac15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in Om around inf 26.8%
unpow226.8%
unpow226.8%
times-frac24.0%
unpow224.0%
Simplified24.0%
Final simplification53.6%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 1.6e+171) (asin (+ 1.0 (* (/ (/ Om Omc) (/ Omc Om)) -0.5))) (asin (* (pow (/ Om Omc) 2.0) -0.5))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.6e+171) {
tmp = asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5)));
} else {
tmp = asin((pow((Om / Omc), 2.0) * -0.5));
}
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 <= 1.6d+171) then
tmp = asin((1.0d0 + (((om / omc) / (omc / om)) * (-0.5d0))))
else
tmp = asin((((om / omc) ** 2.0d0) * (-0.5d0)))
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 <= 1.6e+171) {
tmp = Math.asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5)));
} else {
tmp = Math.asin((Math.pow((Om / Omc), 2.0) * -0.5));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 1.6e+171: tmp = math.asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5))) else: tmp = math.asin((math.pow((Om / Omc), 2.0) * -0.5)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.6e+171) tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) / Float64(Omc / Om)) * -0.5))); else tmp = asin(Float64((Float64(Om / Omc) ^ 2.0) * -0.5)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1.6e+171) tmp = asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5))); else tmp = asin((((Om / Omc) ^ 2.0) * -0.5)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.6e+171], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.6 \cdot 10^{+171}:\\
\;\;\;\;\sin^{-1} \left(1 + \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left({\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right)\\
\end{array}
\end{array}
if t < 1.60000000000000006e171Initial program 88.9%
Taylor expanded in t around 0 48.7%
unpow248.7%
unpow248.7%
times-frac55.9%
unpow255.9%
Simplified55.9%
Taylor expanded in Om around 0 48.0%
unpow248.0%
unpow248.0%
times-frac55.1%
unpow255.1%
Simplified55.1%
unpow255.1%
clear-num55.1%
un-div-inv55.1%
Applied egg-rr55.1%
if 1.60000000000000006e171 < t Initial program 80.8%
Taylor expanded in t around 0 8.9%
unpow28.9%
unpow28.9%
times-frac15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in Om around 0 8.9%
unpow28.9%
unpow28.9%
times-frac15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in Om around inf 26.8%
unpow226.8%
unpow226.8%
times-frac24.0%
unpow224.0%
Simplified24.0%
Final simplification52.9%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (+ 1.0 (* (/ (/ Om Omc) (/ Omc Om)) -0.5))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5)));
}
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 + (((om / omc) / (omc / om)) * (-0.5d0))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5)));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5)))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) / Float64(Omc / Om)) * -0.5))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 + (((Om / Omc) / (Omc / Om)) * -0.5))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(1 + \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}} \cdot -0.5\right)
\end{array}
Initial program 88.4%
Taylor expanded in t around 0 45.9%
unpow245.9%
unpow245.9%
times-frac53.0%
unpow253.0%
Simplified53.0%
Taylor expanded in Om around 0 45.2%
unpow245.2%
unpow245.2%
times-frac52.3%
unpow252.3%
Simplified52.3%
unpow252.3%
clear-num52.3%
un-div-inv52.3%
Applied egg-rr52.3%
Final simplification52.3%
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 88.4%
Taylor expanded in t around 0 45.9%
unpow245.9%
unpow245.9%
times-frac53.0%
unpow253.0%
Simplified53.0%
Taylor expanded in Om around 0 45.2%
unpow245.2%
unpow245.2%
times-frac52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in Om around 0 51.7%
Final simplification51.7%
herbie shell --seed 2023214
(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)))))))