Opened 9 years ago

Closed 9 years ago

#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: 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)

trac_8864-symbolic_zeta.patch (5.5 KB) - added by burcin 9 years ago.
trac_8864-symbolic_zeta.take2.patch (6.0 KB) - added by burcin 9 years ago.
apply only this patch

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by zimmerma

Note: this is a followup of #7748.

Changed 9 years ago by burcin

comment:2 Changed 9 years ago by burcin

  • Authors set to Burcin Erocal
  • Component changed from basic arithmetic to symbolics
  • Status changed from new to 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 9 years ago by zimmerma

  • Reviewers set to Paul Zimmermann
  • Status changed from needs_review to 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 9 years ago by burcin

apply only this patch

comment:4 Changed 9 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

comment:5 Changed 9 years ago by zimmerma

  • Status changed from needs_review to positive_review

All tests pass now. Thus a positive review. Good work!

Paul

comment:6 Changed 9 years ago by mhansen

  • Merged in set to sage-4.4.4.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.