
(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 (/ (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%
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%
(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%
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%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) 4e+139)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= 4e+139) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} 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 / l) <= 4d+139) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
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 / l) <= 4e+139) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= 4e+139: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= 4e+139) 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 * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= 4e+139) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], 4e+139], 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 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq 4 \cdot 10^{+139}:\\
\;\;\;\;\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{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 4.00000000000000013e139Initial program 89.4%
unpow289.4%
associate-*r/85.0%
Applied egg-rr85.0%
unpow285.0%
clear-num85.0%
un-div-inv85.0%
Applied egg-rr85.0%
associate-/l*89.4%
Applied egg-rr89.4%
if 4.00000000000000013e139 < (/.f64 t l) Initial program 37.5%
add-cube-cbrt37.5%
pow337.5%
Applied egg-rr37.5%
Taylor expanded in Om around 0 37.5%
Taylor expanded in t around inf 97.9%
associate-*l/98.0%
rem-cube-cbrt99.5%
metadata-eval99.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in l around 0 99.5%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.08e+179) (asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (/ (* t (/ t l)) l)))))) (asin (/ (/ l (sqrt 2.0)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.08e+179) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} 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 <= 1.08d+179) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
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 <= 1.08e+179) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = Math.asin(((l / Math.sqrt(2.0)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 1.08e+179: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l)))))) else: tmp = math.asin(((l / math.sqrt(2.0)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.08e+179) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l)))))); 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 <= 1.08e+179) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l)))))); else tmp = asin(((l / sqrt(2.0)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.08e+179], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $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}\;t \leq 1.08 \cdot 10^{+179}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{\sqrt{2}}}{t}\right)\\
\end{array}
\end{array}
if t < 1.08000000000000007e179Initial program 83.4%
unpow283.4%
associate-*r/81.3%
Applied egg-rr81.3%
Taylor expanded in Om around 0 80.8%
if 1.08000000000000007e179 < t Initial program 61.4%
sqrt-div61.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%
associate-*l/97.0%
clear-num97.0%
Applied egg-rr97.0%
associate-/r/97.0%
Simplified97.0%
Taylor expanded in l around 0 64.3%
*-commutative64.3%
associate-/r*64.4%
Simplified64.4%
Final simplification78.9%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 6.6e+179) (asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (/ t (* l (/ l t)))))))) (asin (/ (/ l (sqrt 2.0)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 6.6e+179) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * (t / (l * (l / t))))))));
} 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 <= 6.6d+179) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * (t / (l * (l / t))))))))
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 <= 6.6e+179) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = Math.asin(((l / Math.sqrt(2.0)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 6.6e+179: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * (t / (l * (l / t)))))))) else: tmp = math.asin(((l / math.sqrt(2.0)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 6.6e+179) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(t / Float64(l * Float64(l / t)))))))); 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 <= 6.6e+179) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * (t / (l * (l / t)))))))); else tmp = asin(((l / sqrt(2.0)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 6.6e+179], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(t / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;t \leq 6.6 \cdot 10^{+179}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t}{\ell \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{\ell}{\sqrt{2}}}{t}\right)\\
\end{array}
\end{array}
if t < 6.59999999999999955e179Initial program 83.4%
unpow283.4%
clear-num83.5%
frac-times82.9%
*-un-lft-identity82.9%
Applied egg-rr82.9%
Taylor expanded in Om around 0 82.4%
if 6.59999999999999955e179 < t Initial program 61.4%
sqrt-div61.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%
associate-*l/97.0%
clear-num97.0%
Applied egg-rr97.0%
associate-/r/97.0%
Simplified97.0%
Taylor expanded in l around 0 64.3%
*-commutative64.3%
associate-/r*64.4%
Simplified64.4%
Final simplification80.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.45e+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 <= 1.45e+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 <= 1.45d+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 <= 1.45e+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 <= 1.45e+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 <= 1.45e+20) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / 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 <= 1.45e+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, 1.45e+20], 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[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.45 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 1.45e20Initial program 86.0%
Taylor expanded in t around 0 54.3%
unpow254.3%
unpow254.3%
times-frac60.0%
unpow260.0%
Simplified60.0%
unpow283.6%
clear-num83.6%
un-div-inv83.6%
Applied egg-rr60.0%
if 1.45e20 < t Initial program 63.3%
add-cube-cbrt63.1%
pow363.1%
Applied egg-rr63.1%
Taylor expanded in Om around 0 62.0%
Taylor expanded in t around inf 55.2%
associate-*l/55.2%
rem-cube-cbrt55.8%
metadata-eval55.8%
associate-/l*55.8%
Simplified55.8%
Taylor expanded in l around 0 55.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 3.6e+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 <= 3.6e+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 <= 3.6d+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 <= 3.6e+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 <= 3.6e+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 <= 3.6e+20) tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / 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 <= 3.6e+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, 3.6e+20], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $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 3.6 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(1 + \frac{\frac{Om}{Omc}}{\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 < 3.6e20Initial 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%
unpow283.6%
clear-num83.6%
un-div-inv83.6%
Applied egg-rr59.7%
if 3.6e20 < t Initial program 63.3%
add-cube-cbrt63.1%
pow363.1%
Applied egg-rr63.1%
Taylor expanded in Om around 0 62.0%
Taylor expanded in t around inf 55.2%
associate-*l/55.2%
rem-cube-cbrt55.8%
metadata-eval55.8%
associate-/l*55.8%
Simplified55.8%
Taylor expanded in l around 0 55.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.12e+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.12e+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.12d+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.12e+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.12e+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.12e+20) tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / 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 <= 1.12e+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.12e+20], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $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 1.12 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(1 + \frac{\frac{Om}{Omc}}{\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 < 1.12e20Initial 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%
unpow283.6%
clear-num83.6%
un-div-inv83.6%
Applied egg-rr59.7%
if 1.12e20 < t Initial program 63.3%
add-cube-cbrt63.1%
pow363.1%
Applied egg-rr63.1%
Taylor expanded in Om around 0 62.0%
Taylor expanded in t around inf 55.2%
associate-*l/55.2%
rem-cube-cbrt55.8%
metadata-eval55.8%
associate-/l*55.8%
Simplified55.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(Float64(Om / 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[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(1 + \frac{\frac{Om}{Omc}}{\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%
unpow276.8%
clear-num76.8%
un-div-inv76.8%
Applied egg-rr49.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%
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)))))))