hypergeom_checks.py

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

1282 bytes, as of the version from 2026-11-02 11:01 (current). Recorded here, not run.

"""Independent corrected hypergeometric identity checks for T650.

Run with Python 3 and mpmath: python3 hypergeom_checks.py
At positive k, differentiate Samart's convergent 3F2 formula term by term.
Integrate the resulting pair of 2F1 functions from 0 to k. This is an analytic
period computation, with no quadratic-root geometry or I,J quadratures.
"""
import mpmath as mp,json,time
from integral_checks import KEYS,argument

def modified_hyper(key,working):
 with mp.workdps(working):
  t=argument(key);k=mp.root(t,3);q=mp.mpf(1)/3
  if t<22:
   return -(mp.gamma(q)**3*k*mp.hyper([q,q,q],[2*q,4*q],t/27)+mp.gamma(2*q)**3*k*k*mp.hyper([2*q,2*q,2*q],[4*q,5*q],t/27)/2)/(4*mp.pi**2)
  A=mp.gamma(q)**3;B=mp.gamma(2*q)**3
  def f(u):
   z=u**3/27
   return -(A*mp.hyp2f1(q,q,2*q,z)+B*u*mp.hyp2f1(2*q,2*q,4*q,z))/(4*mp.pi**2)
  points=[mp.mpf(0)]
  # Geometric subdivisions approach the nearest singularity at u=3.
  n=1
  while 3-mp.power(2,-n)<k:
   points.append(3-mp.power(2,-n));n+=1
  points.append(k)
  return mp.quad(f,points,method='gauss-legendre',maxdegree=8)
if __name__=='__main__':
 for key in KEYS:
  start=time.time();v=modified_hyper(key,125)
  print(json.dumps({'t':key,'hypergeometric':mp.nstr(v,120),'working_digits':125,'seconds':time.time()-start}),flush=True)