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

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

[Octave-bug-tracker] [bug #62321] Wrong result for Airy funtion


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #62321] Wrong result for Airy funtion
Date: Sun, 17 Apr 2022 10:49:08 -0400 (EDT)

Update of bug #62321 (project octave):

                  Status:               Need Info => In Progress            

    _______________________________________________________

Follow-up Comment #9:

I found out why expz returns the wrong complex conjugate. The original input V
lists the real numbers in the first row as "-0.4649 - 0i" using the negative
sign for the imaginary part. Even though the imaginary part for that element
is zero and therefore should not make a difference, in this case it does, and
exp returns the negative complex conjugate.

If I add the line

V = (V + i) - i;

to the original input then "x - 0i" is set to "x + 0i", and both P and Q
agree, as they ought to. To the OP (Zoïs), this workaround would at least
give you accurate results for now.

When Q is being computed element by element, the negative sign on the complex
number is discarded and it is treated as a real number. When P is computed as
a whole matrix, the negative sign on each element is retained, even if the
imaginary part is zero, and the result is incorrect.

This raises the very mathematical questions of how to handle "x + 0i" vs "x -
0i", should they be treated the same or not, and are they both equivalent to
the real number "x" or not. Evidently it's being treated as significant by
exp() but in this case it caused weird behavior.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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