Ticket #4229 (closed enhancement: duplicate)
special functions should use mpfr when available
| Reported by: | AlexGhitza | Owned by: | burcin |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | calculus | Keywords: | sd31 |
| Cc: | jdemeyer | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Burcin Erocal, Karl-Dieter Crisman |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
MPFR has fast implementations for restricted types of arguments in some special functions, e.g. Bessel J and Y with integer order and positive real argument. We should be using these instead of Pari or Maxima or Scipy whenever that is feasible.
Example:
sage: a = RR(2)
sage: timeit("bessel_J(1, a)")
625 loops, best of 3: 370 µs per loop
sage: timeit("a.j1()")
625 loops, best of 3: 13.9 µs per loop
That's 26 times faster than Pari.
Change History
comment:1 Changed 2 years ago by kcrisman
- Priority changed from major to minor
- Report Upstream set to N/A
comment:2 Changed 2 years ago by burcin
- Keywords sd31 added
- Status changed from new to needs_review
- Authors set to Burcin Erocal
This ticket is too broad, I suggest we close it as invalid.
At the time it was created, there was no general framework to handle these functions. The (not so) new pynac-based symbolics provide this framework. It is true that a lot of work is still needed to sort these numerical evaluation issues out, but we need a separate specific ticket for each issue.
See symbolics/functions for an overview on the progress of symbolic functions.
comment:3 Changed 2 years ago by kcrisman
- Cc jdemeyer added
- Reviewers set to Karl-Dieter Crisman
- Status changed from needs_review to positive_review
Agreed. This wiki page solves the problem.

Or maybe we should use mpmath - there are a number of tickets about that. Such as Alex's own comment in #3426 :)