patchGNU Octave - Patches: patch #9549, Improve expint handled of signed...

 
 

patch #9549: Improve expint handled of signed zero

Submitter:  Colin Macdonald <cbm>
Submitted:  Mon 22 Jan 2018 07:51:44 PM UTC
   
 
Category:  Core : other Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 12 Dec 2018 02:54:07 PM UTC, comment #6: 

@Marco: Yes, I understand that reasoning as well.  Pure mathematics doesn't have a signed zero, it is an artifact of the implementation on computers.  Given that we are trying to match pure math, it seems like we should have expint (-0) == expint (0) == Inf as Matlab does.  In that case, we can close this report.


Rik <rik5>
Group administrator
Wed 12 Dec 2018 08:39:56 AM UTC, comment #5: 

@Rik: I like your proposal, but 0==-0 in octave, too. Therefore, expint(0) should equals expint(-0).

Marco Caliari <caliari>
Group Member
Tue 11 Dec 2018 04:47:13 PM UTC, comment #4: 

So currently Matlab and Octave are compatible.  Is it more useful to be mathematically correct, or compatible?  Here is a bit of testing I did in Octave


octave:1> expint (-0)
ans =  Inf
octave:2> expint (-1e-6)
ans =  13.2383 -  3.1416i
octave:3> expint (-1e-8)
ans =  17.8435 -  3.1416i
octave:4> expint (-1e-9)
ans =  20.1461 -  3.1416i
octave:5> expint (-1e-10)
ans =  22.4486 -  3.1416i
octave:6> expint (1e-10)
ans =  22.449
octave:7> expint (1e-11)
ans =  24.751
octave:8> expint (-1e-11)
ans =  24.7512 -  3.1416i


If the expint function is continuous then as you approach 0 from the negative direction it does seem like the value should converge to complex (Inf, -pi) as the first changeset does.  But, you know there are a bunch of Matlab folks who will whine if the result is not exactly the same.

Rik <rik5>
Group administrator
Tue 11 Dec 2018 06:43:28 AM UTC, comment #3: 

On Matlab 2018a

>> expint (-0)


ans =

   Inf

Michele Ginesi <m_ginesi>
Tue 11 Dec 2018 05:49:52 AM UTC, comment #2: 

For reference, what does Matlab return for


expint (-0)


Does it respect the branch cut and return


Inf - pi*i



Rik <rik5>
Group administrator
Wed 24 Jan 2018 08:39:26 AM UTC, comment #1: 

I learned more at #52953.  Second patch (on top of 1st) adds a workaround for #52953 and better treatment/tests near the branch cut.

(file #43063)

Colin Macdonald <cbm>
Mon 22 Jan 2018 07:51:44 PM UTC, original submission:  

I've been (slowly) starting to review the GSoC 2017 work on special functions.

Here's an issue I encountered in "expint" while doing that.

Colin Macdonald <cbm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by m_ginesi (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cbm
  • -email is unavailable- added by cbm (Submitted the item)
  • -email is unavailable- added by cbm
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-14 rik5 StatusNone Wont Do
        Open/ClosedOpen Closed
    2018-01-24 cbm Attached File- Added improve_expint_handled_of_signed_complex_zero.patch, #43063
        Carbon-Copy- Added caliari
    2018-01-22 cbm Attached File- Added improve_expint_handled_of_signed_zero.patch, #43027
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code