
(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
(if (<= (/ t_m l_m) 2e+130)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (/ t_m l_m) (/ l_m t_m)))))))
(asin (/ l_m (/ t_m (sqrt 0.5))))))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+130) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l_m) / (l_m / t_m)))))));
} else {
tmp = asin((l_m / (t_m / sqrt(0.5))));
}
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+130) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l_m) / (l_m / t_m)))))))
else
tmp = asin((l_m / (t_m / sqrt(0.5d0))))
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+130) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l_m) / (l_m / t_m)))))));
} else {
tmp = Math.asin((l_m / (t_m / Math.sqrt(0.5))));
}
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+130: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l_m) / (l_m / t_m))))))) else: tmp = math.asin((l_m / (t_m / math.sqrt(0.5)))) 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+130) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m / l_m) / Float64(l_m / t_m))))))); else tmp = asin(Float64(l_m / Float64(t_m / sqrt(0.5)))); 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+130) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l_m) / (l_m / t_m))))))); else tmp = asin((l_m / (t_m / sqrt(0.5)))); 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+130], 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 / l$95$m), $MachinePrecision] / N[(l$95$m / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l$95$m / N[(t$95$m / N[Sqrt[0.5], $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^{+130}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{\frac{t\_m}{l\_m}}{\frac{l\_m}{t\_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{\frac{t\_m}{\sqrt{0.5}}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.0000000000000001e130Initial program 92.9%
unpow292.9%
clear-num93.0%
un-div-inv93.0%
Applied egg-rr93.0%
unpow293.0%
clear-num93.0%
un-div-inv93.0%
Applied egg-rr93.0%
if 2.0000000000000001e130 < (/.f64 t l) Initial program 45.9%
Taylor expanded in Om around 0 45.9%
Taylor expanded in t around inf 99.5%
associate-/l*99.5%
Simplified99.5%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
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 l_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((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t_m / l_m) * sqrt(2.0)))));
}
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 / l_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((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t_m / l_m) * math.sqrt(2.0)))))
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 / l_m) * sqrt(2.0))))) 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 / l_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[(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 / l$95$m), $MachinePrecision] * N[Sqrt[2.0], $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, \frac{t\_m}{l\_m} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.5%
sqrt-div84.5%
add-sqr-sqrt84.5%
hypot-1-def84.5%
*-commutative84.5%
sqrt-prod84.4%
sqrt-pow198.9%
metadata-eval98.9%
pow198.9%
Applied egg-rr98.9%
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 l_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((1.0 / hypot(1.0, ((t_m / l_m) * sqrt(2.0)))));
}
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 / l_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((1.0 / math.hypot(1.0, ((t_m / l_m) * math.sqrt(2.0)))))
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 / l_m) * sqrt(2.0))))) 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 / l_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[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $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}{l\_m} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.5%
sqrt-div84.5%
add-sqr-sqrt84.5%
hypot-1-def84.5%
*-commutative84.5%
sqrt-prod84.4%
sqrt-pow198.9%
metadata-eval98.9%
pow198.9%
Applied egg-rr98.9%
Taylor expanded in Om around 0 97.9%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (if (or (<= t_m 1.15e-55) (and (not (<= t_m 1.8e-25)) (<= t_m 0.19))) (asin 1.0) (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) {
double tmp;
if ((t_m <= 1.15e-55) || (!(t_m <= 1.8e-25) && (t_m <= 0.19))) {
tmp = asin(1.0);
} else {
tmp = asin((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 <= 1.15d-55) .or. (.not. (t_m <= 1.8d-25)) .and. (t_m <= 0.19d0)) then
tmp = asin(1.0d0)
else
tmp = asin((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 <= 1.15e-55) || (!(t_m <= 1.8e-25) && (t_m <= 0.19))) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((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 <= 1.15e-55) or (not (t_m <= 1.8e-25) and (t_m <= 0.19)): tmp = math.asin(1.0) else: tmp = math.asin((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 ((t_m <= 1.15e-55) || (!(t_m <= 1.8e-25) && (t_m <= 0.19))) tmp = asin(1.0); else tmp = asin(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 <= 1.15e-55) || (~((t_m <= 1.8e-25)) && (t_m <= 0.19))) tmp = asin(1.0); else tmp = asin((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[Or[LessEqual[t$95$m, 1.15e-55], And[N[Not[LessEqual[t$95$m, 1.8e-25]], $MachinePrecision], LessEqual[t$95$m, 0.19]]], N[ArcSin[1.0], $MachinePrecision], 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|
\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 1.15 \cdot 10^{-55} \lor \neg \left(t\_m \leq 1.8 \cdot 10^{-25}\right) \land t\_m \leq 0.19:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\
\end{array}
\end{array}
if t < 1.15000000000000006e-55 or 1.8e-25 < t < 0.19Initial program 87.1%
Taylor expanded in t around 0 53.6%
unpow253.6%
unpow253.6%
times-frac58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in Om around 0 58.0%
if 1.15000000000000006e-55 < t < 1.8e-25 or 0.19 < t Initial program 76.1%
Taylor expanded in Om around 0 75.1%
Taylor expanded in t around inf 56.2%
associate-/l*56.1%
Simplified56.1%
Final simplification57.5%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(if (<= t_m 7.5e-58)
(asin 1.0)
(if (<= t_m 2.85e-25)
(asin (/ (* l_m (sqrt 0.5)) t_m))
(if (<= t_m 35.0) (asin 1.0) (asin (/ l_m (/ t_m (sqrt 0.5))))))))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 <= 7.5e-58) {
tmp = asin(1.0);
} else if (t_m <= 2.85e-25) {
tmp = asin(((l_m * sqrt(0.5)) / t_m));
} else if (t_m <= 35.0) {
tmp = asin(1.0);
} else {
tmp = asin((l_m / (t_m / sqrt(0.5))));
}
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 <= 7.5d-58) then
tmp = asin(1.0d0)
else if (t_m <= 2.85d-25) then
tmp = asin(((l_m * sqrt(0.5d0)) / t_m))
else if (t_m <= 35.0d0) then
tmp = asin(1.0d0)
else
tmp = asin((l_m / (t_m / sqrt(0.5d0))))
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 <= 7.5e-58) {
tmp = Math.asin(1.0);
} else if (t_m <= 2.85e-25) {
tmp = Math.asin(((l_m * Math.sqrt(0.5)) / t_m));
} else if (t_m <= 35.0) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l_m / (t_m / Math.sqrt(0.5))));
}
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 <= 7.5e-58: tmp = math.asin(1.0) elif t_m <= 2.85e-25: tmp = math.asin(((l_m * math.sqrt(0.5)) / t_m)) elif t_m <= 35.0: tmp = math.asin(1.0) else: tmp = math.asin((l_m / (t_m / math.sqrt(0.5)))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (t_m <= 7.5e-58) tmp = asin(1.0); elseif (t_m <= 2.85e-25) tmp = asin(Float64(Float64(l_m * sqrt(0.5)) / t_m)); elseif (t_m <= 35.0) tmp = asin(1.0); else tmp = asin(Float64(l_m / Float64(t_m / sqrt(0.5)))); 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 <= 7.5e-58) tmp = asin(1.0); elseif (t_m <= 2.85e-25) tmp = asin(((l_m * sqrt(0.5)) / t_m)); elseif (t_m <= 35.0) tmp = asin(1.0); else tmp = asin((l_m / (t_m / sqrt(0.5)))); 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[t$95$m, 7.5e-58], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[t$95$m, 2.85e-25], N[ArcSin[N[(N[(l$95$m * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$m, 35.0], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l$95$m / N[(t$95$m / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 7.5 \cdot 10^{-58}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;t\_m \leq 2.85 \cdot 10^{-25}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m \cdot \sqrt{0.5}}{t\_m}\right)\\
\mathbf{elif}\;t\_m \leq 35:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{\frac{t\_m}{\sqrt{0.5}}}\right)\\
\end{array}
\end{array}
if t < 7.50000000000000002e-58 or 2.8500000000000002e-25 < t < 35Initial program 87.1%
Taylor expanded in t around 0 53.6%
unpow253.6%
unpow253.6%
times-frac58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in Om around 0 58.0%
if 7.50000000000000002e-58 < t < 2.8500000000000002e-25Initial program 71.5%
Taylor expanded in Om around 0 71.5%
Taylor expanded in t around inf 50.4%
if 35 < t Initial program 77.0%
Taylor expanded in Om around 0 75.8%
Taylor expanded in t around inf 57.3%
associate-/l*57.2%
Simplified57.2%
clear-num57.2%
un-div-inv57.2%
Applied egg-rr57.2%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(if (<= t_m 5.5e-56)
(asin 1.0)
(if (<= t_m 2.85e-26)
(asin (* l_m (/ (sqrt 0.5) t_m)))
(if (<= t_m 13.8) (asin 1.0) (asin (/ l_m (/ t_m (sqrt 0.5))))))))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 <= 5.5e-56) {
tmp = asin(1.0);
} else if (t_m <= 2.85e-26) {
tmp = asin((l_m * (sqrt(0.5) / t_m)));
} else if (t_m <= 13.8) {
tmp = asin(1.0);
} else {
tmp = asin((l_m / (t_m / sqrt(0.5))));
}
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 <= 5.5d-56) then
tmp = asin(1.0d0)
else if (t_m <= 2.85d-26) then
tmp = asin((l_m * (sqrt(0.5d0) / t_m)))
else if (t_m <= 13.8d0) then
tmp = asin(1.0d0)
else
tmp = asin((l_m / (t_m / sqrt(0.5d0))))
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 <= 5.5e-56) {
tmp = Math.asin(1.0);
} else if (t_m <= 2.85e-26) {
tmp = Math.asin((l_m * (Math.sqrt(0.5) / t_m)));
} else if (t_m <= 13.8) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l_m / (t_m / Math.sqrt(0.5))));
}
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 <= 5.5e-56: tmp = math.asin(1.0) elif t_m <= 2.85e-26: tmp = math.asin((l_m * (math.sqrt(0.5) / t_m))) elif t_m <= 13.8: tmp = math.asin(1.0) else: tmp = math.asin((l_m / (t_m / math.sqrt(0.5)))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (t_m <= 5.5e-56) tmp = asin(1.0); elseif (t_m <= 2.85e-26) tmp = asin(Float64(l_m * Float64(sqrt(0.5) / t_m))); elseif (t_m <= 13.8) tmp = asin(1.0); else tmp = asin(Float64(l_m / Float64(t_m / sqrt(0.5)))); 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 <= 5.5e-56) tmp = asin(1.0); elseif (t_m <= 2.85e-26) tmp = asin((l_m * (sqrt(0.5) / t_m))); elseif (t_m <= 13.8) tmp = asin(1.0); else tmp = asin((l_m / (t_m / sqrt(0.5)))); 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[t$95$m, 5.5e-56], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[t$95$m, 2.85e-26], N[ArcSin[N[(l$95$m * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$m, 13.8], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l$95$m / N[(t$95$m / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 5.5 \cdot 10^{-56}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;t\_m \leq 2.85 \cdot 10^{-26}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\
\mathbf{elif}\;t\_m \leq 13.8:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{\frac{t\_m}{\sqrt{0.5}}}\right)\\
\end{array}
\end{array}
if t < 5.4999999999999999e-56 or 2.85e-26 < t < 13.800000000000001Initial program 87.1%
Taylor expanded in t around 0 53.6%
unpow253.6%
unpow253.6%
times-frac58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in Om around 0 58.0%
if 5.4999999999999999e-56 < t < 2.85e-26Initial program 71.5%
Taylor expanded in Om around 0 71.5%
Taylor expanded in t around inf 50.4%
associate-/l*50.4%
Simplified50.4%
if 13.800000000000001 < t Initial program 77.0%
Taylor expanded in Om around 0 75.8%
Taylor expanded in t around inf 57.3%
associate-/l*57.2%
Simplified57.2%
clear-num57.2%
un-div-inv57.2%
Applied egg-rr57.2%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(if (<= t_m 1.35e-55)
(asin 1.0)
(if (<= t_m 1.48e-27)
(asin (* l_m (/ (sqrt 0.5) t_m)))
(if (<= t_m 1.7) (asin 1.0) (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) {
double tmp;
if (t_m <= 1.35e-55) {
tmp = asin(1.0);
} else if (t_m <= 1.48e-27) {
tmp = asin((l_m * (sqrt(0.5) / t_m)));
} else if (t_m <= 1.7) {
tmp = asin(1.0);
} else {
tmp = asin((l_m / (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 <= 1.35d-55) then
tmp = asin(1.0d0)
else if (t_m <= 1.48d-27) then
tmp = asin((l_m * (sqrt(0.5d0) / t_m)))
else if (t_m <= 1.7d0) then
tmp = asin(1.0d0)
else
tmp = asin((l_m / (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 <= 1.35e-55) {
tmp = Math.asin(1.0);
} else if (t_m <= 1.48e-27) {
tmp = Math.asin((l_m * (Math.sqrt(0.5) / t_m)));
} else if (t_m <= 1.7) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l_m / (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 <= 1.35e-55: tmp = math.asin(1.0) elif t_m <= 1.48e-27: tmp = math.asin((l_m * (math.sqrt(0.5) / t_m))) elif t_m <= 1.7: tmp = math.asin(1.0) else: tmp = math.asin((l_m / (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 (t_m <= 1.35e-55) tmp = asin(1.0); elseif (t_m <= 1.48e-27) tmp = asin(Float64(l_m * Float64(sqrt(0.5) / t_m))); elseif (t_m <= 1.7) tmp = asin(1.0); else tmp = asin(Float64(l_m / 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 <= 1.35e-55) tmp = asin(1.0); elseif (t_m <= 1.48e-27) tmp = asin((l_m * (sqrt(0.5) / t_m))); elseif (t_m <= 1.7) tmp = asin(1.0); else tmp = asin((l_m / (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[t$95$m, 1.35e-55], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[t$95$m, 1.48e-27], N[ArcSin[N[(l$95$m * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$m, 1.7], N[ArcSin[1.0], $MachinePrecision], 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|
\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 1.35 \cdot 10^{-55}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;t\_m \leq 1.48 \cdot 10^{-27}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\
\mathbf{elif}\;t\_m \leq 1.7:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 1.35000000000000002e-55 or 1.48000000000000008e-27 < t < 1.69999999999999996Initial program 87.1%
Taylor expanded in t around 0 53.6%
unpow253.6%
unpow253.6%
times-frac58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in Om around 0 58.0%
if 1.35000000000000002e-55 < t < 1.48000000000000008e-27Initial program 71.5%
Taylor expanded in Om around 0 71.5%
Taylor expanded in t around inf 50.4%
associate-/l*50.4%
Simplified50.4%
if 1.69999999999999996 < t Initial program 77.0%
sqrt-div77.0%
add-sqr-sqrt77.0%
hypot-1-def77.0%
*-commutative77.0%
sqrt-prod77.0%
sqrt-pow199.1%
metadata-eval99.1%
pow199.1%
Applied egg-rr99.1%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around inf 57.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-5) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))) (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) {
double tmp;
if ((t_m / l_m) <= 2e-5) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((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) <= 2d-5) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((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) <= 2e-5) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((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) <= 2e-5: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((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) <= 2e-5) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(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) <= 2e-5) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((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], 2e-5], 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 * 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|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t\_m}{l\_m} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.00000000000000016e-5Initial program 92.1%
Taylor expanded in t around 0 62.0%
unpow262.0%
unpow262.0%
times-frac67.9%
unpow267.9%
Simplified67.9%
unpow292.1%
clear-num92.1%
un-div-inv92.1%
Applied egg-rr67.9%
if 2.00000000000000016e-5 < (/.f64 t l) Initial program 64.2%
Taylor expanded in Om around 0 63.9%
Taylor expanded in t around inf 98.9%
associate-/l*98.9%
Simplified98.9%
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-5) (asin (- 1.0 (pow (/ t_m l_m) 2.0))) (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) {
double tmp;
if ((t_m / l_m) <= 2e-5) {
tmp = asin((1.0 - pow((t_m / l_m), 2.0)));
} else {
tmp = asin((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) <= 2d-5) then
tmp = asin((1.0d0 - ((t_m / l_m) ** 2.0d0)))
else
tmp = asin((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) <= 2e-5) {
tmp = Math.asin((1.0 - Math.pow((t_m / l_m), 2.0)));
} else {
tmp = Math.asin((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) <= 2e-5: tmp = math.asin((1.0 - math.pow((t_m / l_m), 2.0))) else: tmp = math.asin((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) <= 2e-5) tmp = asin(Float64(1.0 - (Float64(t_m / l_m) ^ 2.0))); else tmp = asin(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) <= 2e-5) tmp = asin((1.0 - ((t_m / l_m) ^ 2.0))); else tmp = asin((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], 2e-5], N[ArcSin[N[(1.0 - N[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t\_m}{l\_m} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t\_m}{l\_m}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \frac{\sqrt{0.5}}{t\_m}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.00000000000000016e-5Initial program 92.1%
Taylor expanded in Om around 0 90.8%
Taylor expanded in t around 0 57.9%
mul-1-neg57.9%
unsub-neg57.9%
unpow257.9%
unpow257.9%
times-frac65.2%
unpow265.2%
Simplified65.2%
if 2.00000000000000016e-5 < (/.f64 t l) Initial program 64.2%
Taylor expanded in Om around 0 63.9%
Taylor expanded in t around inf 98.9%
associate-/l*98.9%
Simplified98.9%
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 84.5%
Taylor expanded in t around 0 46.3%
unpow246.3%
unpow246.3%
times-frac50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in Om around 0 49.8%
herbie shell --seed 2024110
(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)))))))