
(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 10 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) -2e+155)
(asin (* t_2 (* (/ (sqrt 0.5) t) (- l))))
(if (<= (/ t l) 5e+76)
(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) <= -2e+155) {
tmp = asin((t_2 * ((sqrt(0.5) / t) * -l)));
} else if ((t / l) <= 5e+76) {
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) <= (-2d+155)) then
tmp = asin((t_2 * ((sqrt(0.5d0) / t) * -l)))
else if ((t / l) <= 5d+76) 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) <= -2e+155) {
tmp = Math.asin((t_2 * ((Math.sqrt(0.5) / t) * -l)));
} else if ((t / l) <= 5e+76) {
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) <= -2e+155: tmp = math.asin((t_2 * ((math.sqrt(0.5) / t) * -l))) elif (t / l) <= 5e+76: 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) <= -2e+155) tmp = asin(Float64(t_2 * Float64(Float64(sqrt(0.5) / t) * Float64(-l)))); elseif (Float64(t / l) <= 5e+76) 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) <= -2e+155) tmp = asin((t_2 * ((sqrt(0.5) / t) * -l))); elseif ((t / l) <= 5e+76) 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], -2e+155], N[ArcSin[N[(t$95$2 * N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+76], 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 -2 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(t_2 \cdot \left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+76}:\\
\;\;\;\;\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) < -2.00000000000000001e155Initial program 44.0%
unpow244.0%
Applied egg-rr44.0%
Taylor expanded in t around -inf 81.5%
mul-1-neg81.5%
*-commutative81.5%
distribute-rgt-neg-in81.5%
unpow281.5%
unpow281.5%
times-frac99.6%
unpow299.6%
associate-/l*96.2%
associate-/r/99.7%
Simplified99.7%
if -2.00000000000000001e155 < (/.f64 t l) < 4.99999999999999991e76Initial program 98.8%
unpow298.8%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
if 4.99999999999999991e76 < (/.f64 t l) Initial program 54.6%
sqrt-div54.6%
add-sqr-sqrt54.6%
hypot-1-def54.6%
*-commutative54.6%
sqrt-prod54.5%
unpow254.5%
sqrt-prod98.7%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
Taylor expanded in t around inf 89.7%
*-commutative89.7%
unpow289.7%
unpow289.7%
times-frac99.5%
unpow299.5%
Simplified99.5%
Final simplification99.1%
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.2%
sqrt-div81.2%
add-sqr-sqrt81.2%
hypot-1-def81.2%
*-commutative81.2%
sqrt-prod81.1%
unpow281.1%
sqrt-prod57.2%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
Final simplification98.1%
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) -2e+155)
(asin
(* (* (/ (sqrt 0.5) t) (- l)) (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc))))))
(if (<= (/ t l) 5e+76)
(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) <= -2e+155) {
tmp = asin((((sqrt(0.5) / t) * -l) * sqrt((1.0 - ((Om * Om) / (Omc * Omc))))));
} else if ((t / l) <= 5e+76) {
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) <= (-2d+155)) then
tmp = asin((((sqrt(0.5d0) / t) * -l) * sqrt((1.0d0 - ((om * om) / (omc * omc))))))
else if ((t / l) <= 5d+76) 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) <= -2e+155) {
tmp = Math.asin((((Math.sqrt(0.5) / t) * -l) * Math.sqrt((1.0 - ((Om * Om) / (Omc * Omc))))));
} else if ((t / l) <= 5e+76) {
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) <= -2e+155: tmp = math.asin((((math.sqrt(0.5) / t) * -l) * math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))))) elif (t / l) <= 5e+76: 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) <= -2e+155) tmp = asin(Float64(Float64(Float64(sqrt(0.5) / t) * Float64(-l)) * sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc)))))); elseif (Float64(t / l) <= 5e+76) 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) <= -2e+155) tmp = asin((((sqrt(0.5) / t) * -l) * sqrt((1.0 - ((Om * Om) / (Omc * Omc)))))); elseif ((t / l) <= 5e+76) 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], -2e+155], N[ArcSin[N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+76], 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 -2 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(\left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right) \cdot \sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+76}:\\
\;\;\;\;\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) < -2.00000000000000001e155Initial program 44.0%
Taylor expanded in t around inf 31.4%
associate-/l*31.4%
unpow231.4%
unpow231.4%
unpow231.4%
unpow231.4%
Simplified31.4%
Taylor expanded in l around -inf 81.5%
mul-1-neg81.5%
*-commutative81.5%
unpow281.5%
unpow281.5%
*-commutative81.5%
associate-*r/81.5%
Simplified81.5%
if -2.00000000000000001e155 < (/.f64 t l) < 4.99999999999999991e76Initial program 98.8%
unpow298.8%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
if 4.99999999999999991e76 < (/.f64 t l) Initial program 54.6%
sqrt-div54.6%
add-sqr-sqrt54.6%
hypot-1-def54.6%
*-commutative54.6%
sqrt-prod54.5%
unpow254.5%
sqrt-prod98.7%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
Taylor expanded in t around inf 89.7%
*-commutative89.7%
unpow289.7%
unpow289.7%
times-frac99.5%
unpow299.5%
Simplified99.5%
Final simplification96.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= Om 1.35e+154)
(asin
(/
(sqrt (- 1.0 (/ (/ (* Om Om) Omc) Omc)))
(hypot 1.0 (* (/ t l) (sqrt 2.0)))))
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (Om <= 1.35e+154) {
tmp = asin((sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
} else {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
}
return tmp;
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (Om <= 1.35e+154) {
tmp = Math.asin((Math.sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if Om <= 1.35e+154: tmp = math.asin((math.sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0))))) else: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Om <= 1.35e+154) tmp = asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Float64(Om * Om) / Omc) / Omc))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))); else tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (Om <= 1.35e+154) tmp = asin((sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / hypot(1.0, ((t / l) * sqrt(2.0))))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[Om, 1.35e+154], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(N[(Om * Om), $MachinePrecision] / Omc), $MachinePrecision] / Omc), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om \cdot Om}{Omc}}{Omc}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\end{array}
\end{array}
if Om < 1.35000000000000003e154Initial program 80.9%
sqrt-div80.9%
add-sqr-sqrt80.9%
hypot-1-def80.9%
*-commutative80.9%
sqrt-prod80.8%
unpow280.8%
sqrt-prod57.1%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
unpow298.1%
times-frac92.6%
associate-/r*97.3%
Applied egg-rr97.3%
if 1.35000000000000003e154 < Om Initial program 89.5%
unpow289.5%
Applied egg-rr89.5%
unpow289.5%
Applied egg-rr89.5%
Final simplification97.0%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+155)
(asin
(* (* (/ (sqrt 0.5) t) (- l)) (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc))))))
(if (<= (/ t l) 1e+140)
(asin
(sqrt
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+155) {
tmp = asin((((sqrt(0.5) / t) * -l) * sqrt((1.0 - ((Om * Om) / (Omc * Omc))))));
} else if ((t / l) <= 1e+140) {
tmp = asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} 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 / l) <= (-2d+155)) then
tmp = asin((((sqrt(0.5d0) / t) * -l) * sqrt((1.0d0 - ((om * om) / (omc * omc))))))
else if ((t / l) <= 1d+140) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
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 / l) <= -2e+155) {
tmp = Math.asin((((Math.sqrt(0.5) / t) * -l) * Math.sqrt((1.0 - ((Om * Om) / (Omc * Omc))))));
} else if ((t / l) <= 1e+140) {
tmp = Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} 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 / l) <= -2e+155: tmp = math.asin((((math.sqrt(0.5) / t) * -l) * math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))))) elif (t / l) <= 1e+140: tmp = math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))) 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 (Float64(t / l) <= -2e+155) tmp = asin(Float64(Float64(Float64(sqrt(0.5) / t) * Float64(-l)) * sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc)))))); elseif (Float64(t / l) <= 1e+140) 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))))))); 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 / l) <= -2e+155) tmp = asin((((sqrt(0.5) / t) * -l) * sqrt((1.0 - ((Om * Om) / (Omc * Omc)))))); elseif ((t / l) <= 1e+140) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))); 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[N[(t / l), $MachinePrecision], -2e+155], N[ArcSin[N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+140], 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], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(\left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right) \cdot \sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+140}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2.00000000000000001e155Initial program 44.0%
Taylor expanded in t around inf 31.4%
associate-/l*31.4%
unpow231.4%
unpow231.4%
unpow231.4%
unpow231.4%
Simplified31.4%
Taylor expanded in l around -inf 81.5%
mul-1-neg81.5%
*-commutative81.5%
unpow281.5%
unpow281.5%
*-commutative81.5%
associate-*r/81.5%
Simplified81.5%
if -2.00000000000000001e155 < (/.f64 t l) < 1.00000000000000006e140Initial program 98.9%
unpow298.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
if 1.00000000000000006e140 < (/.f64 t l) Initial program 38.7%
Taylor expanded in t around inf 37.0%
associate-/l*37.0%
unpow237.0%
unpow237.0%
unpow237.0%
unpow237.0%
Simplified37.0%
Taylor expanded in Om around 0 99.4%
Final simplification96.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+155)
(asin
(* (* (/ (sqrt 0.5) t) (- l)) (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc))))))
(if (<= (/ t l) 1e+138)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+155) {
tmp = asin((((sqrt(0.5) / t) * -l) * sqrt((1.0 - ((Om * Om) / (Omc * Omc))))));
} else if ((t / l) <= 1e+138) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} 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 / l) <= (-2d+155)) then
tmp = asin((((sqrt(0.5d0) / t) * -l) * sqrt((1.0d0 - ((om * om) / (omc * omc))))))
else if ((t / l) <= 1d+138) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
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 / l) <= -2e+155) {
tmp = Math.asin((((Math.sqrt(0.5) / t) * -l) * Math.sqrt((1.0 - ((Om * Om) / (Omc * Omc))))));
} else if ((t / l) <= 1e+138) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} 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 / l) <= -2e+155: tmp = math.asin((((math.sqrt(0.5) / t) * -l) * math.sqrt((1.0 - ((Om * Om) / (Omc * Omc)))))) elif (t / l) <= 1e+138: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) 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 (Float64(t / l) <= -2e+155) tmp = asin(Float64(Float64(Float64(sqrt(0.5) / t) * Float64(-l)) * sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * Omc)))))); elseif (Float64(t / l) <= 1e+138) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); 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 / l) <= -2e+155) tmp = asin((((sqrt(0.5) / t) * -l) * sqrt((1.0 - ((Om * Om) / (Omc * Omc)))))); elseif ((t / l) <= 1e+138) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); 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[N[(t / l), $MachinePrecision], -2e+155], N[ArcSin[N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+138], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $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}\;\frac{t}{\ell} \leq -2 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(\left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right) \cdot \sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+138}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2.00000000000000001e155Initial program 44.0%
Taylor expanded in t around inf 31.4%
associate-/l*31.4%
unpow231.4%
unpow231.4%
unpow231.4%
unpow231.4%
Simplified31.4%
Taylor expanded in l around -inf 81.5%
mul-1-neg81.5%
*-commutative81.5%
unpow281.5%
unpow281.5%
*-commutative81.5%
associate-*r/81.5%
Simplified81.5%
if -2.00000000000000001e155 < (/.f64 t l) < 1e138Initial program 98.9%
unpow298.9%
Applied egg-rr98.9%
unpow298.9%
Applied egg-rr98.9%
if 1e138 < (/.f64 t l) Initial program 40.0%
Taylor expanded in t around inf 36.3%
associate-/l*36.3%
unpow236.3%
unpow236.3%
unpow236.3%
unpow236.3%
Simplified36.3%
Taylor expanded in Om around 0 99.4%
Final simplification96.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) 1e+138)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= 1e+138) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} 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 / l) <= 1d+138) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
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 / l) <= 1e+138) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} 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 / l) <= 1e+138: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) 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 (Float64(t / l) <= 1e+138) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); 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 / l) <= 1e+138) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); 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[N[(t / l), $MachinePrecision], 1e+138], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $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}\;\frac{t}{\ell} \leq 10^{+138}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 1e138Initial program 90.3%
unpow290.3%
Applied egg-rr90.3%
unpow290.3%
Applied egg-rr90.3%
if 1e138 < (/.f64 t l) Initial program 40.0%
Taylor expanded in t around inf 36.3%
associate-/l*36.3%
unpow236.3%
unpow236.3%
unpow236.3%
unpow236.3%
Simplified36.3%
Taylor expanded in Om around 0 99.4%
Final simplification91.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -200000.0)
(asin (sqrt (* 0.5 (/ (* l l) (* t t)))))
(if (<= (/ t l) 0.5)
(asin (sqrt (- 1.0 (/ (* Om Om) (* Omc Omc)))))
(asin (* l (/ (sqrt 0.5) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -200000.0) {
tmp = asin(sqrt((0.5 * ((l * l) / (t * t)))));
} else if ((t / l) <= 0.5) {
tmp = asin(sqrt((1.0 - ((Om * Om) / (Omc * 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 / l) <= (-200000.0d0)) then
tmp = asin(sqrt((0.5d0 * ((l * l) / (t * t)))))
else if ((t / l) <= 0.5d0) then
tmp = asin(sqrt((1.0d0 - ((om * om) / (omc * 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 / l) <= -200000.0) {
tmp = Math.asin(Math.sqrt((0.5 * ((l * l) / (t * t)))));
} else if ((t / l) <= 0.5) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om * Om) / (Omc * 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 / l) <= -200000.0: tmp = math.asin(math.sqrt((0.5 * ((l * l) / (t * t))))) elif (t / l) <= 0.5: tmp = math.asin(math.sqrt((1.0 - ((Om * Om) / (Omc * 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 (Float64(t / l) <= -200000.0) tmp = asin(sqrt(Float64(0.5 * Float64(Float64(l * l) / Float64(t * t))))); elseif (Float64(t / l) <= 0.5) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om * Om) / Float64(Omc * 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 / l) <= -200000.0) tmp = asin(sqrt((0.5 * ((l * l) / (t * t))))); elseif ((t / l) <= 0.5) tmp = asin(sqrt((1.0 - ((Om * Om) / (Omc * 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[N[(t / l), $MachinePrecision], -200000.0], N[ArcSin[N[Sqrt[N[(0.5 * N[(N[(l * l), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.5], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om * Om), $MachinePrecision] / N[(Omc * 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}\;\frac{t}{\ell} \leq -200000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5 \cdot \frac{\ell \cdot \ell}{t \cdot t}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.5:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om \cdot Om}{Omc \cdot Omc}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e5Initial program 68.9%
Taylor expanded in t around inf 32.7%
associate-/l*32.7%
unpow232.7%
unpow232.7%
unpow232.7%
unpow232.7%
Simplified32.7%
Taylor expanded in Om around 0 40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
if -2e5 < (/.f64 t l) < 0.5Initial program 98.6%
Taylor expanded in t around 0 89.9%
unpow289.9%
unpow289.9%
Simplified89.9%
if 0.5 < (/.f64 t l) Initial program 62.1%
Taylor expanded in t around inf 32.6%
associate-/l*32.6%
unpow232.6%
unpow232.6%
unpow232.6%
unpow232.6%
Simplified32.6%
Taylor expanded in Om around 0 98.3%
*-commutative98.3%
associate-*r/98.3%
Simplified98.3%
Final simplification80.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -1.15e-252) (asin (sqrt (* 0.5 (/ (* l l) (* t t))))) (asin (* l (/ (sqrt 0.5) t)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.15e-252) {
tmp = asin(sqrt((0.5 * ((l * l) / (t * t)))));
} 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 (l <= (-1.15d-252)) then
tmp = asin(sqrt((0.5d0 * ((l * l) / (t * t)))))
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 (l <= -1.15e-252) {
tmp = Math.asin(Math.sqrt((0.5 * ((l * l) / (t * t)))));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -1.15e-252: tmp = math.asin(math.sqrt((0.5 * ((l * l) / (t * t))))) 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 (l <= -1.15e-252) tmp = asin(sqrt(Float64(0.5 * Float64(Float64(l * l) / Float64(t * t))))); 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 (l <= -1.15e-252) tmp = asin(sqrt((0.5 * ((l * l) / (t * t))))); 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[l, -1.15e-252], N[ArcSin[N[Sqrt[N[(0.5 * N[(N[(l * l), $MachinePrecision] / N[(t * t), $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}\;\ell \leq -1.15 \cdot 10^{-252}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5 \cdot \frac{\ell \cdot \ell}{t \cdot t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if l < -1.1499999999999999e-252Initial program 82.7%
Taylor expanded in t around inf 14.2%
associate-/l*14.2%
unpow214.2%
unpow214.2%
unpow214.2%
unpow214.2%
Simplified14.2%
Taylor expanded in Om around 0 15.9%
unpow215.9%
unpow215.9%
Simplified15.9%
if -1.1499999999999999e-252 < l Initial program 79.6%
Taylor expanded in t around inf 19.9%
associate-/l*19.9%
unpow219.9%
unpow219.9%
unpow219.9%
unpow219.9%
Simplified19.9%
Taylor expanded in Om around 0 36.4%
*-commutative36.4%
associate-*r/36.4%
Simplified36.4%
Final simplification25.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (* l (/ (sqrt 0.5) t))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((l * (sqrt(0.5) / 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((l * (sqrt(0.5d0) / t)))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((l * (Math.sqrt(0.5) / t)));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((l * (math.sqrt(0.5) / t)))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(l * Float64(sqrt(0.5) / t))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((l * (sqrt(0.5) / t))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)
\end{array}
Initial program 81.2%
Taylor expanded in t around inf 16.9%
associate-/l*16.9%
unpow216.9%
unpow216.9%
unpow216.9%
unpow216.9%
Simplified16.9%
Taylor expanded in Om around 0 33.8%
*-commutative33.8%
associate-*r/33.8%
Simplified33.8%
Final simplification33.8%
herbie shell --seed 2023257
(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)))))))