[Top][All Lists]

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

Re: [Help-gsl] Test suite?

From: Liam Healy
Subject: Re: [Help-gsl] Test suite?
Date: Wed, 17 Sep 2008 19:11:22 -0400

On Wed, Sep 17, 2008 at 1:43 PM, Brian Gough <address@hidden> wrote:
> At Mon, 15 Sep 2008 15:44:57 +0200,
> Frank Reininghaus wrote:

[actually Liam wrote this part]
>> > make[2]: Entering directory `/home/liam/mathematics/gsl-1.11/poly'
>> > FAIL: y.real, gsl_complex_poly_complex_eval ({-2.31 + 0.44i, 4.21 -
>> > 3.19i, 0.93 + 1.04i, -0.42 + 0.68i}, 0.49 + 0.95i)
>> > (-1.6845078800000004 observed vs 1.82462012000000007 expected) [9]
> Was there any resolution to this problem?  I have not seen it on any
> other system.

None yet.  Frank asked me to continue the discussion on bug-gsl but
when I tried to join the mailling list it said my request was being
held for moderation.   So I will answer his questions here.

- Which Linux distribution do you use?  Debian lenny (testing)

- Which compiler do you use (probably gcc?) and which version (output of
'gcc --version' if you're on gcc)?
gcc (Debian 4.3.1-9) 4.3.1

- What kind of CPU do you have? Is it running in 32- or 64-bit mode?
Linux thinkpad 2.6.26-1-amd64 #1 SMP Thu Aug 28 11:13:42 UTC 2008
x86_64 GNU/Linux
dual core amd64

- Did you change the optimisation options, or do you use the default?

- If you repeat the test, does it always report the same wrong results
(-1.6845078800000004 observed vs ... and -0.30943988
observed vs ...)?
Same results.

Plus the following:

My first idea would be to replace the code in the loop in
gsl_complex_poly_complex_eval () by 'ans = gsl_complex_add (c[i-1],
gsl_complex_mul (x, ans))' and see if the problem persists (although I still
think that the separate calculation of real and imaginary part which I found
to be faster is equivalent).

I modified the function in poly/eval.c almost like this, but using z
instead of x as that looks more correct and it is what is in the
commented-out portion

gsl_complex_poly_complex_eval(const gsl_complex c[], const int len,
const gsl_complex z)
  int i;
  gsl_complex ans = c[len-1];
  for(i=len-1; i>0; i--) {
    /* The following three lines are equivalent to
       ans = gsl_complex_add (c[i-1], gsl_complex_mul (z, ans));
       but faster */

       ans = gsl_complex_add (c[i-1], gsl_complex_mul (z, ans));

    double tmp = GSL_REAL (c[i-1]) + GSL_REAL (z) * GSL_REAL (ans) -
GSL_IMAG (z) * GSL_IMAG (ans);
    GSL_SET_IMAG (&ans, GSL_IMAG (c[i-1]) + GSL_IMAG (z) * GSL_REAL
(ans) + GSL_REAL (z) * GSL_IMAG (ans));
    GSL_SET_REAL (&ans, tmp);
  return ans;

However, when I make, it ends with
make[2]: Entering directory `/home/liam/mathematics/gsl-1.11/poly'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I.. -I..    -g -O2 -c -o eval.lo eval.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -g -O2 -c eval.c
-fPIC -DPIC -o .libs/eval.o
eval.c: In function 'gsl_complex_poly_complex_eval':
eval.c:65: error: incompatible types in assignment
make[2]: *** [eval.lo] Error 1
make[2]: Leaving directory `/home/liam/mathematics/gsl-1.11/poly'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/liam/mathematics/gsl-1.11'
make: *** [all] Error 2


reply via email to

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