Ticket #8864 (closed enhancement: fixed)
make zeta function symbolic
| Reported by: | zimmerma | Owned by: | AlexGhitza |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.4.4 |
| Component: | symbolics | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Paul Zimmermann |
| Authors: | Burcin Erocal | Merged in: | sage-4.4.4.alpha0 |
| Dependencies: | Stopgaps: |
Description
Consider:
sage: zeta(3) 1.20205690315959
We expect zeta(3) as answer.
Attachments
Change History
comment:2 Changed 3 years ago by burcin
- Status changed from new to needs_review
- Component changed from basic arithmetic to symbolics
- Authors set to Burcin Erocal
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 3 years ago by zimmerma
- Status changed from needs_review to needs_work
- Reviewers set to Paul Zimmermann
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 3 years ago by burcin
-
attachment
trac_8864-symbolic_zeta.take2.patch
added
apply only this patch
comment:4 Changed 3 years ago by burcin
- Status changed from needs_work to 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

Note: this is a followup of #7748.