
(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 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (/ (* t (sqrt 2.0)) l)))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l)))); 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 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 80.1%
sqrt-div80.1%
div-inv80.1%
add-sqr-sqrt80.1%
hypot-1-def80.1%
*-commutative80.1%
sqrt-prod80.0%
unpow280.0%
sqrt-prod55.2%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
associate-*r/98.8%
*-rgt-identity98.8%
associate-*l/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (sqrt 2.0) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, (sqrt(2.0) * (t / l)))));
}
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, (Math.sqrt(2.0) * (t / l)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, (math.sqrt(2.0) * (t / l)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(sqrt(2.0) * Float64(t / l))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, (sqrt(2.0) * (t / l))))); 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[Sqrt[2.0], $MachinePrecision] * N[(t / l), $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, \sqrt{2} \cdot \frac{t}{\ell}\right)}\right)
\end{array}
Initial program 80.1%
sqrt-div80.1%
add-sqr-sqrt80.1%
hypot-1-def80.1%
*-commutative80.1%
sqrt-prod80.1%
unpow280.1%
sqrt-prod55.2%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (/ (* t (sqrt 2.0)) l)))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t * Math.sqrt(2.0)) / l))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l)))); end
code[t_, l_, Om_, Omc_] := 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}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 80.1%
sqrt-div80.1%
div-inv80.1%
add-sqr-sqrt80.1%
hypot-1-def80.1%
*-commutative80.1%
sqrt-prod80.0%
unpow280.0%
sqrt-prod55.2%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
associate-*r/98.8%
*-rgt-identity98.8%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in Om around 0 97.4%
Final simplification97.4%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+159)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 5e+134)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ 1.0 (* (/ l t) (/ l t))))))))
(asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+159) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 5e+134) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t))))))));
} 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) <= (-1d+159)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 5d+134) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t) * (l / t))))))))
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) <= -1e+159) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 5e+134) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t))))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+159: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 5e+134: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t)))))))) 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) <= -1e+159) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 5e+134) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t) * Float64(l / t)))))))); 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 ((t / l) <= -1e+159) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 5e+134) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t)))))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1e+159], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+134], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(1.0 / N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;\frac{t}{\ell} \leq -1 \cdot 10^{+159}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+134}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{1}{\frac{\ell}{t} \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.9999999999999993e158Initial program 31.6%
Taylor expanded in t around -inf 90.0%
Taylor expanded in Om around 0 99.5%
if -9.9999999999999993e158 < (/.f64 t l) < 4.99999999999999981e134Initial program 98.9%
unpow298.9%
clear-num98.9%
clear-num98.8%
frac-times98.9%
metadata-eval98.9%
Applied egg-rr98.9%
unpow267.0%
Applied egg-rr98.9%
if 4.99999999999999981e134 < (/.f64 t l) Initial program 46.9%
sqrt-div46.9%
div-inv46.9%
add-sqr-sqrt46.9%
hypot-1-def46.9%
*-commutative46.9%
sqrt-prod46.9%
unpow246.9%
sqrt-prod97.9%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in t around inf 77.0%
*-commutative77.0%
unpow277.0%
unpow277.0%
times-frac99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in Om around 0 95.9%
Final simplification98.6%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+83)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 20000.0)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ t (* l (/ l t))))))))
(asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+83) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 20000.0) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} 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) <= (-2d+83)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 20000.0d0) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * (t / (l * (l / t))))))))
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) <= -2e+83) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 20000.0) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+83: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 20000.0: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t)))))))) 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) <= -2e+83) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 20000.0) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(t / Float64(l * Float64(l / t)))))))); 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 ((t / l) <= -2e+83) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 20000.0) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t)))))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+83], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 20000.0], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(t / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;\frac{t}{\ell} \leq -2 \cdot 10^{+83}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 20000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{t}{\ell \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2.00000000000000006e83Initial program 53.5%
Taylor expanded in t around -inf 89.8%
Taylor expanded in Om around 0 98.6%
if -2.00000000000000006e83 < (/.f64 t l) < 2e4Initial program 98.7%
unpow298.7%
clear-num98.7%
frac-times97.9%
*-un-lft-identity97.9%
Applied egg-rr97.9%
unpow288.0%
Applied egg-rr97.9%
if 2e4 < (/.f64 t l) Initial program 67.7%
sqrt-div67.7%
div-inv67.7%
add-sqr-sqrt67.7%
hypot-1-def67.7%
*-commutative67.7%
sqrt-prod67.7%
unpow267.7%
sqrt-prod98.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in t around inf 84.3%
*-commutative84.3%
unpow284.3%
unpow284.3%
times-frac99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in Om around 0 96.5%
Final simplification97.7%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -40.0)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e-6)
(asin (sqrt (- 1.0 (* (/ Om Omc) (/ Om Omc)))))
(asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -40.0) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e-6) {
tmp = asin(sqrt((1.0 - ((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 ((t / l) <= (-40.0d0)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d-6) then
tmp = asin(sqrt((1.0d0 - ((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 ((t / l) <= -40.0) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e-6) {
tmp = Math.asin(Math.sqrt((1.0 - ((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 (t / l) <= -40.0: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e-6: tmp = math.asin(math.sqrt((1.0 - ((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 (Float64(t / l) <= -40.0) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e-6) tmp = asin(sqrt(Float64(1.0 - 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 ((t / l) <= -40.0) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e-6) tmp = asin(sqrt((1.0 - ((Om / Omc) * (Om / Omc))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -40.0], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-6], N[ArcSin[N[Sqrt[N[(1.0 - 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}\;\frac{t}{\ell} \leq -40:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -40Initial program 61.4%
Taylor expanded in t around -inf 90.8%
Taylor expanded in Om around 0 98.1%
if -40 < (/.f64 t l) < 1.99999999999999991e-6Initial program 98.6%
Taylor expanded in t around 0 90.5%
unpow290.5%
unpow290.5%
times-frac98.2%
unpow298.2%
Simplified98.2%
unpow298.2%
Applied egg-rr98.2%
if 1.99999999999999991e-6 < (/.f64 t l) Initial program 68.7%
sqrt-div68.6%
div-inv68.6%
add-sqr-sqrt68.6%
hypot-1-def68.6%
*-commutative68.6%
sqrt-prod68.6%
unpow268.6%
sqrt-prod98.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in t around inf 83.3%
*-commutative83.3%
unpow283.3%
unpow283.3%
times-frac98.0%
unpow298.0%
Simplified98.0%
Taylor expanded in Om around 0 95.1%
Final simplification97.4%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -40.0)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e-6)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -40.0) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e-6) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} 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) <= (-40.0d0)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d-6) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
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) <= -40.0) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e-6) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -40.0: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e-6: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) 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) <= -40.0) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e-6) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); 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 ((t / l) <= -40.0) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e-6) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -40.0], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-6], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $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}\;\frac{t}{\ell} \leq -40:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -40Initial program 61.4%
Taylor expanded in t around -inf 90.8%
Taylor expanded in Om around 0 98.1%
if -40 < (/.f64 t l) < 1.99999999999999991e-6Initial program 98.6%
sqrt-div98.6%
div-inv98.6%
add-sqr-sqrt98.6%
hypot-1-def98.6%
*-commutative98.6%
sqrt-prod98.6%
unpow298.6%
sqrt-prod66.6%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.5%
Taylor expanded in t around 0 86.6%
associate-*r/86.6%
*-commutative86.6%
unpow286.6%
rem-square-sqrt86.6%
associate-*r*86.6%
metadata-eval86.6%
associate-*r/86.6%
unpow286.6%
unpow286.6%
times-frac97.6%
unpow297.6%
mul-1-neg97.6%
Simplified97.6%
if 1.99999999999999991e-6 < (/.f64 t l) Initial program 68.7%
sqrt-div68.6%
div-inv68.6%
add-sqr-sqrt68.6%
hypot-1-def68.6%
*-commutative68.6%
sqrt-prod68.6%
unpow268.6%
sqrt-prod98.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in t around inf 83.3%
*-commutative83.3%
unpow283.3%
unpow283.3%
times-frac98.0%
unpow298.0%
Simplified98.0%
Taylor expanded in Om around 0 95.1%
Final simplification97.1%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (* t (sqrt 2.0))))
(if (<= l -4.5e-13)
(asin 1.0)
(if (<= l -1.55e-302)
(asin (/ (- l) t_1))
(if (<= l 8.2e-24) (asin (/ l t_1)) (asin 1.0))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = t * sqrt(2.0);
double tmp;
if (l <= -4.5e-13) {
tmp = asin(1.0);
} else if (l <= -1.55e-302) {
tmp = asin((-l / t_1));
} else if (l <= 8.2e-24) {
tmp = asin((l / t_1));
} else {
tmp = asin(1.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) :: t_1
real(8) :: tmp
t_1 = t * sqrt(2.0d0)
if (l <= (-4.5d-13)) then
tmp = asin(1.0d0)
else if (l <= (-1.55d-302)) then
tmp = asin((-l / t_1))
else if (l <= 8.2d-24) then
tmp = asin((l / t_1))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = t * Math.sqrt(2.0);
double tmp;
if (l <= -4.5e-13) {
tmp = Math.asin(1.0);
} else if (l <= -1.55e-302) {
tmp = Math.asin((-l / t_1));
} else if (l <= 8.2e-24) {
tmp = Math.asin((l / t_1));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = t * math.sqrt(2.0) tmp = 0 if l <= -4.5e-13: tmp = math.asin(1.0) elif l <= -1.55e-302: tmp = math.asin((-l / t_1)) elif l <= 8.2e-24: tmp = math.asin((l / t_1)) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) t_1 = Float64(t * sqrt(2.0)) tmp = 0.0 if (l <= -4.5e-13) tmp = asin(1.0); elseif (l <= -1.55e-302) tmp = asin(Float64(Float64(-l) / t_1)); elseif (l <= 8.2e-24) tmp = asin(Float64(l / t_1)); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = t * sqrt(2.0); tmp = 0.0; if (l <= -4.5e-13) tmp = asin(1.0); elseif (l <= -1.55e-302) tmp = asin((-l / t_1)); elseif (l <= 8.2e-24) tmp = asin((l / t_1)); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.5e-13], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.55e-302], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 8.2e-24], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{-13}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -1.55 \cdot 10^{-302}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\ell \leq 8.2 \cdot 10^{-24}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -4.5e-13 or 8.20000000000000029e-24 < l Initial program 88.0%
Taylor expanded in t around 0 65.2%
unpow265.2%
unpow265.2%
times-frac70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in Om around 0 69.7%
if -4.5e-13 < l < -1.54999999999999992e-302Initial program 73.1%
sqrt-div73.0%
div-inv73.0%
add-sqr-sqrt73.0%
hypot-1-def73.0%
*-commutative73.0%
sqrt-prod72.9%
unpow272.9%
sqrt-prod51.5%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.3%
*-rgt-identity99.3%
associate-*l/99.3%
Simplified99.3%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around -inf 50.2%
associate-*r/50.2%
mul-1-neg50.2%
Simplified50.2%
if -1.54999999999999992e-302 < l < 8.20000000000000029e-24Initial program 70.2%
sqrt-div70.1%
div-inv70.1%
add-sqr-sqrt70.1%
hypot-1-def70.1%
*-commutative70.1%
sqrt-prod70.1%
unpow270.1%
sqrt-prod37.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in t around inf 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
times-frac40.3%
unpow240.3%
Simplified40.3%
Taylor expanded in Om around 0 38.8%
Final simplification57.8%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -1.25e-12)
(asin 1.0)
(if (<= l -1.55e-302)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= l 1.3e-30) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.25e-12) {
tmp = asin(1.0);
} else if (l <= -1.55e-302) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if (l <= 1.3e-30) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.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 <= (-1.25d-12)) then
tmp = asin(1.0d0)
else if (l <= (-1.55d-302)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if (l <= 1.3d-30) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.25e-12) {
tmp = Math.asin(1.0);
} else if (l <= -1.55e-302) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if (l <= 1.3e-30) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -1.25e-12: tmp = math.asin(1.0) elif l <= -1.55e-302: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif l <= 1.3e-30: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -1.25e-12) tmp = asin(1.0); elseif (l <= -1.55e-302) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (l <= 1.3e-30) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -1.25e-12) tmp = asin(1.0); elseif (l <= -1.55e-302) tmp = asin((sqrt(0.5) * (-l / t))); elseif (l <= 1.3e-30) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.25e-12], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.55e-302], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.3e-30], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.25 \cdot 10^{-12}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -1.55 \cdot 10^{-302}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{-30}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.24999999999999992e-12 or 1.29999999999999993e-30 < l Initial program 88.0%
Taylor expanded in t around 0 65.2%
unpow265.2%
unpow265.2%
times-frac70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in Om around 0 69.7%
if -1.24999999999999992e-12 < l < -1.54999999999999992e-302Initial program 73.1%
Taylor expanded in t around -inf 44.4%
Taylor expanded in Om around 0 50.3%
associate-*l/50.2%
Simplified50.2%
if -1.54999999999999992e-302 < l < 1.29999999999999993e-30Initial program 70.2%
sqrt-div70.1%
div-inv70.1%
add-sqr-sqrt70.1%
hypot-1-def70.1%
*-commutative70.1%
sqrt-prod70.1%
unpow270.1%
sqrt-prod37.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in t around inf 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
times-frac40.3%
unpow240.3%
Simplified40.3%
Taylor expanded in Om around 0 38.8%
Final simplification57.8%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -1.75e-10)
(asin 1.0)
(if (<= l -1.55e-302)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= l 1.65e-27) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.75e-10) {
tmp = asin(1.0);
} else if (l <= -1.55e-302) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if (l <= 1.65e-27) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.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 <= (-1.75d-10)) then
tmp = asin(1.0d0)
else if (l <= (-1.55d-302)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if (l <= 1.65d-27) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.75e-10) {
tmp = Math.asin(1.0);
} else if (l <= -1.55e-302) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if (l <= 1.65e-27) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -1.75e-10: tmp = math.asin(1.0) elif l <= -1.55e-302: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif l <= 1.65e-27: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -1.75e-10) tmp = asin(1.0); elseif (l <= -1.55e-302) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (l <= 1.65e-27) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -1.75e-10) tmp = asin(1.0); elseif (l <= -1.55e-302) tmp = asin(((l * -sqrt(0.5)) / t)); elseif (l <= 1.65e-27) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.75e-10], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.55e-302], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.65e-27], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{-10}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -1.55 \cdot 10^{-302}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\ell \leq 1.65 \cdot 10^{-27}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.7499999999999999e-10 or 1.64999999999999999e-27 < l Initial program 88.0%
Taylor expanded in t around 0 65.2%
unpow265.2%
unpow265.2%
times-frac70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in Om around 0 69.7%
if -1.7499999999999999e-10 < l < -1.54999999999999992e-302Initial program 73.1%
Taylor expanded in t around -inf 44.4%
Taylor expanded in Om around 0 50.3%
if -1.54999999999999992e-302 < l < 1.64999999999999999e-27Initial program 70.2%
sqrt-div70.1%
div-inv70.1%
add-sqr-sqrt70.1%
hypot-1-def70.1%
*-commutative70.1%
sqrt-prod70.1%
unpow270.1%
sqrt-prod37.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in t around inf 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
times-frac40.3%
unpow240.3%
Simplified40.3%
Taylor expanded in Om around 0 38.8%
Final simplification57.9%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.16e+98) (asin 1.0) (asin (/ l (* t (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.16e+98) {
tmp = asin(1.0);
} 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 <= 1.16d+98) then
tmp = asin(1.0d0)
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 <= 1.16e+98) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 1.16e+98: tmp = math.asin(1.0) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.16e+98) tmp = asin(1.0); 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 (t <= 1.16e+98) tmp = asin(1.0); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.16e+98], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.16 \cdot 10^{+98}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 1.15999999999999995e98Initial program 82.8%
Taylor expanded in t around 0 49.9%
unpow249.9%
unpow249.9%
times-frac54.2%
unpow254.2%
Simplified54.2%
Taylor expanded in Om around 0 53.7%
if 1.15999999999999995e98 < t Initial program 66.2%
sqrt-div66.2%
div-inv66.2%
add-sqr-sqrt66.2%
hypot-1-def66.2%
*-commutative66.2%
sqrt-prod66.1%
unpow266.1%
sqrt-prod44.0%
add-sqr-sqrt97.6%
Applied egg-rr97.6%
associate-*r/97.6%
*-rgt-identity97.6%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around inf 50.1%
*-commutative50.1%
unpow250.1%
unpow250.1%
times-frac57.5%
unpow257.5%
Simplified57.5%
Taylor expanded in Om around 0 55.6%
Final simplification54.0%
(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 80.1%
Taylor expanded in t around 0 43.5%
unpow243.5%
unpow243.5%
times-frac47.2%
unpow247.2%
Simplified47.2%
Taylor expanded in Om around 0 46.7%
Final simplification46.7%
herbie shell --seed 2023326
(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)))))))