help-octave
[Top][All Lists]
Advanced

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

Re: Same .m file: different results with different versions of Octave


From: Thomas D. Dean
Subject: Re: Same .m file: different results with different versions of Octave
Date: Mon, 19 Apr 2010 11:47:54 -0700

On Mon, 2010-04-19 at 11:05 -0700, Søren Hauberg wrote:

> I don't understand why
> 
>   (inf + inf * i) / (inf + inf * i)
> 
> should equal
> 
>   1 + 0 * i.
> 
> I can understand why the 'tanh' call should give this result, but once
> you actually evaluate 'sinh' and 'cosh' and perform the division
> manually I don't see why you should get 1.
> 
> Could you elaborate on this?

I copied the code and made the output modifications to emulate the c++
code.  I think the output of sin()/cos() should be 1 + 0 * i, not the
(inf... values.

The library seems to have some problems with over/under flow detection,
I believe.

I tried to build eglibc (ubuntu special version of glibc) and failed.
This was from using apt-get source, configure, and make.  Undefined
reference to __sync_fetch_and_add_4, etc.  This looks like a gcc
builtin???

If I change to use long double everywhere, creall, cimagl, %Lf, etc., I
greatly extend the range to have 5678*(1+i) correct and 5679*(1+i)
failing.  The output is symetrical about zero as -5678 is correct and
-5679 failing.

This is still an over/under flow problem as 
    limit(n*(1+i),n=infinity) == 1

I believe tanh should never return nan + 0*i with complex, non-nan and
non-inf arguments.



reply via email to

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