On Fri, Feb 13, 2009 at 8:35 PM, Luiz Felipe Martins
<[email protected]> wrote:
>
> Does Sage have an implementation of Euler's summation formula (aka he
> Euler-Maclaurin formula)?
It is implemented in SymPy:
>>> from sympy import *
>>> k = Symbol('k')
>>> s, err = Sum(1/k, (k, 1, 10**6)).euler_maclaurin(10,10)
>>> s
27740875996259884132359589719030777127896272493791263213146392024322326464132820
5293862621331751139989355990694874365728393584957876503951098512031/932431492976
52817275258600000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000 - log(11) + log(1000000)
>>> s.evalf()
14.3927267228657
>>> harmonic(1e6).evalf()
14.3927267228657
>>> err.evalf()
3.45762455258101e-21
Fredrik
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---