Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed up gamma_inc #5650

Closed
ncalexan mannequin opened this issue Mar 31, 2009 · 4 comments
Closed

speed up gamma_inc #5650

ncalexan mannequin opened this issue Mar 31, 2009 · 4 comments

Comments

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Mar 31, 2009

The following is from code for evaluating Riemann theta functions on sage.math:

sage: %prun siegel_theta(tau3p, 1/10*vector([1/2 + I, 2/3*I, 1.222*I]))
         137700 function calls (136832 primitive calls) in 2.221 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       23    1.668    0.073    1.674    0.073 {method 'gamma_inc' of 'sage.rings.complex_number.ComplexNumber' objects}
    791/1    0.153    0.000    0.380    0.380 riemann_theta.py:313(find_integer_points)
     1601    0.066    0.000    0.066    0.000 {method 'sin' of 'sage.rings.real_mpfr.RealNumber' objects}
     5706    0.056    0.000    0.077    0.000 free_module.py:742(__call__)
        1    0.029    0.029    0.137    0.137 riemann_theta.py:51(finite_sum_without_derivatives)
     1602    0.026    0.000    0.026    0.000 {method 'exp' of 'sage.rings.real_mpfr.RealNumber' objects}

The finite_sum_without_derivatives is the main loop, which calls sin, cos, and exp each iteration. But the dominant part is computing an initial error approximation, which computes gamma_inc to very high precision a bunch of times, optimizing a parameter. That takes longer than everything else! Could a party interested in special functions please speed this up?

Component: symbolics

Keywords: gamma_inc log performance speed

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/5650

@ncalexan ncalexan mannequin added c: symbolics labels Mar 31, 2009
@fredrik-johansson
Copy link
Contributor

comment:1

How high precision and for what values of the arguments is this?

@kcrisman
Copy link
Member

kcrisman commented Jun 1, 2012

comment:2

How high precision and for what values of the arguments is this?

Yeah, this is really vague, and the code involved is custom and not in Sage at this time. It would be helpful to know if #7748, which changed the approximation to mpmath, helped here. Until such time as we get more details, 'needs info'.

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@jdemeyer
Copy link

comment:3

No answer, close as "invalid".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants