Opened 13 years ago

Closed 10 years ago

#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 Merged in:
Authors: Reviewers: Burcin Erocal, Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


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.


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 (5)

comment:1 Changed 10 years ago by kcrisman

  • Priority changed from major to minor
  • Report Upstream set to N/A

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

comment:2 Changed 10 years ago by burcin

  • Authors set to Burcin Erocal
  • Keywords sd31 added
  • Status changed from new to needs_review

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 10 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.

comment:4 Changed 10 years ago by jdemeyer

  • Milestone changed from sage-4.7.1 to sage-duplicate/invalid/wontfix

comment:5 Changed 10 years ago by jdemeyer

  • Authors Burcin Erocal deleted
  • Resolution set to duplicate
  • Reviewers changed from Karl-Dieter Crisman to Burcin Erocal, Karl-Dieter Crisman
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.