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: anonymous
Subject: [Octave-bug-tracker] [bug #62321] Wrong result for Airy funtion
Date: Sun, 17 Apr 2022 12:57:34 -0400 (EDT)

Follow-up Comment #10, bug #62321 (project octave):

Thank you for the workaround and for all the work you quickly did.

The problem you describe in [comment #9 comment #9] comes from `sqrt` and not
from `exp`. Because, the exponential function is continuous on the whole
complex plane whereas square root function is discontinuous across the
negative real axis.


sqrt(V)(1, 1)
##ans =       0 - 0.6819i

sqrt(V(1, 1))
##ans =       0 + 0.6819i


I do not understand why the scaling is done "by hand" in octave because if I
look into the amos function `zairy`
[https://hg.savannah.gnu.org/hgweb/octave/file/30f7f409861a/liboctave/external/amos/zairy.f#l28]
that is call, the argument `kode = 1` return the unscaled version of the Airy
function. So why call the amos Airy function with `kode = 2` to get the scaled
version and then do the unscaling on the C++ octave part when it is done
correctly in FORTRAN amos part ?

Something like:


if scaled
{
    F77_FUNC (zairy, ZAIRY) (zr, zi, id, 2, ar, ai, nz, t_ierr);
}
else
{
    F77_FUNC (zairy, ZAIRY) (zr, zi, id, 1, ar, ai, nz, t_ierr);
}




    _______________________________________________________

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]