Opened 13 years ago
Closed 13 years ago
#8864 closed enhancement (fixed)
make zeta function symbolic
Reported by: | Paul Zimmermann | Owned by: | Alex Ghitza |
---|---|---|---|
Priority: | major | Milestone: | sage-4.4.4 |
Component: | symbolics | Keywords: | |
Cc: | Merged in: | sage-4.4.4.alpha0 | |
Authors: | Burcin Erocal | Reviewers: | Paul Zimmermann |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Consider:
sage: zeta(3) 1.20205690315959
We expect zeta(3)
as answer.
Attachments (2)
Change History (8)
comment:1 Changed 13 years ago by
Changed 13 years ago by
Attachment: | trac_8864-symbolic_zeta.patch added |
---|
comment:2 Changed 13 years ago by
Authors: | → Burcin Erocal |
---|---|
Component: | basic arithmetic → symbolics |
Status: | new → needs_review |
With attachment:trac_8864-symbolic_zeta.patch you can do this:
sage: zeta(3) zeta(3) sage: zeta(2) 1/6*pi^2
Probably, the changes to sage/symbolic/random_tests.py
depend on #6949.
comment:3 Changed 13 years ago by
Reviewers: | → Paul Zimmermann |
---|---|
Status: | needs_review → needs_work |
I applied that patch to 4.4.1. The new behaviour is ok, I get only one doctest failure in
lfunctions/dokchitser.py
. With 4.4.1 we got:
sage: h = RR('0.0000000000001') sage: (zeta(2+h) - zeta(2))/h -0.937028232783632
With the patch, we get:
sage: h = RR('0.0000000000001') sage: (zeta(2+h) - zeta(2))/h -1.66666666666667e12*pi^2 + 1.64493406684813e13
I guess the doctest result has to be changed, or zeta(2) changed to zeta(2.), since Sage does not
automatically propagate floats, for example pi+1.0
remains unchanged.
Changed 13 years ago by
Attachment: | trac_8864-symbolic_zeta.take2.patch added |
---|
apply only this patch
comment:4 Changed 13 years ago by
Status: | needs_work → needs_review |
---|
I uploaded attachment:trac_8864-symbolic_zeta.take2.patch which also includes a fix for the lfunctions/dokchitser.py
doctest. I simply replaced zeta(2)
with zeta(2)
to get a numeric evaluation.
I agree that pi+1.0
looks strange, but that is not so trivial to fix. :) FWIW, maple also seems to leave that unevaluated:
|\^/| Maple 12 (IBM INTEL LINUX) ._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2008 \ MAPLE / All rights reserved. Maple is a trademark of <____ ____> Waterloo Maple Inc. | Type ? for help. > Pi +1.0; Pi + 1.0 > 1.0*Pi; 1.0 Pi
comment:5 Changed 13 years ago by
Status: | needs_review → positive_review |
---|
All tests pass now. Thus a positive review. Good work!
Paul
comment:6 Changed 13 years ago by
Merged in: | → sage-4.4.4.alpha0 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Note: this is a followup of #7748.