help-octave
[Top][All Lists]
Advanced

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

Re: problem with consistency of root finding and sorting


From: David Bateman
Subject: Re: problem with consistency of root finding and sorting
Date: Wed, 10 Oct 2007 02:23:51 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Ben Abbott wrote:
> I have Octave 2.9.14 on Mac OS X (intel & PPC) installed via Fink and  
> am concerned that my installations are giving different results than  
> others.
> 
> During the process of modifying residue.m so that it would function  
> in a manner consistent with Matlab's I've become suspicious that my  
> Octave installation  does not work the same as others.
> 
> The difference is small, but is troublesome.
> 
> Given the following short example,
> 
>       r = sort(roots([1 0 18 0 81]))
>       r_err = r - round(r)
> 
> I obtain the results below
> 
> r = sort(roots([1 0 18 0 81]))
> r =
> 
>     0.0000 - 3.0000i
>     0.0000 + 3.0000i
>    -0.0000 - 3.0000i
>    -0.0000 + 3.0000i
> 
> r_err = r - round(r)
> r_err =
> 
>    2.5814e-08 + 1.6920e-08i
>    2.5814e-08 - 1.6920e-08i
>    -2.5814e-08 - 1.6920e-08i
>    -2.5814e-08 + 1.6920e-08i


Under Octave 2.9.14 compiled with g++ 4.0.1 on a Mandriva 2006 machine I get

octave:3> r = sort(roots([1 0 18 0 81]))
r =

   0.0000 - 3.0000i
   0.0000 + 3.0000i
  -0.0000 - 3.0000i
  -0.0000 + 3.0000i

octave:4> r_err = r - round(r)
r_err =

  1.5973e-08 + 6.5742e-09i
  1.5973e-08 - 6.5742e-09i
  -1.5973e-08 - 6.5742e-09i
  -1.5973e-08 + 6.5742e-09i


D.







> 
> I suspect that others are getting slightly different results.  
> Specifically, some installations appear to be returning conjugate of  
> "r" instead. I've posted the "r_err" because it appears larger than  
> I'd expect.
> 
> I'd appreciate if others would try to short script and post the  
> result ... in the hope of isolating the problem.
> 
> TiA



reply via email to

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