I have two expressions with the Gamma function that are identical:
FullSimplify[Gamma[2*k/(2*k - 1)]/Gamma[1 + 1/(2*k)] ==
2*k/(2*k - 1)*Gamma[1/(2*k - 1)]/Gamma[1/(2*k)]]
(* True *)
But when using NProduct
I get completely different results:
NProduct[Gamma[2*k/(2*k - 1)]/Gamma[1 + 1/(2*k)], {k, 1, Infinity}]
(* 1.06215 *)
NProduct[2*k/(2*k - 1)*Gamma[1/(2*k - 1)]/Gamma[1/(2*k)], {k, 1, Infinity}]
(* ComplexInfinity *)
The product is convergent, so this result is wrong. I don't know if this qualifies as a BUG, but it would be better to give some sort of error message than ComplexInfinity
for a convergent product. This is very confusing.
If I add WorkingPrecision
, the program does give error messages, but not infinity
NProduct[Gamma[2*k/(2*k - 1)]/Gamma[1 + 1/(2*k)], {k, 1, Infinity}, WorkingPrecision -> 20]
(* NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections... *)
(* 1.0621509056004 *)
I can also add that Maple calculates this product to 100 decimal places without any problems.
evalf(Product(2*k*GAMMA(1/(2*k - 1))/((2*k - 1)*GAMMA(1/(2*k))), k = 1..infinity), 120);
1.06215090557105728069683736293809990425207955200456933340798700905379893707714082919361825368669317760219700551663195491
{Limit[Gamma[2*k/(2*k - 1)], k -> Infinity], Limit[Gamma[1 + 1/(2*k)], k -> Infinity]}
vs.{Limit[Gamma[1/(2*k - 1)], k -> Infinity], Limit[Gamma[1/(2*k)], k -> Infinity]}
-- The singular forms are probably (mis)handled in a different way, exposing a bug. $\endgroup$