Ticket #4229 (closed enhancement: duplicate)

Opened 5 years ago

Last modified 2 years ago

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

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

comment:4 Changed 2 years ago by jdemeyer

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

comment:5 Changed 2 years ago by jdemeyer

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