
(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)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) -5e+170)
(asin (/ (- l) (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) 2e+147)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (/ t_m l) (/ l t_m)))))))
(asin (/ (/ l t_m) (sqrt 2.0))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -5e+170) {
tmp = asin((-l / (t_m * sqrt(2.0))));
} else if ((t_m / l) <= 2e+147) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) / (l / t_m)))))));
} else {
tmp = asin(((l / t_m) / sqrt(2.0)));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l) <= (-5d+170)) then
tmp = asin((-l / (t_m * sqrt(2.0d0))))
else if ((t_m / l) <= 2d+147) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l) / (l / t_m)))))))
else
tmp = asin(((l / t_m) / sqrt(2.0d0)))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -5e+170) {
tmp = Math.asin((-l / (t_m * Math.sqrt(2.0))));
} else if ((t_m / l) <= 2e+147) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) / (l / t_m)))))));
} else {
tmp = Math.asin(((l / t_m) / Math.sqrt(2.0)));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= -5e+170: tmp = math.asin((-l / (t_m * math.sqrt(2.0)))) elif (t_m / l) <= 2e+147: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) / (l / t_m))))))) else: tmp = math.asin(((l / t_m) / math.sqrt(2.0))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (Float64(t_m / l) <= -5e+170) tmp = asin(Float64(Float64(-l) / Float64(t_m * sqrt(2.0)))); elseif (Float64(t_m / l) <= 2e+147) 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) / Float64(l / t_m))))))); else tmp = asin(Float64(Float64(l / t_m) / sqrt(2.0))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if ((t_m / l) <= -5e+170) tmp = asin((-l / (t_m * sqrt(2.0)))); elseif ((t_m / l) <= 2e+147) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) / (l / t_m))))))); else tmp = asin(((l / t_m) / sqrt(2.0))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -5e+170], N[ArcSin[N[((-l) / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 2e+147], 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), $MachinePrecision] / N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / t$95$m), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t_m}{\ell} \leq -5 \cdot 10^{+170}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 2 \cdot 10^{+147}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{\frac{t_m}{\ell}}{\frac{\ell}{t_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t_m}}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.99999999999999977e170Initial program 59.1%
sqrt-div59.1%
div-inv59.1%
add-sqr-sqrt59.1%
hypot-1-def59.1%
*-commutative59.1%
sqrt-prod59.1%
unpow259.1%
sqrt-prod0.0%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
neg-mul-199.7%
Simplified99.7%
if -4.99999999999999977e170 < (/.f64 t l) < 2e147Initial program 98.5%
unpow298.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
unpow298.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
if 2e147 < (/.f64 t l) Initial program 37.4%
sqrt-div37.4%
div-inv37.4%
add-sqr-sqrt37.4%
hypot-1-def37.4%
*-commutative37.4%
sqrt-prod37.4%
unpow237.4%
sqrt-prod95.2%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
associate-*r/95.5%
*-rgt-identity95.5%
Simplified95.5%
Taylor expanded in Om around 0 95.5%
Taylor expanded in t around inf 99.6%
*-un-lft-identity99.6%
*-commutative99.6%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification98.8%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t_m l) (sqrt 2.0))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t_m / l) * sqrt(2.0)))));
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t_m / l) * Math.sqrt(2.0)))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t_m / l) * math.sqrt(2.0)))))
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t_m / l) * sqrt(2.0))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t_m / l) * sqrt(2.0))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, 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$95$m / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t_m}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.6%
sqrt-div84.6%
div-inv84.6%
add-sqr-sqrt84.6%
hypot-1-def84.6%
*-commutative84.6%
sqrt-prod84.6%
unpow284.6%
sqrt-prod56.4%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
Simplified97.9%
Final simplification97.9%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t_m l) (sqrt 2.0))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t_m / l) * sqrt(2.0)))));
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t_m / l) * Math.sqrt(2.0)))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t_m / l) * math.sqrt(2.0)))))
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t_m / l) * sqrt(2.0))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t_m / l) * sqrt(2.0))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t$95$m / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t_m}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.6%
sqrt-div84.6%
div-inv84.6%
add-sqr-sqrt84.6%
hypot-1-def84.6%
*-commutative84.6%
sqrt-prod84.6%
unpow284.6%
sqrt-prod56.4%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
Simplified97.9%
Taylor expanded in Om around 0 97.3%
Final simplification97.3%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) -20.0)
(asin (/ (- l) (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) 0.05)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (* l (/ (pow 2.0 -0.5) t_m))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -20.0) {
tmp = asin((-l / (t_m * sqrt(2.0))));
} else if ((t_m / l) <= 0.05) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((l * (pow(2.0, -0.5) / t_m)));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l) <= (-20.0d0)) then
tmp = asin((-l / (t_m * sqrt(2.0d0))))
else if ((t_m / l) <= 0.05d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((l * ((2.0d0 ** (-0.5d0)) / t_m)))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -20.0) {
tmp = Math.asin((-l / (t_m * Math.sqrt(2.0))));
} else if ((t_m / l) <= 0.05) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((l * (Math.pow(2.0, -0.5) / t_m)));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= -20.0: tmp = math.asin((-l / (t_m * math.sqrt(2.0)))) elif (t_m / l) <= 0.05: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((l * (math.pow(2.0, -0.5) / t_m))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (Float64(t_m / l) <= -20.0) tmp = asin(Float64(Float64(-l) / Float64(t_m * sqrt(2.0)))); elseif (Float64(t_m / l) <= 0.05) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(l * Float64((2.0 ^ -0.5) / t_m))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if ((t_m / l) <= -20.0) tmp = asin((-l / (t_m * sqrt(2.0)))); elseif ((t_m / l) <= 0.05) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((l * ((2.0 ^ -0.5) / t_m))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -20.0], N[ArcSin[N[((-l) / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.05], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Power[2.0, -0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t_m}{\ell} \leq -20:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{{2}^{-0.5}}{t_m}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -20Initial program 76.7%
sqrt-div76.7%
div-inv76.7%
add-sqr-sqrt76.8%
hypot-1-def76.8%
*-commutative76.8%
sqrt-prod76.7%
unpow276.7%
sqrt-prod0.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around -inf 97.7%
associate-*r/97.7%
neg-mul-197.7%
Simplified97.7%
if -20 < (/.f64 t l) < 0.050000000000000003Initial program 98.2%
Taylor expanded in t around 0 89.0%
unpow289.0%
unpow289.0%
times-frac97.7%
unpow297.7%
Simplified97.7%
unpow298.2%
clear-num98.2%
un-div-inv98.2%
Applied egg-rr97.7%
if 0.050000000000000003 < (/.f64 t l) Initial program 55.0%
sqrt-div55.0%
div-inv55.0%
add-sqr-sqrt55.0%
hypot-1-def55.0%
*-commutative55.0%
sqrt-prod55.0%
unpow255.0%
sqrt-prod96.3%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
Simplified96.7%
Taylor expanded in Om around 0 96.7%
Taylor expanded in t around inf 99.5%
clear-num96.5%
associate-/r/99.2%
*-commutative99.2%
associate-/r*99.3%
pow1/299.3%
pow-flip99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Final simplification98.0%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) -20.0)
(asin (/ (/ (- l) t_m) (sqrt 2.0)))
(if (<= (/ t_m l) 0.05)
(asin (- 1.0 (pow (/ t_m l) 2.0)))
(asin (* l (/ (pow 2.0 -0.5) t_m))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -20.0) {
tmp = asin(((-l / t_m) / sqrt(2.0)));
} else if ((t_m / l) <= 0.05) {
tmp = asin((1.0 - pow((t_m / l), 2.0)));
} else {
tmp = asin((l * (pow(2.0, -0.5) / t_m)));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l) <= (-20.0d0)) then
tmp = asin(((-l / t_m) / sqrt(2.0d0)))
else if ((t_m / l) <= 0.05d0) then
tmp = asin((1.0d0 - ((t_m / l) ** 2.0d0)))
else
tmp = asin((l * ((2.0d0 ** (-0.5d0)) / t_m)))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -20.0) {
tmp = Math.asin(((-l / t_m) / Math.sqrt(2.0)));
} else if ((t_m / l) <= 0.05) {
tmp = Math.asin((1.0 - Math.pow((t_m / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.pow(2.0, -0.5) / t_m)));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= -20.0: tmp = math.asin(((-l / t_m) / math.sqrt(2.0))) elif (t_m / l) <= 0.05: tmp = math.asin((1.0 - math.pow((t_m / l), 2.0))) else: tmp = math.asin((l * (math.pow(2.0, -0.5) / t_m))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (Float64(t_m / l) <= -20.0) tmp = asin(Float64(Float64(Float64(-l) / t_m) / sqrt(2.0))); elseif (Float64(t_m / l) <= 0.05) tmp = asin(Float64(1.0 - (Float64(t_m / l) ^ 2.0))); else tmp = asin(Float64(l * Float64((2.0 ^ -0.5) / t_m))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if ((t_m / l) <= -20.0) tmp = asin(((-l / t_m) / sqrt(2.0))); elseif ((t_m / l) <= 0.05) tmp = asin((1.0 - ((t_m / l) ^ 2.0))); else tmp = asin((l * ((2.0 ^ -0.5) / t_m))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -20.0], N[ArcSin[N[(N[((-l) / t$95$m), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.05], N[ArcSin[N[(1.0 - N[Power[N[(t$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Power[2.0, -0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t_m}{\ell} \leq -20:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t_m}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t_m}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{{2}^{-0.5}}{t_m}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -20Initial program 76.7%
sqrt-div76.7%
div-inv76.7%
add-sqr-sqrt76.8%
hypot-1-def76.8%
*-commutative76.8%
sqrt-prod76.7%
unpow276.7%
sqrt-prod0.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around inf 33.8%
frac-2neg33.8%
distribute-frac-neg33.8%
distribute-lft-neg-in33.8%
associate-/l/33.8%
add-sqr-sqrt15.8%
sqrt-unprod46.2%
sqr-neg46.2%
sqrt-unprod46.0%
add-sqr-sqrt97.7%
associate-/l/97.7%
associate-/r*97.6%
Applied egg-rr97.6%
if -20 < (/.f64 t l) < 0.050000000000000003Initial program 98.2%
sqrt-div98.1%
div-inv98.1%
add-sqr-sqrt98.1%
hypot-1-def98.1%
*-commutative98.1%
sqrt-prod98.1%
unpow298.1%
sqrt-prod63.0%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
Taylor expanded in Om around 0 97.3%
inv-pow97.3%
add-sqr-sqrt97.3%
unpow-prod-down97.3%
Applied egg-rr97.3%
pow-sqr97.3%
associate-*l/97.3%
associate-/l*97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in t around 0 84.6%
associate-*r/84.6%
*-commutative84.6%
unpow284.6%
rem-square-sqrt84.6%
associate-*r*84.6%
metadata-eval84.6%
mul-1-neg84.6%
distribute-neg-frac84.6%
unsub-neg84.6%
unpow284.6%
unpow284.6%
times-frac97.0%
unpow297.0%
Simplified97.0%
if 0.050000000000000003 < (/.f64 t l) Initial program 55.0%
sqrt-div55.0%
div-inv55.0%
add-sqr-sqrt55.0%
hypot-1-def55.0%
*-commutative55.0%
sqrt-prod55.0%
unpow255.0%
sqrt-prod96.3%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
Simplified96.7%
Taylor expanded in Om around 0 96.7%
Taylor expanded in t around inf 99.5%
clear-num96.5%
associate-/r/99.2%
*-commutative99.2%
associate-/r*99.3%
pow1/299.3%
pow-flip99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Final simplification97.6%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) -20.0)
(asin (/ (- l) (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) 0.05)
(asin (- 1.0 (pow (/ t_m l) 2.0)))
(asin (* l (/ (pow 2.0 -0.5) t_m))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -20.0) {
tmp = asin((-l / (t_m * sqrt(2.0))));
} else if ((t_m / l) <= 0.05) {
tmp = asin((1.0 - pow((t_m / l), 2.0)));
} else {
tmp = asin((l * (pow(2.0, -0.5) / t_m)));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l) <= (-20.0d0)) then
tmp = asin((-l / (t_m * sqrt(2.0d0))))
else if ((t_m / l) <= 0.05d0) then
tmp = asin((1.0d0 - ((t_m / l) ** 2.0d0)))
else
tmp = asin((l * ((2.0d0 ** (-0.5d0)) / t_m)))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -20.0) {
tmp = Math.asin((-l / (t_m * Math.sqrt(2.0))));
} else if ((t_m / l) <= 0.05) {
tmp = Math.asin((1.0 - Math.pow((t_m / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.pow(2.0, -0.5) / t_m)));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= -20.0: tmp = math.asin((-l / (t_m * math.sqrt(2.0)))) elif (t_m / l) <= 0.05: tmp = math.asin((1.0 - math.pow((t_m / l), 2.0))) else: tmp = math.asin((l * (math.pow(2.0, -0.5) / t_m))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (Float64(t_m / l) <= -20.0) tmp = asin(Float64(Float64(-l) / Float64(t_m * sqrt(2.0)))); elseif (Float64(t_m / l) <= 0.05) tmp = asin(Float64(1.0 - (Float64(t_m / l) ^ 2.0))); else tmp = asin(Float64(l * Float64((2.0 ^ -0.5) / t_m))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if ((t_m / l) <= -20.0) tmp = asin((-l / (t_m * sqrt(2.0)))); elseif ((t_m / l) <= 0.05) tmp = asin((1.0 - ((t_m / l) ^ 2.0))); else tmp = asin((l * ((2.0 ^ -0.5) / t_m))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -20.0], N[ArcSin[N[((-l) / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.05], N[ArcSin[N[(1.0 - N[Power[N[(t$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Power[2.0, -0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t_m}{\ell} \leq -20:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.05:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t_m}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{{2}^{-0.5}}{t_m}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -20Initial program 76.7%
sqrt-div76.7%
div-inv76.7%
add-sqr-sqrt76.8%
hypot-1-def76.8%
*-commutative76.8%
sqrt-prod76.7%
unpow276.7%
sqrt-prod0.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around -inf 97.7%
associate-*r/97.7%
neg-mul-197.7%
Simplified97.7%
if -20 < (/.f64 t l) < 0.050000000000000003Initial program 98.2%
sqrt-div98.1%
div-inv98.1%
add-sqr-sqrt98.1%
hypot-1-def98.1%
*-commutative98.1%
sqrt-prod98.1%
unpow298.1%
sqrt-prod63.0%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
Taylor expanded in Om around 0 97.3%
inv-pow97.3%
add-sqr-sqrt97.3%
unpow-prod-down97.3%
Applied egg-rr97.3%
pow-sqr97.3%
associate-*l/97.3%
associate-/l*97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in t around 0 84.6%
associate-*r/84.6%
*-commutative84.6%
unpow284.6%
rem-square-sqrt84.6%
associate-*r*84.6%
metadata-eval84.6%
mul-1-neg84.6%
distribute-neg-frac84.6%
unsub-neg84.6%
unpow284.6%
unpow284.6%
times-frac97.0%
unpow297.0%
Simplified97.0%
if 0.050000000000000003 < (/.f64 t l) Initial program 55.0%
sqrt-div55.0%
div-inv55.0%
add-sqr-sqrt55.0%
hypot-1-def55.0%
*-commutative55.0%
sqrt-prod55.0%
unpow255.0%
sqrt-prod96.3%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
Simplified96.7%
Taylor expanded in Om around 0 96.7%
Taylor expanded in t around inf 99.5%
clear-num96.5%
associate-/r/99.2%
*-commutative99.2%
associate-/r*99.3%
pow1/299.3%
pow-flip99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Final simplification97.7%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= l -1.86e-132)
(asin 1.0)
(if (<= l -7.8e-301)
(asin (/ (/ (- l) t_m) (sqrt 2.0)))
(if (<= l 1250000.0) (asin (* l (/ (pow 2.0 -0.5) t_m))) (asin 1.0)))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -1.86e-132) {
tmp = asin(1.0);
} else if (l <= -7.8e-301) {
tmp = asin(((-l / t_m) / sqrt(2.0)));
} else if (l <= 1250000.0) {
tmp = asin((l * (pow(2.0, -0.5) / t_m)));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1.86d-132)) then
tmp = asin(1.0d0)
else if (l <= (-7.8d-301)) then
tmp = asin(((-l / t_m) / sqrt(2.0d0)))
else if (l <= 1250000.0d0) then
tmp = asin((l * ((2.0d0 ** (-0.5d0)) / t_m)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -1.86e-132) {
tmp = Math.asin(1.0);
} else if (l <= -7.8e-301) {
tmp = Math.asin(((-l / t_m) / Math.sqrt(2.0)));
} else if (l <= 1250000.0) {
tmp = Math.asin((l * (Math.pow(2.0, -0.5) / t_m)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if l <= -1.86e-132: tmp = math.asin(1.0) elif l <= -7.8e-301: tmp = math.asin(((-l / t_m) / math.sqrt(2.0))) elif l <= 1250000.0: tmp = math.asin((l * (math.pow(2.0, -0.5) / t_m))) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (l <= -1.86e-132) tmp = asin(1.0); elseif (l <= -7.8e-301) tmp = asin(Float64(Float64(Float64(-l) / t_m) / sqrt(2.0))); elseif (l <= 1250000.0) tmp = asin(Float64(l * Float64((2.0 ^ -0.5) / t_m))); else tmp = asin(1.0); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if (l <= -1.86e-132) tmp = asin(1.0); elseif (l <= -7.8e-301) tmp = asin(((-l / t_m) / sqrt(2.0))); elseif (l <= 1250000.0) tmp = asin((l * ((2.0 ^ -0.5) / t_m))); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[l, -1.86e-132], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -7.8e-301], N[ArcSin[N[(N[((-l) / t$95$m), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1250000.0], N[ArcSin[N[(l * N[(N[Power[2.0, -0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.86 \cdot 10^{-132}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -7.8 \cdot 10^{-301}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t_m}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 1250000:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{{2}^{-0.5}}{t_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.85999999999999986e-132 or 1.25e6 < l Initial program 92.3%
Taylor expanded in t around 0 74.8%
unpow274.8%
unpow274.8%
times-frac80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in Om around 0 80.4%
if -1.85999999999999986e-132 < l < -7.8000000000000002e-301Initial program 76.0%
sqrt-div75.9%
div-inv75.9%
add-sqr-sqrt75.9%
hypot-1-def75.9%
*-commutative75.9%
sqrt-prod76.0%
unpow276.0%
sqrt-prod54.1%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
associate-*r/96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in Om around 0 95.8%
Taylor expanded in t around inf 67.6%
frac-2neg67.6%
distribute-frac-neg67.6%
distribute-lft-neg-in67.6%
associate-/l/67.6%
add-sqr-sqrt40.4%
sqrt-unprod69.9%
sqr-neg69.9%
sqrt-unprod43.7%
add-sqr-sqrt63.3%
associate-/l/63.3%
associate-/r*63.3%
Applied egg-rr63.3%
if -7.8000000000000002e-301 < l < 1.25e6Initial program 71.3%
sqrt-div71.2%
div-inv71.2%
add-sqr-sqrt71.2%
hypot-1-def71.2%
*-commutative71.2%
sqrt-prod71.2%
unpow271.2%
sqrt-prod46.0%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
associate-*r/97.0%
*-rgt-identity97.0%
Simplified97.0%
Taylor expanded in Om around 0 95.5%
Taylor expanded in t around inf 50.5%
clear-num49.1%
associate-/r/50.5%
*-commutative50.5%
associate-/r*50.5%
pow1/250.5%
pow-flip50.6%
metadata-eval50.6%
Applied egg-rr50.6%
Final simplification70.3%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= l -2.45e-131)
(asin 1.0)
(if (<= l -7.8e-301)
(asin (/ (/ (- l) t_m) (sqrt 2.0)))
(if (<= l 25000000.0) (asin (/ l (* t_m (sqrt 2.0)))) (asin 1.0)))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -2.45e-131) {
tmp = asin(1.0);
} else if (l <= -7.8e-301) {
tmp = asin(((-l / t_m) / sqrt(2.0)));
} else if (l <= 25000000.0) {
tmp = asin((l / (t_m * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-2.45d-131)) then
tmp = asin(1.0d0)
else if (l <= (-7.8d-301)) then
tmp = asin(((-l / t_m) / sqrt(2.0d0)))
else if (l <= 25000000.0d0) then
tmp = asin((l / (t_m * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -2.45e-131) {
tmp = Math.asin(1.0);
} else if (l <= -7.8e-301) {
tmp = Math.asin(((-l / t_m) / Math.sqrt(2.0)));
} else if (l <= 25000000.0) {
tmp = Math.asin((l / (t_m * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if l <= -2.45e-131: tmp = math.asin(1.0) elif l <= -7.8e-301: tmp = math.asin(((-l / t_m) / math.sqrt(2.0))) elif l <= 25000000.0: tmp = math.asin((l / (t_m * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (l <= -2.45e-131) tmp = asin(1.0); elseif (l <= -7.8e-301) tmp = asin(Float64(Float64(Float64(-l) / t_m) / sqrt(2.0))); elseif (l <= 25000000.0) tmp = asin(Float64(l / Float64(t_m * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if (l <= -2.45e-131) tmp = asin(1.0); elseif (l <= -7.8e-301) tmp = asin(((-l / t_m) / sqrt(2.0))); elseif (l <= 25000000.0) tmp = asin((l / (t_m * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[l, -2.45e-131], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -7.8e-301], N[ArcSin[N[(N[((-l) / t$95$m), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 25000000.0], N[ArcSin[N[(l / 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|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.45 \cdot 10^{-131}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -7.8 \cdot 10^{-301}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t_m}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 25000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -2.4500000000000001e-131 or 2.5e7 < l Initial program 92.3%
Taylor expanded in t around 0 74.8%
unpow274.8%
unpow274.8%
times-frac80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in Om around 0 80.4%
if -2.4500000000000001e-131 < l < -7.8000000000000002e-301Initial program 76.0%
sqrt-div75.9%
div-inv75.9%
add-sqr-sqrt75.9%
hypot-1-def75.9%
*-commutative75.9%
sqrt-prod76.0%
unpow276.0%
sqrt-prod54.1%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
associate-*r/96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in Om around 0 95.8%
Taylor expanded in t around inf 67.6%
frac-2neg67.6%
distribute-frac-neg67.6%
distribute-lft-neg-in67.6%
associate-/l/67.6%
add-sqr-sqrt40.4%
sqrt-unprod69.9%
sqr-neg69.9%
sqrt-unprod43.7%
add-sqr-sqrt63.3%
associate-/l/63.3%
associate-/r*63.3%
Applied egg-rr63.3%
if -7.8000000000000002e-301 < l < 2.5e7Initial program 71.3%
sqrt-div71.2%
div-inv71.2%
add-sqr-sqrt71.2%
hypot-1-def71.2%
*-commutative71.2%
sqrt-prod71.2%
unpow271.2%
sqrt-prod46.0%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
associate-*r/97.0%
*-rgt-identity97.0%
Simplified97.0%
Taylor expanded in Om around 0 95.5%
Taylor expanded in t around inf 50.5%
Final simplification70.3%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (if (<= l -1e-213) (asin 1.0) (if (<= l 7000000.0) (asin (/ l (* t_m (sqrt 2.0)))) (asin 1.0))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -1e-213) {
tmp = asin(1.0);
} else if (l <= 7000000.0) {
tmp = asin((l / (t_m * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1d-213)) then
tmp = asin(1.0d0)
else if (l <= 7000000.0d0) then
tmp = asin((l / (t_m * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -1e-213) {
tmp = Math.asin(1.0);
} else if (l <= 7000000.0) {
tmp = Math.asin((l / (t_m * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if l <= -1e-213: tmp = math.asin(1.0) elif l <= 7000000.0: tmp = math.asin((l / (t_m * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (l <= -1e-213) tmp = asin(1.0); elseif (l <= 7000000.0) tmp = asin(Float64(l / Float64(t_m * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if (l <= -1e-213) tmp = asin(1.0); elseif (l <= 7000000.0) tmp = asin((l / (t_m * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[l, -1e-213], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 7000000.0], N[ArcSin[N[(l / 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|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-213}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 7000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -9.9999999999999995e-214 or 7e6 < l Initial program 90.3%
Taylor expanded in t around 0 71.5%
unpow271.5%
unpow271.5%
times-frac77.2%
unpow277.2%
Simplified77.2%
Taylor expanded in Om around 0 77.1%
if -9.9999999999999995e-214 < l < 7e6Initial program 74.2%
sqrt-div74.1%
div-inv74.1%
add-sqr-sqrt74.1%
hypot-1-def74.1%
*-commutative74.1%
sqrt-prod74.1%
unpow274.1%
sqrt-prod46.9%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in Om around 0 96.5%
Taylor expanded in t around inf 57.2%
Final simplification70.1%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin 1.0))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin(1.0);
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
return Math.asin(1.0);
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin(1.0)
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(1.0) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin(1.0); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} 1
\end{array}
Initial program 84.6%
Taylor expanded in t around 0 53.1%
unpow253.1%
unpow253.1%
times-frac58.5%
unpow258.5%
Simplified58.5%
Taylor expanded in Om around 0 58.1%
Final simplification58.1%
herbie shell --seed 2023325
(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)))))))