
(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 12 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}
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+158)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 5e+121)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (/ l t) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+158) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 5e+121) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin(((l / t) / sqrt(2.0)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+158)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 5d+121) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin(((l / t) / sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+158) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 5e+121) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+158: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 5e+121: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(((l / t) / math.sqrt(2.0))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+158) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 5e+121) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+158) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 5e+121) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(((l / t) / sqrt(2.0))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+158], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+121], 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 / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+158}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.9999999999999996e158Initial program 55.4%
sqrt-div55.4%
div-inv55.4%
add-sqr-sqrt55.4%
hypot-1-def55.4%
*-commutative55.4%
sqrt-prod55.4%
unpow255.4%
sqrt-prod0.0%
add-sqr-sqrt94.8%
Applied egg-rr94.8%
unpow294.8%
times-frac73.8%
unpow273.8%
unpow273.8%
associate-*r/73.8%
*-rgt-identity73.8%
unpow273.8%
unpow273.8%
times-frac94.8%
unpow294.8%
Simplified94.8%
Taylor expanded in Om around 0 93.6%
Taylor expanded in t around -inf 98.5%
associate-*r/98.5%
mul-1-neg98.5%
Simplified98.5%
if -4.9999999999999996e158 < (/.f64 t l) < 5.00000000000000007e121Initial program 97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
div-inv97.5%
clear-num97.5%
Applied egg-rr97.5%
if 5.00000000000000007e121 < (/.f64 t l) Initial program 54.5%
sqrt-div54.5%
div-inv54.5%
add-sqr-sqrt54.5%
hypot-1-def54.5%
*-commutative54.5%
sqrt-prod54.5%
unpow254.5%
sqrt-prod99.3%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
unpow299.5%
times-frac86.7%
unpow286.7%
unpow286.7%
associate-*r/86.7%
*-rgt-identity86.7%
unpow286.7%
unpow286.7%
times-frac99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
Taylor expanded in t around inf 99.5%
associate-/l/99.6%
Simplified99.6%
Final simplification97.9%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))
(if (<= t_1 1e+303)
(asin (sqrt (/ (+ 1.0 (+ 1.0 (- -1.0 (pow (/ Om Omc) 2.0)))) t_1)))
(asin (/ 1.0 (hypot 1.0 (/ (* t (sqrt 2.0)) l)))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 + (2.0 * pow((t / l), 2.0));
double tmp;
if (t_1 <= 1e+303) {
tmp = asin(sqrt(((1.0 + (1.0 + (-1.0 - pow((Om / Omc), 2.0)))) / t_1)));
} else {
tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
return tmp;
}
public static double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 + (2.0 * Math.pow((t / l), 2.0));
double tmp;
if (t_1 <= 1e+303) {
tmp = Math.asin(Math.sqrt(((1.0 + (1.0 + (-1.0 - Math.pow((Om / Omc), 2.0)))) / t_1)));
} else {
tmp = Math.asin((1.0 / Math.hypot(1.0, ((t * Math.sqrt(2.0)) / l))));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = 1.0 + (2.0 * math.pow((t / l), 2.0)) tmp = 0 if t_1 <= 1e+303: tmp = math.asin(math.sqrt(((1.0 + (1.0 + (-1.0 - math.pow((Om / Omc), 2.0)))) / t_1))) else: tmp = math.asin((1.0 / math.hypot(1.0, ((t * math.sqrt(2.0)) / l)))) return tmp
function code(t, l, Om, Omc) t_1 = Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0))) tmp = 0.0 if (t_1 <= 1e+303) tmp = asin(sqrt(Float64(Float64(1.0 + Float64(1.0 + Float64(-1.0 - (Float64(Om / Omc) ^ 2.0)))) / t_1))); else tmp = asin(Float64(1.0 / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 + (2.0 * ((t / l) ^ 2.0)); tmp = 0.0; if (t_1 <= 1e+303) tmp = asin(sqrt(((1.0 + (1.0 + (-1.0 - ((Om / Omc) ^ 2.0)))) / t_1))); else tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+303], N[ArcSin[N[Sqrt[N[(N[(1.0 + N[(1.0 + N[(-1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}\\
\mathbf{if}\;t_1 \leq 10^{+303}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 + \left(1 + \left(-1 - {\left(\frac{Om}{Omc}\right)}^{2}\right)\right)}{t_1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right)\\
\end{array}
\end{array}
if (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2))) < 1e303Initial program 97.5%
expm1-log1p-u97.5%
expm1-udef97.5%
log1p-udef97.5%
add-exp-log97.5%
Applied egg-rr97.5%
if 1e303 < (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2))) Initial program 53.6%
sqrt-div53.7%
div-inv53.7%
add-sqr-sqrt53.7%
hypot-1-def53.7%
*-commutative53.7%
sqrt-prod53.7%
unpow253.7%
sqrt-prod51.1%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
unpow297.3%
times-frac78.8%
unpow278.8%
unpow278.8%
associate-*r/78.8%
*-rgt-identity78.8%
unpow278.8%
unpow278.8%
times-frac97.3%
unpow297.3%
Simplified97.3%
Taylor expanded in Om around 0 96.8%
Taylor expanded in t around 0 96.8%
Final simplification97.3%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 85.5%
sqrt-div85.5%
div-inv85.5%
add-sqr-sqrt85.5%
hypot-1-def85.5%
*-commutative85.5%
sqrt-prod85.4%
unpow285.4%
sqrt-prod59.3%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
unpow297.3%
times-frac86.4%
unpow286.4%
unpow286.4%
associate-*r/86.4%
*-rgt-identity86.4%
unpow286.4%
unpow286.4%
times-frac97.3%
unpow297.3%
Simplified97.3%
Final simplification97.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (+ 1.0 (* 2.0 (pow (/ t l) 2.0))) 1e+303)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ 1.0 (hypot 1.0 (/ (* t (sqrt 2.0)) l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((1.0 + (2.0 * pow((t / l), 2.0))) <= 1e+303) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
return tmp;
}
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((1.0 + (2.0 * Math.pow((t / l), 2.0))) <= 1e+303) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((1.0 / Math.hypot(1.0, ((t * Math.sqrt(2.0)) / l))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (1.0 + (2.0 * math.pow((t / l), 2.0))) <= 1e+303: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((1.0 / math.hypot(1.0, ((t * math.sqrt(2.0)) / l)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0))) <= 1e+303) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(1.0 / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((1.0 + (2.0 * ((t / l) ^ 2.0))) <= 1e+303) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+303], 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 / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2} \leq 10^{+303}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right)\\
\end{array}
\end{array}
if (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2))) < 1e303Initial program 97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
div-inv97.5%
clear-num97.5%
Applied egg-rr97.5%
if 1e303 < (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2))) Initial program 53.6%
sqrt-div53.7%
div-inv53.7%
add-sqr-sqrt53.7%
hypot-1-def53.7%
*-commutative53.7%
sqrt-prod53.7%
unpow253.7%
sqrt-prod51.1%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
unpow297.3%
times-frac78.8%
unpow278.8%
unpow278.8%
associate-*r/78.8%
*-rgt-identity78.8%
unpow278.8%
unpow278.8%
times-frac97.3%
unpow297.3%
Simplified97.3%
Taylor expanded in Om around 0 96.8%
Taylor expanded in t around 0 96.8%
Final simplification97.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (pow (/ t l) 2.0) 5e+302)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (pow((t / l), 2.0) <= 5e+302) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
return tmp;
}
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (Math.pow((t / l), 2.0) <= 5e+302) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if math.pow((t / l), 2.0) <= 5e+302: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((Float64(t / l) ^ 2.0) <= 5e+302) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (((t / l) ^ 2.0) <= 5e+302) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision], 5e+302], 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 / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{t}{\ell}\right)}^{2} \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)\\
\end{array}
\end{array}
if (pow.f64 (/.f64 t l) 2) < 5e302Initial program 97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
unpow297.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
div-inv97.5%
clear-num97.5%
Applied egg-rr97.5%
if 5e302 < (pow.f64 (/.f64 t l) 2) Initial program 53.6%
sqrt-div53.7%
div-inv53.7%
add-sqr-sqrt53.7%
hypot-1-def53.7%
*-commutative53.7%
sqrt-prod53.7%
unpow253.7%
sqrt-prod51.1%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
unpow297.3%
times-frac78.8%
unpow278.8%
unpow278.8%
associate-*r/78.8%
*-rgt-identity78.8%
unpow278.8%
unpow278.8%
times-frac97.3%
unpow297.3%
Simplified97.3%
Taylor expanded in Om around 0 96.8%
Final simplification97.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.01)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (/ (/ l (sqrt 2.0)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.01) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin(((l / sqrt(2.0)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-1000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.01d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin(((l / sqrt(2.0d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.01) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin(((l / Math.sqrt(2.0)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.01: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin(((l / math.sqrt(2.0)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.01) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(Float64(l / sqrt(2.0)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.01) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin(((l / sqrt(2.0)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.01], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.01:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{\sqrt{2}}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e3Initial program 74.5%
sqrt-div74.5%
div-inv74.5%
add-sqr-sqrt74.4%
hypot-1-def74.4%
*-commutative74.4%
sqrt-prod74.3%
unpow274.3%
sqrt-prod0.0%
add-sqr-sqrt96.6%
Applied egg-rr96.6%
unpow296.6%
times-frac83.0%
unpow283.0%
unpow283.0%
associate-*r/83.0%
*-rgt-identity83.0%
unpow283.0%
unpow283.0%
times-frac96.6%
unpow296.6%
Simplified96.6%
Taylor expanded in Om around 0 96.0%
Taylor expanded in t around -inf 97.1%
associate-*r/97.1%
mul-1-neg97.1%
Simplified97.1%
if -1e3 < (/.f64 t l) < 0.0100000000000000002Initial program 96.7%
Taylor expanded in t around 0 84.6%
unpow284.6%
unpow284.6%
times-frac95.2%
unpow295.2%
Simplified95.2%
unpow296.7%
clear-num96.7%
un-div-inv96.7%
Applied egg-rr95.2%
if 0.0100000000000000002 < (/.f64 t l) Initial program 72.6%
sqrt-div72.6%
div-inv72.6%
add-sqr-sqrt72.6%
hypot-1-def72.6%
*-commutative72.6%
sqrt-prod72.5%
unpow272.5%
sqrt-prod99.2%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
unpow299.5%
times-frac90.3%
unpow290.3%
unpow290.3%
associate-*r/90.3%
*-rgt-identity90.3%
unpow290.3%
unpow290.3%
times-frac99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
Taylor expanded in t around 0 99.5%
Taylor expanded in t around inf 98.1%
associate-/r*98.1%
Simplified98.1%
Final simplification96.4%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.01)
(asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc)))))
(asin (/ (/ l (sqrt 2.0)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.01) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin(((l / sqrt(2.0)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-1000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.01d0) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin(((l / sqrt(2.0d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.01) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin(((l / Math.sqrt(2.0)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.01: tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin(((l / math.sqrt(2.0)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.01) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(Float64(l / sqrt(2.0)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.01) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin(((l / sqrt(2.0)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.01], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.01:\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{\sqrt{2}}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e3Initial program 74.5%
sqrt-div74.5%
div-inv74.5%
add-sqr-sqrt74.4%
hypot-1-def74.4%
*-commutative74.4%
sqrt-prod74.3%
unpow274.3%
sqrt-prod0.0%
add-sqr-sqrt96.6%
Applied egg-rr96.6%
unpow296.6%
times-frac83.0%
unpow283.0%
unpow283.0%
associate-*r/83.0%
*-rgt-identity83.0%
unpow283.0%
unpow283.0%
times-frac96.6%
unpow296.6%
Simplified96.6%
Taylor expanded in Om around 0 96.0%
Taylor expanded in t around -inf 97.1%
associate-*r/97.1%
mul-1-neg97.1%
Simplified97.1%
if -1e3 < (/.f64 t l) < 0.0100000000000000002Initial program 96.7%
Taylor expanded in t around 0 84.6%
unpow284.6%
unpow284.6%
times-frac95.2%
unpow295.2%
Simplified95.2%
Taylor expanded in Om around 0 83.5%
unpow283.5%
unpow283.5%
Simplified83.5%
times-frac93.5%
Applied egg-rr93.5%
if 0.0100000000000000002 < (/.f64 t l) Initial program 72.6%
sqrt-div72.6%
div-inv72.6%
add-sqr-sqrt72.6%
hypot-1-def72.6%
*-commutative72.6%
sqrt-prod72.5%
unpow272.5%
sqrt-prod99.2%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
unpow299.5%
times-frac90.3%
unpow290.3%
unpow290.3%
associate-*r/90.3%
*-rgt-identity90.3%
unpow290.3%
unpow290.3%
times-frac99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
Taylor expanded in t around 0 99.5%
Taylor expanded in t around inf 98.1%
associate-/r*98.1%
Simplified98.1%
Final simplification95.5%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l -3.4e-24) (not (<= l 2.75e-104))) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))) (asin (/ l (* t (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -3.4e-24) || !(l <= 2.75e-104)) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((l <= (-3.4d-24)) .or. (.not. (l <= 2.75d-104))) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -3.4e-24) || !(l <= 2.75e-104)) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (l <= -3.4e-24) or not (l <= 2.75e-104): tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((l <= -3.4e-24) || !(l <= 2.75e-104)) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((l <= -3.4e-24) || ~((l <= 2.75e-104))) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, -3.4e-24], N[Not[LessEqual[l, 2.75e-104]], $MachinePrecision]], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{-24} \lor \neg \left(\ell \leq 2.75 \cdot 10^{-104}\right):\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if l < -3.39999999999999992e-24 or 2.7499999999999999e-104 < l Initial program 89.2%
Taylor expanded in t around 0 63.1%
unpow263.1%
unpow263.1%
times-frac71.5%
unpow271.5%
Simplified71.5%
Taylor expanded in Om around 0 62.1%
unpow262.1%
unpow262.1%
Simplified62.1%
times-frac70.1%
Applied egg-rr70.1%
if -3.39999999999999992e-24 < l < 2.7499999999999999e-104Initial program 79.4%
sqrt-div79.3%
div-inv79.3%
add-sqr-sqrt79.3%
hypot-1-def79.3%
*-commutative79.3%
sqrt-prod79.2%
unpow279.2%
sqrt-prod51.6%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
unpow297.5%
times-frac87.4%
unpow287.4%
unpow287.4%
associate-*r/87.4%
*-rgt-identity87.4%
unpow287.4%
unpow287.4%
times-frac97.5%
unpow297.5%
Simplified97.5%
Taylor expanded in Om around 0 97.2%
Taylor expanded in t around inf 62.2%
Final simplification67.2%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l -6.6e-24) (not (<= l 1.65e-102))) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))) (asin (/ (/ l t) (sqrt 2.0)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -6.6e-24) || !(l <= 1.65e-102)) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin(((l / t) / sqrt(2.0)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((l <= (-6.6d-24)) .or. (.not. (l <= 1.65d-102))) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin(((l / t) / sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -6.6e-24) || !(l <= 1.65e-102)) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (l <= -6.6e-24) or not (l <= 1.65e-102): tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin(((l / t) / math.sqrt(2.0))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((l <= -6.6e-24) || !(l <= 1.65e-102)) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((l <= -6.6e-24) || ~((l <= 1.65e-102))) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin(((l / t) / sqrt(2.0))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, -6.6e-24], N[Not[LessEqual[l, 1.65e-102]], $MachinePrecision]], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.6 \cdot 10^{-24} \lor \neg \left(\ell \leq 1.65 \cdot 10^{-102}\right):\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if l < -6.59999999999999968e-24 or 1.65e-102 < l Initial program 89.2%
Taylor expanded in t around 0 63.1%
unpow263.1%
unpow263.1%
times-frac71.5%
unpow271.5%
Simplified71.5%
Taylor expanded in Om around 0 62.1%
unpow262.1%
unpow262.1%
Simplified62.1%
times-frac70.1%
Applied egg-rr70.1%
if -6.59999999999999968e-24 < l < 1.65e-102Initial program 79.4%
sqrt-div79.3%
div-inv79.3%
add-sqr-sqrt79.3%
hypot-1-def79.3%
*-commutative79.3%
sqrt-prod79.2%
unpow279.2%
sqrt-prod51.6%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
unpow297.5%
times-frac87.4%
unpow287.4%
unpow287.4%
associate-*r/87.4%
*-rgt-identity87.4%
unpow287.4%
unpow287.4%
times-frac97.5%
unpow297.5%
Simplified97.5%
Taylor expanded in Om around 0 97.2%
Taylor expanded in t around inf 62.2%
associate-/l/62.3%
Simplified62.3%
Final simplification67.2%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l -3.1e-24) (not (<= l 5e-107))) (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))) (asin (/ (/ l (sqrt 2.0)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -3.1e-24) || !(l <= 5e-107)) {
tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = asin(((l / sqrt(2.0)) / t));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((l <= (-3.1d-24)) .or. (.not. (l <= 5d-107))) then
tmp = asin((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
else
tmp = asin(((l / sqrt(2.0d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -3.1e-24) || !(l <= 5e-107)) {
tmp = Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
} else {
tmp = Math.asin(((l / Math.sqrt(2.0)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (l <= -3.1e-24) or not (l <= 5e-107): tmp = math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))) else: tmp = math.asin(((l / math.sqrt(2.0)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((l <= -3.1e-24) || !(l <= 5e-107)) tmp = asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))); else tmp = asin(Float64(Float64(l / sqrt(2.0)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((l <= -3.1e-24) || ~((l <= 5e-107))) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); else tmp = asin(((l / sqrt(2.0)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, -3.1e-24], N[Not[LessEqual[l, 5e-107]], $MachinePrecision]], N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.1 \cdot 10^{-24} \lor \neg \left(\ell \leq 5 \cdot 10^{-107}\right):\\
\;\;\;\;\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{\sqrt{2}}}{t}\right)\\
\end{array}
\end{array}
if l < -3.1e-24 or 4.99999999999999971e-107 < l Initial program 89.2%
Taylor expanded in t around 0 63.1%
unpow263.1%
unpow263.1%
times-frac71.5%
unpow271.5%
Simplified71.5%
Taylor expanded in Om around 0 62.1%
unpow262.1%
unpow262.1%
Simplified62.1%
times-frac70.1%
Applied egg-rr70.1%
if -3.1e-24 < l < 4.99999999999999971e-107Initial program 79.4%
sqrt-div79.3%
div-inv79.3%
add-sqr-sqrt79.3%
hypot-1-def79.3%
*-commutative79.3%
sqrt-prod79.2%
unpow279.2%
sqrt-prod51.6%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
unpow297.5%
times-frac87.4%
unpow287.4%
unpow287.4%
associate-*r/87.4%
*-rgt-identity87.4%
unpow287.4%
unpow287.4%
times-frac97.5%
unpow297.5%
Simplified97.5%
Taylor expanded in Om around 0 97.2%
Taylor expanded in t around 0 97.1%
Taylor expanded in t around inf 62.2%
associate-/r*62.3%
Simplified62.3%
Final simplification67.2%
(FPCore (t l Om Omc) :precision binary64 (asin (+ 1.0 (* -0.5 (* (/ Om Omc) (/ Om Omc))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
}
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((1.0d0 + ((-0.5d0) * ((om / omc) * (om / omc)))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 + Float64(-0.5 * Float64(Float64(Om / Omc) * Float64(Om / Omc))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 + (-0.5 * ((Om / Omc) * (Om / Omc))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 + N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(1 + -0.5 \cdot \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right)\right)
\end{array}
Initial program 85.5%
Taylor expanded in t around 0 46.3%
unpow246.3%
unpow246.3%
times-frac52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in Om around 0 45.7%
unpow245.7%
unpow245.7%
Simplified45.7%
times-frac51.1%
Applied egg-rr51.1%
Final simplification51.1%
(FPCore (t l Om Omc) :precision binary64 (asin 1.0))
double code(double t, double l, double Om, double Omc) {
return asin(1.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(1.0d0)
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
def code(t, l, Om, Omc): return math.asin(1.0)
function code(t, l, Om, Omc) return asin(1.0) end
function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} 1
\end{array}
Initial program 85.5%
Taylor expanded in t around 0 46.3%
unpow246.3%
unpow246.3%
times-frac52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in Om around 0 50.4%
Final simplification50.4%
herbie shell --seed 2023185
(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)))))))