Opened 12 years ago

Closed 12 years ago

#9881 closed defect (fixed)

fix the symbolic csgn function on complex input

Reported by: Burcin Erocal Owned by: Burcin Erocal
Priority: major Milestone: sage-4.6
Component: symbolics Keywords: pynac
Cc: Merged in: sage-4.6.alpha3
Authors: Burcin Erocal Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Our wrapper of the csgn function from GiNaC (in sage/symbolic/expression.pyx) doesn't reflect it's real definition:

  /** Return the complex half-plane (left or right) in which the number lies.
   *  csgn(x)==0 for x==0, csgn(x)==1 for Re(x)>0 or Re(x)=0 and Im(x)>0,
   *  csgn(x)==-1 for Re(x)<0 or Re(x)=0 and Im(x)<0.
   *  */

Fix this and add doctests.

We should also consider using GiNaC's csgn() function for the top level sgn() and sign() functions. This should be on a different ticket though.

Attachments (2)

trac_9881-csgn.patch (1.3 KB) - added by Burcin Erocal 12 years ago.
trac_9881-csgn-reviewer.patch (1.6 KB) - added by Karl-Dieter Crisman 12 years ago.
Apply after initial patch.

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by Burcin Erocal

Attachment: trac_9881-csgn.patch added

comment:1 Changed 12 years ago by Burcin Erocal

Authors: Burcin Erocal
Status: newneeds_review

The new pynac package at #9201 changes the csgn() function according to the description. attachment:trac_9881-csgn.patch adds doctests for the new specification.

The pynac package includes patches for #9394, #9834, #9878, #9879, #9900 as well as this ticket. See the ticket description of #9901 for the list (and order) of patches associated to the new version.

comment:2 in reply to:  1 Changed 12 years ago by Burcin Erocal

Replying to burcin:

The new pynac package at #9201 changes the csgn() function according to the description.

That should have been "at #9901".

comment:3 Changed 12 years ago by Karl-Dieter Crisman

Reviewers: Karl-Dieter Crisman

Just FYI - this appears to still apply cleanly after the review patch at #9879.

comment:4 Changed 12 years ago by Karl-Dieter Crisman

Status: needs_reviewpositive_review

Okay, this looks good on both Pynac and Sage side - with the exception that I think the documentation needed slightly more clarity, and that some of the examples got misplaced to binomial for some reason. Positive review; apply reviewer patch after initial patch.

Changed 12 years ago by Karl-Dieter Crisman

Apply after initial patch.

comment:5 Changed 12 years ago by Mitesh Patel

Merged in: sage-4.6.alpha3
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.