Integration differences between Windows version and Linux version of Octave

Dmitri A. Sergatskov dasergatskov at gmail.com
Thu May 21 13:53:26 CDT 2009


On Thu, May 21, 2009 at 11:51 AM, Adrian Spiridon<spiriad at yahoo.com> wrote:
> Hello there !
>
>          I saw a difference btween Octave in Windows (v. 3.0.3) and Octave
> in Linux (v. 3.0.1). Suppose I want to integrate the function
> f (x) =  1/(x^3-2*x-5) on the interval [0, 2]. I  write an M-file function
> myfun.m that computes the integrand:
>
> function y = myfun(x)
> y = 1./(x.^3-2*x-5);
> endfunction
>
> ,and I use the quad function like this : Q = quad(@myfun,0,2)
>     Using windows program the result is Q = -0.4605    --> CORRECT
>     Using linux version the result is Q=   0.87910 --> WRONG
>
>    I have taken this example from the MATLAB documentation site so it is
> absolutely correct.
>
> ...what may be the reason ?

3.0.3 on Fedora 10 seems to work OK:

octave:14> function y = myfun(x)
> y = 1./(x.^3-2*x-5);
> endfunction
octave:15> Q = quad(@myfun,0,2)
Q = -0.46050
octave:16>

So perhaps the error had been fixed somewhere in the progress from
3.0.1 to 3.0.3.


>
> Regards,
> Spiridon Adrian
>
>

Sincerely,

Dmitri.



More information about the Bug-octave mailing list