Opened 14 years ago

Closed 8 years ago

## #5650 closed enhancement (invalid)

# speed up gamma_inc

Reported by: | ncalexan | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |

Component: | symbolics | Keywords: | gamma_inc log performance speed |

Cc: | Merged in: | ||

Authors: | Reviewers: | Jeroen Demeyer | |

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

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?

### Change History (4)

### comment:1 follow-up: 2 Changed 14 years ago by

### comment:2 Changed 11 years ago by

Report Upstream: | → N/A |
---|---|

Status: | new → needs_info |

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

### comment:3 Changed 8 years ago by

Milestone: | sage-feature → sage-duplicate/invalid/wontfix |
---|---|

Reviewers: | → Jeroen Demeyer |

Status: | needs_info → positive_review |

No answer, close as "invalid".

### comment:4 Changed 8 years ago by

Resolution: | → invalid |
---|---|

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

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