fredstro/psage — pull request #1 by sehlen (2012-11-05 22:57:08+00:00)
Title: Incgamma new

# Implementation of Ei(x)
I imlemented a version of Ei(x) that gives correct results in the required precision.

I copied the idea from the mpmath source code. The basic idea is to increase the precision to avoid
cancellations when using the power series and to use the asymptotic formula, when possible. Increasing the precision slows the calculation down as the size of the input grows until we reach the point where we can use the asymptotic formula and things become quite fast again.

# Todos

## TODO 1: implement the function cdef ei_c that can be called directly from c
to speed things up when inside C code. Could you do that, please?
(You would have to implement the two cases properly in C).

## TODO 2: Could you please set up a function that uses the new
implementation for computing the harmonic weak maass forms?
I can't see at which one I really have to look.
(We should take the opportunity and clean up some code in a branch ;-)

## TODO 3: Proof the correctness (I don't know where the number 0.6... comes from and how to proof that the increase in precision gives correct results but it shouldn't be too hard.

## TODO 4: Implement tests. I did quite a few "by hand" and it seems to be very good!