octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56511] tanh returns NaN for certain complex v


From: anonymous
Subject: [Octave-bug-tracker] [bug #56511] tanh returns NaN for certain complex values in Windows under version 5.1.0 and 4.2.2 but not in Linux under 4.2.2.
Date: Mon, 17 Jun 2019 18:37:25 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?56511>

                 Summary: tanh returns NaN for certain complex values in
Windows under version 5.1.0 and 4.2.2 but not in Linux under 4.2.2.
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 17 Jun 2019 10:37:23 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Brian Borchers
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 5.1.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Under Octave 5.1.0 in Windows 10, I get:


>> tanh(4000+1.0e-6*i)
ans =     NaN


I also got the same result under 4.2.2 in Windows 10.

Under 4.2.2 in Linux, I get the correct answer:


>> tanh(4000+1.0e-6*i)
ans =     1.0000e+00


Many other complex values with large (in absolute value) real parts give
similar results.  e.g. try -4000+1.0e-6*i.  

I realize that this may well be due to a bug in an upstream math library
rather than Octave itself. It may be relatively simple to work around this bug
by providing appropriate limiting values in these extreme cases.   




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56511>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]