octave-maintainers
[Top][All Lists]
Advanced

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

Re: 2.9.11?


From: Daniel J Sebald
Subject: Re: 2.9.11?
Date: Thu, 19 Apr 2007 15:13:11 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:
On 19-Apr-2007, Daniel J Sebald wrote:

| Daniel J Sebald wrote:
| | > The only other unusual results are the scripts/elfun/acscd.m and asecd.m | > tests with the division by zero problem that hangs.

So it is the function asecd.m and acscd.m that have problems?  Then I
would thing that it is really asin and acos that have problems because
the others are just .m files.

Right.  We traced this to asin(inf) and acos(inf), which should be undefined.


Look in src/mappers.cc.  There you'll find

  DEFUN_MAPPER (asin, 0, 0, 0, asin, 0, asin, -1.0, 1.0, 0, 1,
    "-*- texinfo -*-\n\
@deftypefn {Mapping Function} {} asin (@var{x})\n\
Compute the inverse sine of each element of @var{x}.\n\
@end deftypefn");

So along with the comments in defun.h where DEFUN_MAPPER is defined,

Saw those...


this means that there are two versions of asin defined:

//   d_d_map is a pointer to a function that should be called for real
//     arguments that are expected to create real results.
//
//   c_c_map is a pointer to a function that should be called for
//     complex arguments that are expected to create complex results.

The complex versions of asin and acos come from
liboctave/lo-mappers.cc.  Their definitions are:

  Complex
  acosh (const Complex& x)
  {
    return log (x + sqrt (x*x - 1.0));
  }

  Complex
  asin (const Complex& x)
  {
    static Complex i (0, 1);

    return -i * log (i*x + sqrt (1.0 - x*x));
  }

Ah, there it is.  Thanks...

Well, it seems the sqrt() routine may be where things are hanging:

octave:1> i*Inf
ans = NaN + Infi
octave:2> log(i*Inf)
ans = NaN - NaNi
octave:3> log(Inf)
ans = Inf
octave:4> sqrt(1.0 - Inf*Inf)
Press Control-C again to abort.
panic: Interrupt -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete

address@hidden ~]$ octave
octave:1> sqrt(-Inf*Inf)
Press Control-C again to abort.
panic: Interrupt -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete

address@hidden ~]$ octave
octave:1> sqrt(Inf)
ans = Inf
octave:2> sqrt(-3)
ans =  0.00000 + 1.73205i
octave:3> sqrt(-Inf)
Press Control-C again to abort.
panic: Interrupt -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete

So, it looks like the failing case is sqrt(-Inf). OK, now where is the complex version of square root, std::sqrt? :-)

Dan




reply via email to

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