#9706: New Version of orthogonal Polynomials
-------------------------------+--------------------------------------------
   Reporter:  maldun           |       Owner:  burcin                           
       Type:  defect           |      Status:  new                              
   Priority:  minor            |   Milestone:                                   
  Component:  symbolics        |    Keywords:  orthogonal polynomials, symbolics
     Author:  Stefan Reiterer  |    Upstream:  N/A                              
   Reviewer:                   |      Merged:                                   
Work_issues:                   |  
-------------------------------+--------------------------------------------

Comment(by maldun):

 Replying to [comment:5 fredrik.johansson]:
 > > The complete versions for legendre_Q, gen_legendre_P, and
 gen_legendre_Q will not be finished soon since the mpmath functions, don't
 seem to work correctly...
 >
 > Care to elaborate?

 Sorry for the late answer, I was on holidays.

 In mpmath I have probs with the legenp and legenq functions. For some
 inputs I get this error:

 sage: mpmath.call(mpmath.legenp,5,1,2)
 ---------------------------------------------------------------------------
 OverflowError                             Traceback (most recent call
 last)

 /home/maldun/prog/sage/ortho/<ipython console> in <module>()

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/sage/libs/mpmath/utils.so in sage.libs.mpmath.utils.call
 (sage/libs/mpmath/utils.c:5021)()

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/functions/hypergeometric.pyc in legenp(ctx, n, m, z, type,
 **kwargs)
    1481             T = [1+z, 1-z], [g, -g], [], [1-m], [-n, n+1], [1-m],
 0.5*(1-z)
    1482             return (T,)
 -> 1483         return ctx.hypercomb(h, [n,m], **kwargs)
    1484     if type == 3:
    1485         def h(n,m):

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/functions/hypergeometric.pyc in hypercomb(ctx, function,
 params, discard_known_zeros, **kwargs)
     125                     [ctx.gamma(a) for a in alpha_s] + \
     126                     [ctx.rgamma(b) for b in beta_s] + \
 --> 127                     [ctx.power(w,c) for (w,c) in zip(w_s,c_s)])
     128                 if verbose:
     129                     print "    Value:", v

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/ctx_base.pyc in power(ctx, x, y)
     417             3.16470269330255923143453723949e+12978188
     418         """
 --> 419         return ctx.convert(x) ** ctx.convert(y)
     420
     421     def _zeta_int(ctx, n):

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/sage/libs/mpmath/ext_main.so in
 sage.libs.mpmath.ext_main.mpnumber.__pow__
 (sage/libs/mpmath/ext_main.c:13946)()

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/sage/libs/mpmath/ext_main.so in sage.libs.mpmath.ext_main.binop
 (sage/libs/mpmath/ext_main.c:4588)()

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/libmp/libelefun.pyc in mpf_pow(s, t, prec, rnd)
     340     # General formula: s**t = exp(t*log(s))
     341     # TODO: handle rnd direction of the logarithm carefully
 --> 342     c = mpf_log(s, prec+10, rnd)
     343     return mpf_exp(mpf_mul(t, c), prec, rnd)
     344

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/libmp/libelefun.pyc in mpf_log(x, prec, rnd)
     725     # optimal between 1000 and 100,000 digits.
     726     if wp <= LOG_TAYLOR_PREC:
 --> 727         m = log_taylor_cached(lshift(man, wp-bc), wp)
     728         if mag:
     729             m += mag*ln2_fixed(wp)

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/libmp/libelefun.pyc in log_taylor_cached(x, prec)
     643     else:
     644         a = n << (cached_prec - LOG_TAYLOR_SHIFT)
 --> 645         log_a = log_taylor(a, cached_prec, 8)
     646         log_taylor_cache[n, cached_prec] = (a, log_a)
     647     a >>= dprec

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/libmp/libelefun.pyc in log_taylor(x, prec, r)
     607     """
     608     for i in xrange(r):
 --> 609         x = isqrt_fast(x<<prec)
     610     one = MPZ_ONE << prec
     611     v = ((x-one)<<prec)//(x+one)

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/libmp/libintmath.pyc in isqrt_fast_python(x)
     240                     y = (y + x//y) >> 1
     241         return y
 --> 242     bc = bitcount(x)
     243     guard_bits = 10
     244     x <<= 2*guard_bits

 /home/maldun/sage/sage-4.5.1/local/lib/python2.6/site-
 packages/mpmath/libmp/libintmath.pyc in python_bitcount(n)
      78     if bc != 300:
      79         return bc
 ---> 80     bc = int(math.log(n, 2)) - 4
      81     return bc + bctable[n>>bc]
      82

 OverflowError: cannot convert float infinity to integer

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9706#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to