
(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}
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0))))
(if (<= (/ t_1 (+ 1.0 (* 2.0 (pow (/ t_m l_m) 2.0)))) 0.0)
(asin (* (sqrt t_1) (* l_m (/ (sqrt 0.5) t_m))))
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ 1.0 (* (/ l_m t_m) (/ l_m t_m)))))))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double tmp;
if ((t_1 / (1.0 + (2.0 * pow((t_m / l_m), 2.0)))) <= 0.0) {
tmp = asin((sqrt(t_1) * (l_m * (sqrt(0.5) / t_m))));
} else {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m))))))));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
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_1 / (1.0d0 + (2.0d0 * ((t_m / l_m) ** 2.0d0)))) <= 0.0d0) then
tmp = asin((sqrt(t_1) * (l_m * (sqrt(0.5d0) / t_m))))
else
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * (1.0d0 / ((l_m / t_m) * (l_m / t_m))))))))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double tmp;
if ((t_1 / (1.0 + (2.0 * Math.pow((t_m / l_m), 2.0)))) <= 0.0) {
tmp = Math.asin((Math.sqrt(t_1) * (l_m * (Math.sqrt(0.5) / t_m))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m))))))));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) tmp = 0 if (t_1 / (1.0 + (2.0 * math.pow((t_m / l_m), 2.0)))) <= 0.0: tmp = math.asin((math.sqrt(t_1) * (l_m * (math.sqrt(0.5) / t_m)))) else: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m)))))))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) tmp = 0.0 if (Float64(t_1 / Float64(1.0 + Float64(2.0 * (Float64(t_m / l_m) ^ 2.0)))) <= 0.0) tmp = asin(Float64(sqrt(t_1) * Float64(l_m * Float64(sqrt(0.5) / t_m)))); else tmp = 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_m / t_m) * Float64(l_m / t_m)))))))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); tmp = 0.0; if ((t_1 / (1.0 + (2.0 * ((t_m / l_m) ^ 2.0)))) <= 0.0) tmp = asin((sqrt(t_1) * (l_m * (sqrt(0.5) / t_m)))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m)))))))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
l_m = N[Abs[l], $MachinePrecision]
code[t$95$m_, l$95$m_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 / N[(1.0 + N[(2.0 * N[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[ArcSin[N[(N[Sqrt[t$95$1], $MachinePrecision] * N[(l$95$m * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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$95$m / t$95$m), $MachinePrecision] * N[(l$95$m / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t\_1}{1 + 2 \cdot {\left(\frac{t\_m}{l\_m}\right)}^{2}} \leq 0:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t\_1} \cdot \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{1}{\frac{l\_m}{t\_m} \cdot \frac{l\_m}{t\_m}}}}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 #s(literal 1 binary64) (pow.f64 (/.f64 Om Omc) #s(literal 2 binary64))) (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) (pow.f64 (/.f64 t l) #s(literal 2 binary64))))) < 0.0Initial program 37.7%
Taylor expanded in t around inf 60.9%
*-commutative60.9%
unpow260.9%
unpow260.9%
times-frac67.9%
unpow267.9%
associate-/l*68.1%
Simplified68.1%
if 0.0 < (/.f64 (-.f64 #s(literal 1 binary64) (pow.f64 (/.f64 Om Omc) #s(literal 2 binary64))) (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) (pow.f64 (/.f64 t l) #s(literal 2 binary64))))) Initial program 98.7%
unpow298.7%
clear-num98.7%
clear-num98.7%
frac-times98.8%
metadata-eval98.8%
Applied egg-rr98.8%
unpow298.8%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (/ (* t_m (sqrt 2.0)) l_m)))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t_m * sqrt(2.0)) / l_m))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t_m * Math.sqrt(2.0)) / l_m))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t_m * math.sqrt(2.0)) / l_m))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t_m * sqrt(2.0)) / l_m)))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t_m * sqrt(2.0)) / l_m)))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, 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$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t\_m \cdot \sqrt{2}}{l\_m}\right)}\right)
\end{array}
Initial program 81.6%
sqrt-div81.5%
div-inv81.5%
add-sqr-sqrt81.5%
hypot-1-def81.5%
*-commutative81.5%
sqrt-prod81.4%
sqrt-pow198.2%
metadata-eval98.2%
pow198.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.4%
Simplified98.4%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (sqrt 2.0) (/ t_m l_m))))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, (sqrt(2.0) * (t_m / l_m)))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, (Math.sqrt(2.0) * (t_m / l_m)))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, (math.sqrt(2.0) * (t_m / l_m)))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(sqrt(2.0) * Float64(t_m / l_m))))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, (sqrt(2.0) * (t_m / l_m))))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, 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[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \sqrt{2} \cdot \frac{t\_m}{l\_m}\right)}\right)
\end{array}
Initial program 81.6%
sqrt-div81.5%
add-sqr-sqrt81.5%
hypot-1-def81.5%
*-commutative81.5%
sqrt-prod81.4%
sqrt-pow198.2%
metadata-eval98.2%
pow198.2%
Applied egg-rr98.2%
Final simplification98.2%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (/ (* t_m (sqrt 2.0)) l_m)))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t_m * sqrt(2.0)) / l_m))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t_m * Math.sqrt(2.0)) / l_m))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t_m * math.sqrt(2.0)) / l_m))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t_m * sqrt(2.0)) / l_m)))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t_m * sqrt(2.0)) / l_m)))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t\_m \cdot \sqrt{2}}{l\_m}\right)}\right)
\end{array}
Initial program 81.6%
sqrt-div81.5%
div-inv81.5%
add-sqr-sqrt81.5%
hypot-1-def81.5%
*-commutative81.5%
sqrt-prod81.4%
sqrt-pow198.2%
metadata-eval98.2%
pow198.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in Om around 0 97.2%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(if (<= (/ t_m l_m) 2e+129)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ 1.0 (* (/ l_m t_m) (/ l_m t_m))))))))
(asin (* l_m (/ 1.0 (* t_m (sqrt 2.0)))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 2e+129) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m))))))));
} else {
tmp = asin((l_m * (1.0 / (t_m * sqrt(2.0)))));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l_m) <= 2d+129) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * (1.0d0 / ((l_m / t_m) * (l_m / t_m))))))))
else
tmp = asin((l_m * (1.0d0 / (t_m * sqrt(2.0d0)))))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 2e+129) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m))))))));
} else {
tmp = Math.asin((l_m * (1.0 / (t_m * Math.sqrt(2.0)))));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if (t_m / l_m) <= 2e+129: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m)))))))) else: tmp = math.asin((l_m * (1.0 / (t_m * math.sqrt(2.0))))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (Float64(t_m / l_m) <= 2e+129) tmp = 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_m / t_m) * Float64(l_m / t_m)))))))); else tmp = asin(Float64(l_m * Float64(1.0 / Float64(t_m * sqrt(2.0))))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if ((t_m / l_m) <= 2e+129) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (1.0 / ((l_m / t_m) * (l_m / t_m)))))))); else tmp = asin((l_m * (1.0 / (t_m * sqrt(2.0))))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l$95$m), $MachinePrecision], 2e+129], 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$95$m / t$95$m), $MachinePrecision] * N[(l$95$m / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l$95$m * N[(1.0 / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t\_m}{l\_m} \leq 2 \cdot 10^{+129}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{1}{\frac{l\_m}{t\_m} \cdot \frac{l\_m}{t\_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{1}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2e129Initial program 88.4%
unpow288.4%
clear-num88.4%
clear-num88.4%
frac-times88.5%
metadata-eval88.5%
Applied egg-rr88.5%
unpow288.5%
clear-num88.5%
un-div-inv88.5%
Applied egg-rr88.5%
if 2e129 < (/.f64 t l) Initial program 45.5%
sqrt-div45.5%
div-inv45.5%
add-sqr-sqrt45.5%
hypot-1-def45.5%
*-commutative45.5%
sqrt-prod45.5%
sqrt-pow196.5%
metadata-eval96.5%
pow196.5%
Applied egg-rr96.5%
associate-*r/96.4%
*-rgt-identity96.4%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in Om around 0 94.7%
Taylor expanded in t around inf 97.5%
div-inv97.7%
*-commutative97.7%
Applied egg-rr97.7%
Final simplification90.0%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(if (<= l_m 6e-135)
(asin (* l_m (/ 1.0 (* t_m (sqrt 2.0)))))
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (* t_m (/ t_m l_m)) l_m))))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if (l_m <= 6e-135) {
tmp = asin((l_m * (1.0 / (t_m * sqrt(2.0)))));
} else {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l_m)) / l_m))))));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l_m <= 6d-135) then
tmp = asin((l_m * (1.0d0 / (t_m * sqrt(2.0d0)))))
else
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m * (t_m / l_m)) / l_m))))))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if (l_m <= 6e-135) {
tmp = Math.asin((l_m * (1.0 / (t_m * Math.sqrt(2.0)))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l_m)) / l_m))))));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if l_m <= 6e-135: tmp = math.asin((l_m * (1.0 / (t_m * math.sqrt(2.0))))) else: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l_m)) / l_m)))))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (l_m <= 6e-135) tmp = asin(Float64(l_m * Float64(1.0 / Float64(t_m * sqrt(2.0))))); else tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m * Float64(t_m / l_m)) / l_m)))))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if (l_m <= 6e-135) tmp = asin((l_m * (1.0 / (t_m * sqrt(2.0))))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l_m)) / l_m)))))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[LessEqual[l$95$m, 6e-135], N[ArcSin[N[(l$95$m * N[(1.0 / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t$95$m * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 6 \cdot 10^{-135}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{1}{t\_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t\_m \cdot \frac{t\_m}{l\_m}}{l\_m}}}\right)\\
\end{array}
\end{array}
if l < 6.00000000000000024e-135Initial program 78.6%
sqrt-div78.5%
div-inv78.5%
add-sqr-sqrt78.5%
hypot-1-def78.5%
*-commutative78.5%
sqrt-prod78.5%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 33.8%
div-inv33.8%
*-commutative33.8%
Applied egg-rr33.8%
if 6.00000000000000024e-135 < l Initial program 87.4%
unpow287.4%
associate-*r/84.1%
Applied egg-rr84.1%
unpow287.5%
clear-num87.5%
un-div-inv87.5%
Applied egg-rr84.1%
Final simplification50.7%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(let* ((t_1 (* t_m (sqrt 2.0))))
(if (<= l_m 7e-79)
(asin (* l_m (/ 1.0 t_1)))
(if (or (<= l_m 2.85e-58) (not (<= l_m 2e+54)))
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (/ l_m t_1))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = t_m * sqrt(2.0);
double tmp;
if (l_m <= 7e-79) {
tmp = asin((l_m * (1.0 / t_1)));
} else if ((l_m <= 2.85e-58) || !(l_m <= 2e+54)) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((l_m / t_1));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = t_m * sqrt(2.0d0)
if (l_m <= 7d-79) then
tmp = asin((l_m * (1.0d0 / t_1)))
else if ((l_m <= 2.85d-58) .or. (.not. (l_m <= 2d+54))) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((l_m / t_1))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = t_m * Math.sqrt(2.0);
double tmp;
if (l_m <= 7e-79) {
tmp = Math.asin((l_m * (1.0 / t_1)));
} else if ((l_m <= 2.85e-58) || !(l_m <= 2e+54)) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((l_m / t_1));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): t_1 = t_m * math.sqrt(2.0) tmp = 0 if l_m <= 7e-79: tmp = math.asin((l_m * (1.0 / t_1))) elif (l_m <= 2.85e-58) or not (l_m <= 2e+54): tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((l_m / t_1)) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) t_1 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (l_m <= 7e-79) tmp = asin(Float64(l_m * Float64(1.0 / t_1))); elseif ((l_m <= 2.85e-58) || !(l_m <= 2e+54)) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(l_m / t_1)); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) t_1 = t_m * sqrt(2.0); tmp = 0.0; if (l_m <= 7e-79) tmp = asin((l_m * (1.0 / t_1))); elseif ((l_m <= 2.85e-58) || ~((l_m <= 2e+54))) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((l_m / t_1)); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
l_m = N[Abs[l], $MachinePrecision]
code[t$95$m_, l$95$m_, Om_, Omc_] := Block[{t$95$1 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l$95$m, 7e-79], N[ArcSin[N[(l$95$m * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 2.85e-58], N[Not[LessEqual[l$95$m, 2e+54]], $MachinePrecision]], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l$95$m / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := t\_m \cdot \sqrt{2}\\
\mathbf{if}\;l\_m \leq 7 \cdot 10^{-79}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{1}{t\_1}\right)\\
\mathbf{elif}\;l\_m \leq 2.85 \cdot 10^{-58} \lor \neg \left(l\_m \leq 2 \cdot 10^{+54}\right):\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_1}\right)\\
\end{array}
\end{array}
if l < 7.00000000000000059e-79Initial program 78.2%
sqrt-div78.1%
div-inv78.1%
add-sqr-sqrt78.1%
hypot-1-def78.1%
*-commutative78.1%
sqrt-prod78.1%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 34.7%
div-inv34.7%
*-commutative34.7%
Applied egg-rr34.7%
if 7.00000000000000059e-79 < l < 2.85000000000000016e-58 or 2.0000000000000002e54 < l Initial program 98.4%
Taylor expanded in t around 0 62.7%
unpow262.7%
unpow262.7%
times-frac75.6%
unpow275.6%
Simplified75.6%
unpow298.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr75.6%
if 2.85000000000000016e-58 < l < 2.0000000000000002e54Initial program 67.7%
sqrt-div67.7%
div-inv67.7%
add-sqr-sqrt67.6%
hypot-1-def67.7%
*-commutative67.7%
sqrt-prod67.5%
sqrt-pow196.2%
metadata-eval96.2%
pow196.2%
Applied egg-rr96.2%
associate-*r/96.2%
*-rgt-identity96.2%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in Om around 0 96.5%
Taylor expanded in t around inf 42.3%
Final simplification44.0%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (if (or (<= l_m 7e-79) (and (not (<= l_m 3.1e-58)) (<= l_m 5e+54))) (asin (/ l_m (* t_m (sqrt 2.0)))) (asin 1.0)))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((l_m <= 7e-79) || (!(l_m <= 3.1e-58) && (l_m <= 5e+54))) {
tmp = asin((l_m / (t_m * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((l_m <= 7d-79) .or. (.not. (l_m <= 3.1d-58)) .and. (l_m <= 5d+54)) then
tmp = asin((l_m / (t_m * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((l_m <= 7e-79) || (!(l_m <= 3.1e-58) && (l_m <= 5e+54))) {
tmp = Math.asin((l_m / (t_m * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if (l_m <= 7e-79) or (not (l_m <= 3.1e-58) and (l_m <= 5e+54)): tmp = math.asin((l_m / (t_m * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if ((l_m <= 7e-79) || (!(l_m <= 3.1e-58) && (l_m <= 5e+54))) tmp = asin(Float64(l_m / Float64(t_m * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if ((l_m <= 7e-79) || (~((l_m <= 3.1e-58)) && (l_m <= 5e+54))) tmp = asin((l_m / (t_m * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[Or[LessEqual[l$95$m, 7e-79], And[N[Not[LessEqual[l$95$m, 3.1e-58]], $MachinePrecision], LessEqual[l$95$m, 5e+54]]], N[ArcSin[N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 7 \cdot 10^{-79} \lor \neg \left(l\_m \leq 3.1 \cdot 10^{-58}\right) \land l\_m \leq 5 \cdot 10^{+54}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 7.00000000000000059e-79 or 3.0999999999999999e-58 < l < 5.00000000000000005e54Initial program 77.1%
sqrt-div77.0%
div-inv77.0%
add-sqr-sqrt77.0%
hypot-1-def77.0%
*-commutative77.0%
sqrt-prod76.9%
sqrt-pow198.2%
metadata-eval98.2%
pow198.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in Om around 0 97.6%
Taylor expanded in t around inf 35.5%
if 7.00000000000000059e-79 < l < 3.0999999999999999e-58 or 5.00000000000000005e54 < l Initial program 98.4%
Taylor expanded in t around 0 62.7%
unpow262.7%
unpow262.7%
times-frac75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in Om around 0 73.2%
Final simplification43.5%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(let* ((t_1 (* t_m (sqrt 2.0))))
(if (<= l_m 7e-79)
(asin (* l_m (/ 1.0 t_1)))
(if (<= l_m 2.85e-58)
(asin 1.0)
(if (<= l_m 2e+54) (asin (/ l_m t_1)) (asin 1.0))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = t_m * sqrt(2.0);
double tmp;
if (l_m <= 7e-79) {
tmp = asin((l_m * (1.0 / t_1)));
} else if (l_m <= 2.85e-58) {
tmp = asin(1.0);
} else if (l_m <= 2e+54) {
tmp = asin((l_m / t_1));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = t_m * sqrt(2.0d0)
if (l_m <= 7d-79) then
tmp = asin((l_m * (1.0d0 / t_1)))
else if (l_m <= 2.85d-58) then
tmp = asin(1.0d0)
else if (l_m <= 2d+54) then
tmp = asin((l_m / t_1))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = t_m * Math.sqrt(2.0);
double tmp;
if (l_m <= 7e-79) {
tmp = Math.asin((l_m * (1.0 / t_1)));
} else if (l_m <= 2.85e-58) {
tmp = Math.asin(1.0);
} else if (l_m <= 2e+54) {
tmp = Math.asin((l_m / t_1));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): t_1 = t_m * math.sqrt(2.0) tmp = 0 if l_m <= 7e-79: tmp = math.asin((l_m * (1.0 / t_1))) elif l_m <= 2.85e-58: tmp = math.asin(1.0) elif l_m <= 2e+54: tmp = math.asin((l_m / t_1)) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) t_1 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (l_m <= 7e-79) tmp = asin(Float64(l_m * Float64(1.0 / t_1))); elseif (l_m <= 2.85e-58) tmp = asin(1.0); elseif (l_m <= 2e+54) tmp = asin(Float64(l_m / t_1)); else tmp = asin(1.0); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) t_1 = t_m * sqrt(2.0); tmp = 0.0; if (l_m <= 7e-79) tmp = asin((l_m * (1.0 / t_1))); elseif (l_m <= 2.85e-58) tmp = asin(1.0); elseif (l_m <= 2e+54) tmp = asin((l_m / t_1)); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
l_m = N[Abs[l], $MachinePrecision]
code[t$95$m_, l$95$m_, Om_, Omc_] := Block[{t$95$1 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l$95$m, 7e-79], N[ArcSin[N[(l$95$m * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 2.85e-58], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l$95$m, 2e+54], N[ArcSin[N[(l$95$m / t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := t\_m \cdot \sqrt{2}\\
\mathbf{if}\;l\_m \leq 7 \cdot 10^{-79}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{1}{t\_1}\right)\\
\mathbf{elif}\;l\_m \leq 2.85 \cdot 10^{-58}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;l\_m \leq 2 \cdot 10^{+54}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 7.00000000000000059e-79Initial program 78.2%
sqrt-div78.1%
div-inv78.1%
add-sqr-sqrt78.1%
hypot-1-def78.1%
*-commutative78.1%
sqrt-prod78.1%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 34.7%
div-inv34.7%
*-commutative34.7%
Applied egg-rr34.7%
if 7.00000000000000059e-79 < l < 2.85000000000000016e-58 or 2.0000000000000002e54 < l Initial program 98.4%
Taylor expanded in t around 0 62.7%
unpow262.7%
unpow262.7%
times-frac75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in Om around 0 73.2%
if 2.85000000000000016e-58 < l < 2.0000000000000002e54Initial program 67.7%
sqrt-div67.7%
div-inv67.7%
add-sqr-sqrt67.6%
hypot-1-def67.7%
*-commutative67.7%
sqrt-prod67.5%
sqrt-pow196.2%
metadata-eval96.2%
pow196.2%
Applied egg-rr96.2%
associate-*r/96.2%
*-rgt-identity96.2%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in Om around 0 96.5%
Taylor expanded in t around inf 42.3%
Final simplification43.5%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin 1.0))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin(1.0);
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin(1.0);
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin(1.0)
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(1.0) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin(1.0); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} 1
\end{array}
Initial program 81.6%
Taylor expanded in t around 0 41.1%
unpow241.1%
unpow241.1%
times-frac47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in Om around 0 46.3%
herbie shell --seed 2024106
(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)))))))