gamma_convention_check.py

back to table · edit · history · where entries came from · files · download

671 bytes, as of the version from 2026-11-09 14:49 (current). Recorded here, not run.

"""Check the constant between arithmetic and analytic gamma conventions."""
import numberdb.sage as numberdb
from sage.rings.real_mpfr import RealField
from generate import WEIGHTS,critical_integers
R=RealField(700);worst=R(0);count=0
for k in WEIGHTS:
 for s in critical_integers(k):
  z=R(s);t=z-k+1
  arithmetic=2*(2*R.pi())**(-z)*z.gamma()*R.pi()**(-(z-k+2)/2)*((z-k+2)/2).gamma()
  analytic=R.pi()**(-3*t/2)*((t+1)/2).gamma()*((t+k-1)/2).gamma()*((t+k)/2).gamma()
  error=abs(arithmetic/(R.pi()**(-k)*analytic)-1)
  assert error<R(10)**-200
  worst=max(worst,error);count+=1
print('Gamma convention:',count,'weight-argument pairs checked; max relative error',worst)