#17066: always simplify hypergeometric() when it's a polynomial
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  symbolics          |   Resolution:
       Keywords:  special,           |    Merged in:
  functions, pFq, evaluation         |    Reviewers:
        Authors:  Ralf Stephan       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  0e0fef65a021a9b0a9db30a2bc6d300ede68bf14
  u/rws/work_around_mpmath_problem_with_hypergeometric___zeroes|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by kcrisman):

 > Expanding hypergeometric functions in polynomial closed form before
 evaluating them can lead to numerical cancellation. Compare for example
 > {{{
 > sage: hypergeometric([1,-100],[3], 0.7)
 > 0.0278923450568346
 > sage: hypergeometric([1,-100],[3], Reals(1000)(0.7)).n()
 > 0.0278923450568346
 > sage:
 
sage.functions.hypergeometric.closed_form(hypergeometric([1,-100],[3],x)).subs(x=0.7)
 > -376.859920391941
 > }}}
 > Won't that be a problem with this ticket? (I didn't read beyond the
 ticket's description, so please ignore my comment if it is beside the
 point.)

 Just so I follow, what you are saying is that the polynomial (rational
 function, I guess) given will be ''correct'', but that substituting
 floating point numbers are likely to be inaccurate unless carried out to a
 very high degree of precision?  I'm torn here because on the one hand,
 presumably that could happen with ''any'' rational function, there are
 standard examples given in a lot of calculus books, but on the other hand
 we "expect" hg to return a hg function and not a polynomial.

 > The real fix for this cannot be provided by hypergeometric though but
 must be done in subs, if at all.

 Well, it could provide a good reason ''not'' to "always simplify
 hypergeometric when it's a polynomial"...  I didn't realize that people
 meant rational function when they said polynomial.  Is it possible to
 really only simplify when it's a true polynomial, or is that a very
 unlikely event?

--
Ticket URL: <http://trac.sagemath.org/ticket/17066#comment:23>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to