
(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}
(FPCore (t l Om Omc)
:precision binary64
(asin
(/
1.0
(/
(hypot 1.0 (* (/ t l) (sqrt 2.0)))
(sqrt (- 1.0 (pow (/ Om Omc) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / (hypot(1.0, ((t / l) * sqrt(2.0))) / sqrt((1.0 - pow((Om / Omc), 2.0))))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / (Math.hypot(1.0, ((t / l) * Math.sqrt(2.0))) / Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / (math.hypot(1.0, ((t / l) * math.sqrt(2.0))) / math.sqrt((1.0 - math.pow((Om / Omc), 2.0))))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / Float64(hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))) / sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / (hypot(1.0, ((t / l) * sqrt(2.0))) / sqrt((1.0 - ((Om / Omc) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\frac{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}}\right)
\end{array}
Initial program 80.9%
sqrt-div80.9%
clear-num80.9%
add-sqr-sqrt80.9%
hypot-1-def80.9%
*-commutative80.9%
sqrt-prod80.8%
sqrt-pow198.9%
metadata-eval98.9%
pow198.9%
Applied egg-rr98.9%
Final simplification98.9%
(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 80.9%
sqrt-div80.9%
div-inv80.9%
add-sqr-sqrt80.9%
hypot-1-def80.9%
*-commutative80.9%
sqrt-prod80.8%
sqrt-pow198.9%
metadata-eval98.9%
pow198.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
Final simplification98.9%
(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(t * Float64(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[(t * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{\sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 80.9%
sqrt-div80.9%
clear-num80.9%
add-sqr-sqrt80.9%
hypot-1-def80.9%
*-commutative80.9%
sqrt-prod80.8%
sqrt-pow198.9%
metadata-eval98.9%
pow198.9%
Applied egg-rr98.9%
Taylor expanded in Om around 0 65.4%
associate-/l*64.1%
unpow264.1%
unpow264.1%
unpow264.1%
times-frac64.2%
swap-sqr80.1%
associate-/l*80.1%
associate-/l*80.1%
metadata-eval80.1%
hypot-undefine97.5%
associate-/l*97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := 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}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 80.9%
sqrt-div80.9%
clear-num80.9%
add-sqr-sqrt80.9%
hypot-1-def80.9%
*-commutative80.9%
sqrt-prod80.8%
sqrt-pow198.9%
metadata-eval98.9%
pow198.9%
Applied egg-rr98.9%
Taylor expanded in Om around 0 98.0%
*-un-lft-identity98.0%
/-rgt-identity98.0%
Applied egg-rr98.0%
*-lft-identity98.0%
*-commutative98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1
(asin
(sqrt
(/
(- 1.0 (/ Om (* Omc (/ Omc Om))))
(+ 1.0 (* 2.0 (/ (* t (/ t l)) l))))))))
(if (<= t 3.6e+21)
t_1
(if (<= t 1.9e+30)
(asin (/ l (* t (sqrt 2.0))))
(if (<= t 7.8e+50)
t_1
(if (<= t 1.9e+116)
(asin (/ l (/ t (sqrt 0.5))))
(if (<= t 1.55e+178) t_1 (asin (/ (/ l t) (sqrt 2.0))))))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
double tmp;
if (t <= 3.6e+21) {
tmp = t_1;
} else if (t <= 1.9e+30) {
tmp = asin((l / (t * sqrt(2.0))));
} else if (t <= 7.8e+50) {
tmp = t_1;
} else if (t <= 1.9e+116) {
tmp = asin((l / (t / sqrt(0.5))));
} else if (t <= 1.55e+178) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = asin(sqrt(((1.0d0 - (om / (omc * (omc / om)))) / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
if (t <= 3.6d+21) then
tmp = t_1
else if (t <= 1.9d+30) then
tmp = asin((l / (t * sqrt(2.0d0))))
else if (t <= 7.8d+50) then
tmp = t_1
else if (t <= 1.9d+116) then
tmp = asin((l / (t / sqrt(0.5d0))))
else if (t <= 1.55d+178) then
tmp = t_1
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 t_1 = Math.asin(Math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
double tmp;
if (t <= 3.6e+21) {
tmp = t_1;
} else if (t <= 1.9e+30) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else if (t <= 7.8e+50) {
tmp = t_1;
} else if (t <= 1.9e+116) {
tmp = Math.asin((l / (t / Math.sqrt(0.5))));
} else if (t <= 1.55e+178) {
tmp = t_1;
} else {
tmp = Math.asin(((l / t) / Math.sqrt(2.0)));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.asin(math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t * (t / l)) / l)))))) tmp = 0 if t <= 3.6e+21: tmp = t_1 elif t <= 1.9e+30: tmp = math.asin((l / (t * math.sqrt(2.0)))) elif t <= 7.8e+50: tmp = t_1 elif t <= 1.9e+116: tmp = math.asin((l / (t / math.sqrt(0.5)))) elif t <= 1.55e+178: tmp = t_1 else: tmp = math.asin(((l / t) / math.sqrt(2.0))) return tmp
function code(t, l, Om, Omc) t_1 = asin(sqrt(Float64(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om)))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l)))))) tmp = 0.0 if (t <= 3.6e+21) tmp = t_1; elseif (t <= 1.9e+30) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); elseif (t <= 7.8e+50) tmp = t_1; elseif (t <= 1.9e+116) tmp = asin(Float64(l / Float64(t / sqrt(0.5)))); elseif (t <= 1.55e+178) tmp = t_1; else tmp = asin(Float64(Float64(l / t) / sqrt(2.0))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t * (t / l)) / l)))))); tmp = 0.0; if (t <= 3.6e+21) tmp = t_1; elseif (t <= 1.9e+30) tmp = asin((l / (t * sqrt(2.0)))); elseif (t <= 7.8e+50) tmp = t_1; elseif (t <= 1.9e+116) tmp = asin((l / (t / sqrt(0.5)))); elseif (t <= 1.55e+178) tmp = t_1; else tmp = asin(((l / t) / sqrt(2.0))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.6e+21], t$95$1, If[LessEqual[t, 1.9e+30], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 7.8e+50], t$95$1, If[LessEqual[t, 1.9e+116], N[ArcSin[N[(l / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 1.55e+178], t$95$1, N[ArcSin[N[(N[(l / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\
\mathbf{if}\;t \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+30}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+116}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+178}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{t}}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 3.6e21 or 1.9000000000000001e30 < t < 7.79999999999999935e50 or 1.8999999999999999e116 < t < 1.54999999999999996e178Initial program 85.0%
unpow285.0%
associate-*r/82.8%
Applied egg-rr82.8%
unpow257.7%
clear-num57.7%
frac-times57.7%
*-un-lft-identity57.7%
Applied egg-rr82.8%
if 3.6e21 < t < 1.9000000000000001e30Initial program 8.6%
sqrt-div8.6%
clear-num8.6%
add-sqr-sqrt8.6%
hypot-1-def8.6%
*-commutative8.6%
sqrt-prod8.6%
sqrt-pow199.2%
metadata-eval99.2%
pow199.2%
Applied egg-rr99.2%
Taylor expanded in Om around 0 99.2%
Taylor expanded in t around inf 54.2%
if 7.79999999999999935e50 < t < 1.8999999999999999e116Initial program 79.3%
Taylor expanded in t around inf 19.0%
Taylor expanded in Om around 0 54.4%
associate-*r/54.3%
Simplified54.3%
clear-num54.3%
un-div-inv54.3%
Applied egg-rr54.3%
if 1.54999999999999996e178 < t Initial program 61.4%
sqrt-div61.3%
clear-num61.3%
add-sqr-sqrt61.3%
hypot-1-def61.3%
*-commutative61.3%
sqrt-prod61.2%
sqrt-pow199.4%
metadata-eval99.4%
pow199.4%
Applied egg-rr99.4%
Taylor expanded in Om around 0 97.1%
*-un-lft-identity97.1%
/-rgt-identity97.1%
Applied egg-rr97.1%
*-lft-identity97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 64.3%
associate-/r*64.3%
Simplified64.3%
Final simplification79.0%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 4.5e+20) (asin (sqrt (- 1.0 (/ Om (* Omc (/ Omc Om)))))) (asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.5e+20) {
tmp = asin(sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
} else {
tmp = asin(((l * sqrt(0.5)) / 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 <= 4.5d+20) then
tmp = asin(sqrt((1.0d0 - (om / (omc * (omc / om))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.5e+20) {
tmp = Math.asin(Math.sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 4.5e+20: tmp = math.asin(math.sqrt((1.0 - (Om / (Omc * (Omc / Om)))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 4.5e+20) tmp = asin(sqrt(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om)))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 4.5e+20) tmp = asin(sqrt((1.0 - (Om / (Omc * (Omc / Om)))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 4.5e+20], N[ArcSin[N[Sqrt[N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.5 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 4.5e20Initial program 86.0%
Taylor expanded in t around 0 54.3%
unpow254.3%
unpow254.3%
times-frac60.0%
unpow260.0%
Simplified60.0%
unpow259.7%
clear-num59.7%
frac-times59.7%
*-un-lft-identity59.7%
Applied egg-rr60.0%
if 4.5e20 < t Initial program 63.3%
Taylor expanded in t around inf 44.8%
Taylor expanded in Om around 0 55.8%
Final simplification59.1%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 9e+20) (asin (+ 1.0 (* (/ Om (* Omc (/ Omc Om))) -0.5))) (asin (* l (/ (sqrt 0.5) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 9e+20) {
tmp = asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)));
} else {
tmp = asin((l * (sqrt(0.5) / 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 <= 9d+20) then
tmp = asin((1.0d0 + ((om / (omc * (omc / om))) * (-0.5d0))))
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 9e+20) {
tmp = Math.asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 9e+20: tmp = math.asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 9e+20) tmp = asin(Float64(1.0 + Float64(Float64(Om / Float64(Omc * Float64(Omc / Om))) * -0.5))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 9e+20) tmp = asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5))); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 9e+20], N[ArcSin[N[(1.0 + N[(N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(1 + \frac{Om}{Omc \cdot \frac{Omc}{Om}} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 9e20Initial program 86.0%
Taylor expanded in t around 0 54.3%
unpow254.3%
unpow254.3%
times-frac60.0%
unpow260.0%
Simplified60.0%
Taylor expanded in Om around 0 54.0%
*-commutative54.0%
unpow254.0%
unpow254.0%
times-frac59.7%
unpow259.7%
Simplified59.7%
unpow259.7%
clear-num59.7%
frac-times59.7%
*-un-lft-identity59.7%
Applied egg-rr59.7%
if 9e20 < t Initial program 63.3%
Taylor expanded in t around inf 44.8%
Taylor expanded in Om around 0 55.8%
associate-*r/55.8%
Simplified55.8%
Final simplification58.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.35e+20) (asin (+ 1.0 (* (/ Om (* Omc (/ Omc Om))) -0.5))) (asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.35e+20) {
tmp = asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)));
} else {
tmp = asin(((l * sqrt(0.5)) / 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 <= 1.35d+20) then
tmp = asin((1.0d0 + ((om / (omc * (omc / om))) * (-0.5d0))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.35e+20) {
tmp = Math.asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 1.35e+20: tmp = math.asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.35e+20) tmp = asin(Float64(1.0 + Float64(Float64(Om / Float64(Omc * Float64(Omc / Om))) * -0.5))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1.35e+20) tmp = asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.35e+20], N[ArcSin[N[(1.0 + N[(N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.35 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(1 + \frac{Om}{Omc \cdot \frac{Omc}{Om}} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 1.35e20Initial program 86.0%
Taylor expanded in t around 0 54.3%
unpow254.3%
unpow254.3%
times-frac60.0%
unpow260.0%
Simplified60.0%
Taylor expanded in Om around 0 54.0%
*-commutative54.0%
unpow254.0%
unpow254.0%
times-frac59.7%
unpow259.7%
Simplified59.7%
unpow259.7%
clear-num59.7%
frac-times59.7%
*-un-lft-identity59.7%
Applied egg-rr59.7%
if 1.35e20 < t Initial program 63.3%
Taylor expanded in t around inf 44.8%
Taylor expanded in Om around 0 55.8%
Final simplification58.8%
(FPCore (t l Om Omc) :precision binary64 (asin (+ 1.0 (* (/ Om (* Omc (/ Omc Om))) -0.5))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)));
}
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 + ((om / (omc * (omc / om))) * (-0.5d0))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)));
}
def code(t, l, Om, Omc): return math.asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5)))
function code(t, l, Om, Omc) return asin(Float64(1.0 + Float64(Float64(Om / Float64(Omc * Float64(Omc / Om))) * -0.5))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 + ((Om / (Omc * (Omc / Om))) * -0.5))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 + N[(N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(1 + \frac{Om}{Omc \cdot \frac{Omc}{Om}} \cdot -0.5\right)
\end{array}
Initial program 80.9%
Taylor expanded in t around 0 45.0%
unpow245.0%
unpow245.0%
times-frac49.8%
unpow249.8%
Simplified49.8%
Taylor expanded in Om around 0 44.7%
*-commutative44.7%
unpow244.7%
unpow244.7%
times-frac49.5%
unpow249.5%
Simplified49.5%
unpow249.5%
clear-num49.5%
frac-times49.5%
*-un-lft-identity49.5%
Applied egg-rr49.5%
Final simplification49.5%
(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.9%
Taylor expanded in t around 0 45.0%
unpow245.0%
unpow245.0%
times-frac49.8%
unpow249.8%
Simplified49.8%
Taylor expanded in Om around 0 49.4%
Final simplification49.4%
herbie shell --seed 2024112
(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)))))))