
(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 7 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
(if (<= (/ t_m l_m) 4e+83)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (pow (/ t_m l_m) 2.0))))))
(asin (* (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (* l_m (/ (sqrt 0.5) t_m))))))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) <= 4e+83) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * pow((t_m / l_m), 2.0))))));
} else {
tmp = asin((sqrt((1.0 - pow((Om / Omc), 2.0))) * (l_m * (sqrt(0.5) / 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) :: tmp
if ((t_m / l_m) <= 4d+83) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l_m) ** 2.0d0))))))
else
tmp = asin((sqrt((1.0d0 - ((om / omc) ** 2.0d0))) * (l_m * (sqrt(0.5d0) / 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 tmp;
if ((t_m / l_m) <= 4e+83) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * Math.pow((t_m / l_m), 2.0))))));
} else {
tmp = Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) * (l_m * (Math.sqrt(0.5) / t_m))));
}
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) <= 4e+83: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * math.pow((t_m / l_m), 2.0)))))) else: tmp = math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) * (l_m * (math.sqrt(0.5) / t_m)))) 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) <= 4e+83) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * (Float64(t_m / l_m) ^ 2.0)))))); else tmp = asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) * Float64(l_m * Float64(sqrt(0.5) / t_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 ((t_m / l_m) <= 4e+83) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l_m) ^ 2.0)))))); else tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) * (l_m * (sqrt(0.5) / 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_] := If[LessEqual[N[(t$95$m / l$95$m), $MachinePrecision], 4e+83], 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[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $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 4 \cdot 10^{+83}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot {\left(\frac{t\_m}{l\_m}\right)}^{2}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 4.00000000000000012e83Initial program 89.7%
unpow289.7%
clear-num89.7%
un-div-inv89.7%
Applied egg-rr89.7%
if 4.00000000000000012e83 < (/.f64 t l) Initial program 60.9%
Taylor expanded in t around inf 87.5%
*-commutative87.5%
unpow287.5%
unpow287.5%
times-frac99.6%
unpow299.6%
associate-/l*99.6%
Simplified99.6%
Final simplification91.3%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (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 - ((Om / Omc) / (Omc / Om)))) / 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 - ((Om / Omc) / (Omc / Om)))) / 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 - ((Om / Omc) / (Omc / Om)))) / 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(Float64(Om / Omc) / Float64(Omc / Om)))) / 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) / (Omc / Om)))) / 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[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $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 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t\_m \cdot \sqrt{2}}{l\_m}\right)}\right)
\end{array}
Initial program 85.1%
sqrt-div85.0%
div-inv85.0%
add-sqr-sqrt85.0%
hypot-1-def85.0%
*-commutative85.0%
sqrt-prod85.0%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
associate-*l/98.4%
Simplified98.4%
unpow285.1%
clear-num85.1%
un-div-inv85.1%
Applied egg-rr98.4%
Final simplification98.4%
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+93)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (pow (/ t_m l_m) 2.0))))))
(asin
(* (/ (* l_m (sqrt 0.5)) t_m) (sqrt (- 1.0 (* (/ Om Omc) (/ Om Omc))))))))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+93) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * pow((t_m / l_m), 2.0))))));
} else {
tmp = asin((((l_m * sqrt(0.5)) / t_m) * sqrt((1.0 - ((Om / Omc) * (Om / Omc))))));
}
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+93) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l_m) ** 2.0d0))))))
else
tmp = asin((((l_m * sqrt(0.5d0)) / t_m) * sqrt((1.0d0 - ((om / omc) * (om / omc))))))
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+93) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * Math.pow((t_m / l_m), 2.0))))));
} else {
tmp = Math.asin((((l_m * Math.sqrt(0.5)) / t_m) * Math.sqrt((1.0 - ((Om / Omc) * (Om / Omc))))));
}
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+93: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * math.pow((t_m / l_m), 2.0)))))) else: tmp = math.asin((((l_m * math.sqrt(0.5)) / t_m) * math.sqrt((1.0 - ((Om / Omc) * (Om / Omc)))))) 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+93) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * (Float64(t_m / l_m) ^ 2.0)))))); else tmp = asin(Float64(Float64(Float64(l_m * sqrt(0.5)) / t_m) * sqrt(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc)))))); 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+93) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l_m) ^ 2.0)))))); else tmp = asin((((l_m * sqrt(0.5)) / t_m) * sqrt((1.0 - ((Om / Omc) * (Om / Omc)))))); 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+93], 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[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(N[(l$95$m * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $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^{+93}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot {\left(\frac{t\_m}{l\_m}\right)}^{2}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m \cdot \sqrt{0.5}}{t\_m} \cdot \sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.00000000000000009e93Initial program 89.7%
unpow289.7%
clear-num89.7%
un-div-inv89.7%
Applied egg-rr89.7%
if 2.00000000000000009e93 < (/.f64 t l) Initial program 59.9%
Taylor expanded in t around inf 87.2%
add-sqr-sqrt87.2%
pow287.2%
sqrt-div87.2%
sqrt-pow197.1%
metadata-eval97.1%
pow197.1%
sqrt-pow199.6%
metadata-eval99.6%
pow199.6%
unpow299.6%
Applied egg-rr99.6%
Final simplification91.3%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (let* ((t_1 (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))) (if (<= l_m 4.5e+31) (asin (* t_1 (/ l_m (* t_m (sqrt 2.0))))) (asin 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 = sqrt((1.0 - ((Om / Omc) / (Omc / Om))));
double tmp;
if (l_m <= 4.5e+31) {
tmp = asin((t_1 * (l_m / (t_m * sqrt(2.0)))));
} else {
tmp = asin(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 = sqrt((1.0d0 - ((om / omc) / (omc / om))))
if (l_m <= 4.5d+31) then
tmp = asin((t_1 * (l_m / (t_m * sqrt(2.0d0)))))
else
tmp = asin(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 = Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))));
double tmp;
if (l_m <= 4.5e+31) {
tmp = Math.asin((t_1 * (l_m / (t_m * Math.sqrt(2.0)))));
} else {
tmp = Math.asin(t_1);
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): t_1 = math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) tmp = 0 if l_m <= 4.5e+31: tmp = math.asin((t_1 * (l_m / (t_m * math.sqrt(2.0))))) else: tmp = math.asin(t_1) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) t_1 = sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) tmp = 0.0 if (l_m <= 4.5e+31) tmp = asin(Float64(t_1 * Float64(l_m / Float64(t_m * sqrt(2.0))))); else tmp = asin(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 = sqrt((1.0 - ((Om / Omc) / (Omc / Om)))); tmp = 0.0; if (l_m <= 4.5e+31) tmp = asin((t_1 * (l_m / (t_m * sqrt(2.0))))); else tmp = asin(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[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l$95$m, 4.5e+31], N[ArcSin[N[(t$95$1 * N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[t$95$1], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\\
\mathbf{if}\;l\_m \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;\sin^{-1} \left(t\_1 \cdot \frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} t\_1\\
\end{array}
\end{array}
if l < 4.4999999999999996e31Initial program 80.8%
sqrt-div80.7%
div-inv80.8%
add-sqr-sqrt80.8%
hypot-1-def80.8%
*-commutative80.8%
sqrt-prod80.7%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in t around inf 31.4%
*-commutative31.4%
unpow231.4%
unpow231.4%
times-frac35.1%
unpow235.1%
Simplified35.1%
unpow280.8%
clear-num80.8%
un-div-inv80.8%
Applied egg-rr35.1%
if 4.4999999999999996e31 < l Initial program 98.7%
Taylor expanded in t around 0 68.1%
unpow268.1%
unpow268.1%
times-frac77.4%
unpow277.4%
Simplified77.4%
unpow298.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr77.4%
Final simplification45.2%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (if (<= l_m 6e+31) (asin (/ l_m (* t_m (sqrt 2.0)))) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))))
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+31) {
tmp = asin((l_m / (t_m * sqrt(2.0))));
} else {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
}
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+31) then
tmp = asin((l_m / (t_m * sqrt(2.0d0))))
else
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
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+31) {
tmp = Math.asin((l_m / (t_m * Math.sqrt(2.0))));
} else {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
}
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+31: tmp = math.asin((l_m / (t_m * math.sqrt(2.0)))) else: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) 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+31) tmp = asin(Float64(l_m / Float64(t_m * sqrt(2.0)))); else tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); 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+31) tmp = asin((l_m / (t_m * sqrt(2.0)))); else tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); 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+31], N[ArcSin[N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $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^{+31}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\end{array}
\end{array}
if l < 5.99999999999999978e31Initial program 80.8%
sqrt-div80.7%
div-inv80.8%
add-sqr-sqrt80.8%
hypot-1-def80.8%
*-commutative80.8%
sqrt-prod80.7%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in t around inf 31.4%
*-commutative31.4%
unpow231.4%
unpow231.4%
times-frac35.1%
unpow235.1%
Simplified35.1%
Taylor expanded in Om around 0 34.6%
if 5.99999999999999978e31 < l Initial program 98.7%
Taylor expanded in t around 0 68.1%
unpow268.1%
unpow268.1%
times-frac77.4%
unpow277.4%
Simplified77.4%
unpow298.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr77.4%
Final simplification44.8%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (* l_m (/ (sqrt 0.5) t_m))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((l_m * (sqrt(0.5) / t_m)));
}
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((l_m * (sqrt(0.5d0) / t_m)))
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((l_m * (Math.sqrt(0.5) / t_m)));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((l_m * (math.sqrt(0.5) / t_m)))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(l_m * Float64(sqrt(0.5) / t_m))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((l_m * (sqrt(0.5) / t_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[(l$95$m * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)
\end{array}
Initial program 85.1%
Taylor expanded in t around inf 25.2%
Taylor expanded in Om around 0 28.0%
associate-*r/28.0%
Simplified28.0%
Final simplification28.0%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ l_m (* 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) {
return asin((l_m / (t_m * sqrt(2.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((l_m / (t_m * sqrt(2.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((l_m / (t_m * Math.sqrt(2.0))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((l_m / (t_m * math.sqrt(2.0))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(l_m / Float64(t_m * sqrt(2.0)))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((l_m / (t_m * sqrt(2.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[N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)
\end{array}
Initial program 85.1%
sqrt-div85.0%
div-inv85.0%
add-sqr-sqrt85.0%
hypot-1-def85.0%
*-commutative85.0%
sqrt-prod85.0%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
unpow225.2%
unpow225.2%
times-frac28.4%
unpow228.4%
Simplified28.4%
Taylor expanded in Om around 0 28.0%
Final simplification28.0%
herbie shell --seed 2024050
(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)))))))