
(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 13 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 (pow (/ Om Omc) 2.0)))
(if (<= (/ t l) -2e+156)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 5e+115)
(asin (sqrt (/ (- 1.0 t_1) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (/ (sqrt (+ 0.5 (* t_1 -0.5))) (/ t l)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -2e+156) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 5e+115) {
tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((sqrt((0.5 + (t_1 * -0.5))) / (t / 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) :: t_1
real(8) :: tmp
t_1 = (om / omc) ** 2.0d0
if ((t / l) <= (-2d+156)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 5d+115) then
tmp = asin(sqrt(((1.0d0 - t_1) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((sqrt((0.5d0 + (t_1 * (-0.5d0)))) / (t / l)))
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.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -2e+156) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 5e+115) {
tmp = Math.asin(Math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((Math.sqrt((0.5 + (t_1 * -0.5))) / (t / l)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -2e+156: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 5e+115: tmp = math.asin(math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((math.sqrt((0.5 + (t_1 * -0.5))) / (t / l))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(Om / Omc) ^ 2.0 tmp = 0.0 if (Float64(t / l) <= -2e+156) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 5e+115) tmp = asin(sqrt(Float64(Float64(1.0 - t_1) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(sqrt(Float64(0.5 + Float64(t_1 * -0.5))) / Float64(t / l))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = (Om / Omc) ^ 2.0; tmp = 0.0; if ((t / l) <= -2e+156) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 5e+115) tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((sqrt((0.5 + (t_1 * -0.5))) / (t / l))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -2e+156], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+115], N[ArcSin[N[Sqrt[N[(N[(1.0 - t$95$1), $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[Sqrt[N[(0.5 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+156}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+115}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5 + t_1 \cdot -0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e156Initial program 47.5%
Taylor expanded in t around -inf 85.4%
mul-1-neg85.4%
*-commutative85.4%
distribute-rgt-neg-in85.4%
unpow285.4%
unpow285.4%
times-frac99.6%
unpow299.6%
*-commutative99.6%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in Om around 0 99.7%
if -2e156 < (/.f64 t l) < 5.00000000000000008e115Initial program 98.9%
unpow298.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
if 5.00000000000000008e115 < (/.f64 t l) Initial program 58.3%
Taylor expanded in t around inf 86.9%
*-commutative86.9%
unpow286.9%
unpow286.9%
associate-/l*86.9%
Simplified86.9%
expm1-log1p-u86.9%
expm1-udef35.4%
associate-*r/35.4%
pow1/235.4%
times-frac42.2%
unpow242.2%
pow1/242.2%
pow-prod-down42.2%
Applied egg-rr42.2%
expm1-def99.7%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.2%
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 (sqrt 2.0)) l)))))
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 * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
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 * math.sqrt(2.0)) / l))))
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 * sqrt(2.0)) / l)))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l)))); end
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 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 84.4%
sqrt-div84.3%
div-inv84.3%
add-sqr-sqrt84.3%
hypot-1-def84.3%
*-commutative84.3%
sqrt-prod84.3%
unpow284.3%
sqrt-prod59.1%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*l/98.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 (pow (/ Om Omc) 2.0)))
(if (<= (/ t l) -5e+24)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 1e+39)
(asin (sqrt (/ (- 1.0 t_1) (+ 1.0 (* 2.0 (/ (* t (/ t l)) l))))))
(asin (/ (sqrt (+ 0.5 (* t_1 -0.5))) (/ t l)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -5e+24) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 1e+39) {
tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = asin((sqrt((0.5 + (t_1 * -0.5))) / (t / 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) :: t_1
real(8) :: tmp
t_1 = (om / omc) ** 2.0d0
if ((t / l) <= (-5d+24)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 1d+39) then
tmp = asin(sqrt(((1.0d0 - t_1) / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
else
tmp = asin((sqrt((0.5d0 + (t_1 * (-0.5d0)))) / (t / l)))
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.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -5e+24) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 1e+39) {
tmp = Math.asin(Math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = Math.asin((Math.sqrt((0.5 + (t_1 * -0.5))) / (t / l)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -5e+24: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 1e+39: tmp = math.asin(math.sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t * (t / l)) / l)))))) else: tmp = math.asin((math.sqrt((0.5 + (t_1 * -0.5))) / (t / l))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(Om / Omc) ^ 2.0 tmp = 0.0 if (Float64(t / l) <= -5e+24) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 1e+39) tmp = asin(sqrt(Float64(Float64(1.0 - t_1) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l)))))); else tmp = asin(Float64(sqrt(Float64(0.5 + Float64(t_1 * -0.5))) / Float64(t / l))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = (Om / Omc) ^ 2.0; tmp = 0.0; if ((t / l) <= -5e+24) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 1e+39) tmp = asin(sqrt(((1.0 - t_1) / (1.0 + (2.0 * ((t * (t / l)) / l)))))); else tmp = asin((sqrt((0.5 + (t_1 * -0.5))) / (t / l))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -5e+24], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+39], N[ArcSin[N[Sqrt[N[(N[(1.0 - t$95$1), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[N[(0.5 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+24}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+39}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - t_1}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5 + t_1 \cdot -0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5.00000000000000045e24Initial program 69.2%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
unpow286.2%
unpow286.2%
times-frac99.4%
unpow299.4%
*-commutative99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -5.00000000000000045e24 < (/.f64 t l) < 9.9999999999999994e38Initial program 98.7%
unpow298.7%
associate-*r/98.0%
Applied egg-rr98.0%
if 9.9999999999999994e38 < (/.f64 t l) Initial program 67.2%
Taylor expanded in t around inf 87.8%
*-commutative87.8%
unpow287.8%
unpow287.8%
associate-/l*87.9%
Simplified87.9%
expm1-log1p-u87.9%
expm1-udef28.5%
associate-*r/28.5%
pow1/228.5%
times-frac33.8%
unpow233.8%
pow1/233.8%
pow-prod-down33.8%
Applied egg-rr33.8%
expm1-def99.5%
expm1-log1p99.5%
Simplified99.5%
Final simplification98.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (pow (/ Om Omc) 2.0)))
(if (<= (/ t l) -50.0)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 2e-8)
(asin (sqrt (- 1.0 t_1)))
(asin (/ (sqrt (+ 0.5 (* t_1 -0.5))) (/ t l)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -50.0) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 2e-8) {
tmp = asin(sqrt((1.0 - t_1)));
} else {
tmp = asin((sqrt((0.5 + (t_1 * -0.5))) / (t / 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) :: t_1
real(8) :: tmp
t_1 = (om / omc) ** 2.0d0
if ((t / l) <= (-50.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 2d-8) then
tmp = asin(sqrt((1.0d0 - t_1)))
else
tmp = asin((sqrt((0.5d0 + (t_1 * (-0.5d0)))) / (t / l)))
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.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -50.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 2e-8) {
tmp = Math.asin(Math.sqrt((1.0 - t_1)));
} else {
tmp = Math.asin((Math.sqrt((0.5 + (t_1 * -0.5))) / (t / l)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -50.0: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 2e-8: tmp = math.asin(math.sqrt((1.0 - t_1))) else: tmp = math.asin((math.sqrt((0.5 + (t_1 * -0.5))) / (t / l))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(Om / Omc) ^ 2.0 tmp = 0.0 if (Float64(t / l) <= -50.0) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 2e-8) tmp = asin(sqrt(Float64(1.0 - t_1))); else tmp = asin(Float64(sqrt(Float64(0.5 + Float64(t_1 * -0.5))) / Float64(t / l))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = (Om / Omc) ^ 2.0; tmp = 0.0; if ((t / l) <= -50.0) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 2e-8) tmp = asin(sqrt((1.0 - t_1))); else tmp = asin((sqrt((0.5 + (t_1 * -0.5))) / (t / l))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -50.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-8], N[ArcSin[N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[N[(0.5 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -50:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5 + t_1 \cdot -0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -50Initial program 71.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
unpow287.2%
unpow287.2%
times-frac99.4%
unpow299.4%
*-commutative99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -50 < (/.f64 t l) < 2e-8Initial program 98.6%
Taylor expanded in t around 0 84.9%
unpow284.9%
unpow284.9%
times-frac98.5%
unpow298.5%
Simplified98.5%
if 2e-8 < (/.f64 t l) Initial program 72.9%
Taylor expanded in t around inf 86.7%
*-commutative86.7%
unpow286.7%
unpow286.7%
associate-/l*86.8%
Simplified86.8%
expm1-log1p-u86.8%
expm1-udef27.3%
associate-*r/27.3%
pow1/227.3%
times-frac31.8%
unpow231.8%
pow1/231.8%
pow-prod-down31.8%
Applied egg-rr31.8%
expm1-def97.7%
expm1-log1p97.7%
Simplified97.7%
Final simplification98.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50.0)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 2e-8)
(asin (sqrt (- 1.0 (pow (/ Om Omc) 2.0))))
(asin (/ (sqrt 0.5) (/ t l))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50.0) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 2e-8) {
tmp = asin(sqrt((1.0 - pow((Om / Omc), 2.0))));
} else {
tmp = asin((sqrt(0.5) / (t / 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 / l) <= (-50.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 2d-8) then
tmp = asin(sqrt((1.0d0 - ((om / omc) ** 2.0d0))))
else
tmp = asin((sqrt(0.5d0) / (t / 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 / l) <= -50.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 2e-8) {
tmp = Math.asin(Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50.0: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 2e-8: tmp = math.asin(math.sqrt((1.0 - math.pow((Om / Omc), 2.0)))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50.0) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 2e-8) tmp = asin(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50.0) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 2e-8) tmp = asin(sqrt((1.0 - ((Om / Omc) ^ 2.0)))); else tmp = asin((sqrt(0.5) / (t / l))); 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], -50.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-8], N[ArcSin[N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -50Initial program 71.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
unpow287.2%
unpow287.2%
times-frac99.4%
unpow299.4%
*-commutative99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -50 < (/.f64 t l) < 2e-8Initial program 98.6%
Taylor expanded in t around 0 84.9%
unpow284.9%
unpow284.9%
times-frac98.5%
unpow298.5%
Simplified98.5%
if 2e-8 < (/.f64 t l) Initial program 72.9%
Taylor expanded in t around inf 86.7%
*-commutative86.7%
unpow286.7%
unpow286.7%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in Om around 0 96.9%
Final simplification98.3%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (or (<= (/ t l) -1e+221) (not (<= (/ t l) 2e-8))) (asin (/ (sqrt 0.5) (/ t l))) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((t / l) <= -1e+221) || !((t / l) <= 2e-8)) {
tmp = asin((sqrt(0.5) / (t / l)));
} else {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
}
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+221)) .or. (.not. ((t / l) <= 2d-8))) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
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+221) || !((t / l) <= 2e-8)) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if ((t / l) <= -1e+221) or not ((t / l) <= 2e-8): tmp = math.asin((math.sqrt(0.5) / (t / l))) else: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if ((Float64(t / l) <= -1e+221) || !(Float64(t / l) <= 2e-8)) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); else tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (((t / l) <= -1e+221) || ~(((t / l) <= 2e-8))) tmp = asin((sqrt(0.5) / (t / l))); else tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[Or[LessEqual[N[(t / l), $MachinePrecision], -1e+221], N[Not[LessEqual[N[(t / l), $MachinePrecision], 2e-8]], $MachinePrecision]], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+221} \lor \neg \left(\frac{t}{\ell} \leq 2 \cdot 10^{-8}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e221 or 2e-8 < (/.f64 t l) Initial program 69.4%
Taylor expanded in t around inf 76.2%
*-commutative76.2%
unpow276.2%
unpow276.2%
associate-/l*76.2%
Simplified76.2%
Taylor expanded in Om around 0 86.8%
if -1e221 < (/.f64 t l) < 2e-8Initial program 94.0%
Taylor expanded in t around 0 65.6%
unpow265.6%
unpow265.6%
Simplified65.6%
Taylor expanded in Om around 0 65.1%
unpow265.1%
unpow265.1%
times-frac75.4%
unpow275.4%
Simplified75.4%
unpow275.4%
Applied egg-rr75.4%
Final simplification79.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50.0)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 2e-8)
(asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))
(asin (/ (sqrt 0.5) (/ t l))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50.0) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 2e-8) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin((sqrt(0.5) / (t / 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 / l) <= (-50.0d0)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 2d-8) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin((sqrt(0.5d0) / (t / 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 / l) <= -50.0) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 2e-8) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50.0: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 2e-8: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50.0) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 2e-8) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50.0) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 2e-8) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin((sqrt(0.5) / (t / l))); 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], -50.0], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-8], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -50Initial program 71.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
*-commutative87.2%
unpow287.2%
unpow287.2%
associate-/l*86.2%
Simplified86.2%
Taylor expanded in t around 0 87.2%
associate-*r/87.1%
Simplified87.1%
Taylor expanded in Om around 0 99.4%
if -50 < (/.f64 t l) < 2e-8Initial program 98.6%
Taylor expanded in t around 0 84.9%
unpow284.9%
unpow284.9%
Simplified84.9%
Taylor expanded in Om around 0 84.2%
unpow284.2%
unpow284.2%
times-frac97.7%
unpow297.7%
Simplified97.7%
unpow297.7%
Applied egg-rr97.7%
if 2e-8 < (/.f64 t l) Initial program 72.9%
Taylor expanded in t around inf 86.7%
*-commutative86.7%
unpow286.7%
unpow286.7%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in Om around 0 96.9%
Final simplification97.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50.0)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 2e-8)
(asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))
(asin (/ (sqrt 0.5) (/ t l))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50.0) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 2e-8) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin((sqrt(0.5) / (t / 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 / l) <= (-50.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 2d-8) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin((sqrt(0.5d0) / (t / 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 / l) <= -50.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 2e-8) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50.0: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 2e-8: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50.0) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 2e-8) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50.0) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 2e-8) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin((sqrt(0.5) / (t / l))); 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], -50.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-8], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -50Initial program 71.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
unpow287.2%
unpow287.2%
times-frac99.4%
unpow299.4%
*-commutative99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -50 < (/.f64 t l) < 2e-8Initial program 98.6%
Taylor expanded in t around 0 84.9%
unpow284.9%
unpow284.9%
Simplified84.9%
Taylor expanded in Om around 0 84.2%
unpow284.2%
unpow284.2%
times-frac97.7%
unpow297.7%
Simplified97.7%
unpow297.7%
Applied egg-rr97.7%
if 2e-8 < (/.f64 t l) Initial program 72.9%
Taylor expanded in t around inf 86.7%
*-commutative86.7%
unpow286.7%
unpow286.7%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in Om around 0 96.9%
Final simplification97.9%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 1.34e+73) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))) (asin (* l (/ (sqrt 0.5) t)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.34e+73) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin((l * (sqrt(0.5) / 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 <= 1.34d+73) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin((l * (sqrt(0.5d0) / 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 <= 1.34e+73) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 1.34e+73: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.34e+73) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1.34e+73) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.34e+73], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.34 \cdot 10^{+73}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 1.34e73Initial program 87.1%
Taylor expanded in t around 0 46.8%
unpow246.8%
unpow246.8%
Simplified46.8%
Taylor expanded in Om around 0 46.4%
unpow246.4%
unpow246.4%
times-frac53.7%
unpow253.7%
Simplified53.7%
unpow253.7%
Applied egg-rr53.7%
if 1.34e73 < t Initial program 72.0%
Taylor expanded in t around inf 34.8%
associate-/l*34.8%
unpow234.8%
unpow234.8%
unpow234.8%
unpow234.8%
Simplified34.8%
Taylor expanded in Om around 0 60.6%
associate-*r/60.6%
Simplified60.6%
Taylor expanded in l around 0 60.6%
associate-*l/60.6%
*-commutative60.6%
Simplified60.6%
Final simplification54.9%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 6.6e+72) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))) (asin (/ (* l (sqrt 0.5)) t))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 6.6e+72) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin(((l * sqrt(0.5)) / 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 <= 6.6d+72) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin(((l * sqrt(0.5d0)) / 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 <= 6.6e+72) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 6.6e+72: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 6.6e+72) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 6.6e+72) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 6.6e+72], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.6 \cdot 10^{+72}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 6.6e72Initial program 87.1%
Taylor expanded in t around 0 46.8%
unpow246.8%
unpow246.8%
Simplified46.8%
Taylor expanded in Om around 0 46.4%
unpow246.4%
unpow246.4%
times-frac53.7%
unpow253.7%
Simplified53.7%
unpow253.7%
Applied egg-rr53.7%
if 6.6e72 < t Initial program 72.0%
Taylor expanded in t around inf 34.8%
associate-/l*34.8%
unpow234.8%
unpow234.8%
unpow234.8%
unpow234.8%
Simplified34.8%
Taylor expanded in Om around 0 60.6%
Final simplification55.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 1.18e+73) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))) (asin (/ l (* t (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.18e+73) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} 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 <= 1.18d+73) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
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 <= 1.18e+73) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} 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 <= 1.18e+73: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) 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 (t <= 1.18e+73) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1.18e+73) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); 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[t, 1.18e+73], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.18 \cdot 10^{+73}:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 1.18000000000000004e73Initial program 87.1%
Taylor expanded in t around 0 46.8%
unpow246.8%
unpow246.8%
Simplified46.8%
Taylor expanded in Om around 0 46.4%
unpow246.4%
unpow246.4%
times-frac53.7%
unpow253.7%
Simplified53.7%
unpow253.7%
Applied egg-rr53.7%
if 1.18000000000000004e73 < t Initial program 72.0%
sqrt-div72.0%
div-inv72.0%
add-sqr-sqrt72.0%
hypot-1-def72.0%
*-commutative72.0%
sqrt-prod71.9%
unpow271.9%
sqrt-prod58.3%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 50.9%
*-commutative50.9%
unpow250.9%
unpow250.9%
times-frac61.7%
unpow261.7%
Simplified61.7%
Taylor expanded in Om around 0 60.6%
Final simplification54.9%
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 84.4%
Taylor expanded in t around 0 41.7%
unpow241.7%
unpow241.7%
Simplified41.7%
Taylor expanded in Om around 0 41.3%
unpow241.3%
unpow241.3%
times-frac47.8%
unpow247.8%
Simplified47.8%
unpow247.8%
Applied egg-rr47.8%
Final simplification47.8%
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 84.4%
Taylor expanded in t around 0 41.7%
unpow241.7%
unpow241.7%
Simplified41.7%
Taylor expanded in Om around 0 47.6%
Final simplification47.6%
herbie shell --seed 2023217
(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)))))))