Paul van Wamelen on Thu, 24 Feb 2000 17:15:54 -0600 (CST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

hyperu bug


Dear Pari developers,

Here is a patch for the hyperu bad input bug. The present implementation can
only deal with positive (real) third argument. (The function hyperu computes 
is actually defined for all complex z) 

Sincerely,
Paul van Wamelen.



cvs server: Diffing .
Index: TODO
===================================================================
RCS file: /home/megrez/cvsroot/pari/TODO,v
retrieving revision 1.17
diff -c -r1.17 TODO
*** TODO	2000/02/21 18:22:34	1.17
--- TODO	2000/02/24 23:08:19
***************
*** 18,30 ****
  Unless specified otherwise, examples assume default precisions (on a 32
  bit machine)
  
- 5  "bad input" problems with hyperu:
-    ? hyperu(0,0,-1) \\ infinite loop
-    ? hyperu(1,2,0)
-    %1 = 51580834970224178120796801.23
-    ? hyperu(1,2,.0)
-    %2 = 2396734.892578125000000000000
- 
  5  setrand(5);thueinit(polsubcyclo(precprime(2^17),3))
    ***   non positive argument in mplog. \\ precision problem
  
--- 18,23 ----
cvs server: Diffing Odos
cvs server: Diffing config
cvs server: Diffing doc
Index: doc/usersch3.tex
===================================================================
RCS file: /home/megrez/cvsroot/pari/doc/usersch3.tex,v
retrieving revision 1.45
diff -c -r1.45 usersch3.tex
*** doc/usersch3.tex	2000/02/16 19:50:05	1.45
--- doc/usersch3.tex	2000/02/24 23:08:26
***************
*** 1023,1029 ****
  \syn{ggamma}{x,\var{prec}}.
  
  \subsecidx{hyperu}$(a,b,x)$: $U$-confluent hypergeometric function with
! parameters $a$ and $b$.
  
  \syn{hyperu}{a,b,x,\var{prec}}.
  
--- 1023,1030 ----
  \syn{ggamma}{x,\var{prec}}.
  
  \subsecidx{hyperu}$(a,b,x)$: $U$-confluent hypergeometric function with
! parameters $a$ and $b$. The parameters $a$ and $b$ can be complex but 
! the present implementation requires $x$ to be positive.
  
  \syn{hyperu}{a,b,x,\var{prec}}.
  
***************
*** 5587,5593 ****
  matrix whose diagonal entries are the coefficients of the squares, and the
  non-diagonal entries represent the bilinear forms. More precisely, if
  $(a_{ij})$ denotes the output, one has
! $$ q(x) = \sum_i a_{ii} (x_i + \sum_j>i a_{ij} x_j)^2 $$
  
  \syn{sqred}{x}.
  
--- 5588,5594 ----
  matrix whose diagonal entries are the coefficients of the squares, and the
  non-diagonal entries represent the bilinear forms. More precisely, if
  $(a_{ij})$ denotes the output, one has
! $$ q(x) = \sum_i a_{ii} (x_i + \sum_{j>i} a_{ij} x_j)^2 $$
  
  \syn{sqred}{x}.
  
cvs server: Diffing emacs
cvs server: Diffing examples
cvs server: Diffing misc
cvs server: Diffing src
cvs server: Diffing src/basemath
Index: src/basemath/trans3.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/basemath/trans3.c,v
retrieving revision 1.9
diff -c -r1.9 trans3.c
*** src/basemath/trans3.c	2000/02/17 18:44:47	1.9
--- src/basemath/trans3.c	2000/02/24 23:08:27
***************
*** 115,126 ****
  /**                                                                   **/
  /***********************************************************************/
  
! /* Assume gx > 0 and a,b real */
  GEN
  hyperu(GEN a, GEN b, GEN gx, long prec)
  {
    GEN x,y,p1,p2,p3,zf,zz,s,t,q,r,u,v,e,f,c,d,w,a1,gn;
    long l,lbin,av,av1,av2,k,l1,n,ex;
  
    if (typ(gx)!=t_REAL)
      { l=prec; k=1; }
--- 115,132 ----
  /**                                                                   **/
  /***********************************************************************/
  
! /* Assume gx > 0 and a,b complex */
! /* This might one day be extended to handle complex gx */
! /* see Temme, N. M. "The numerical computation of the confluent        */
! /* hypergeometric function U(a,b,z)" in Numer. Math. 41 (1983),        */
! /* no. 1, 63--82.                                                      */
  GEN
  hyperu(GEN a, GEN b, GEN gx, long prec)
  {
    GEN x,y,p1,p2,p3,zf,zz,s,t,q,r,u,v,e,f,c,d,w,a1,gn;
    long l,lbin,av,av1,av2,k,l1,n,ex;
+ 
+   if(gsigne(gx) <= 0) err(talker,"hyperu's third argument must be positive");
  
    if (typ(gx)!=t_REAL)
      { l=prec; k=1; }
cvs server: Diffing src/gp
cvs server: Diffing src/graph
cvs server: Diffing src/headers
cvs server: Diffing src/kernel
cvs server: Diffing src/kernel/alpha
cvs server: Diffing src/kernel/hppa
cvs server: Diffing src/kernel/ix86
cvs server: Diffing src/kernel/m68k
cvs server: Diffing src/kernel/none
cvs server: Diffing src/kernel/ppc
cvs server: Diffing src/kernel/sparcv7
cvs server: Diffing src/kernel/sparcv8
cvs server: Diffing src/kernel/sparcv9
cvs server: Diffing src/language
cvs server: Diffing src/modules
cvs server: Diffing src/test
cvs server: Diffing src/test/32
cvs server: Diffing src/test/64
cvs server: Diffing src/test/in