Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / BUGS
1 ------------------------------------------------------------------------
2 BUG-ID:   21819   
3 STATUS:   Open/Confirmed  
4 CATEGORY: Runtime error
5 SUMMARY:  gsl_sf_bessel_J_CF1() crash for large arguments
6
7 Reply-To: Koichi Takahashi <ktakahashi@molsci.org>
8 From: Koichi Takahashi <ktakahashi.molsci@gmail.com>
9 To: bug-gsl@gnu.org
10 CC: Brian Gough <bjg@gnu.org>, Jonathan Taylor <j.m.taylor@durham.ac.uk>
11 Subject: gsl_sf_bessel__J_CF1 bug again
12 Date: Sun, 02 Dec 2007 00:11:02 -0800
13
14 Hi,
15
16 Unfortunately, I found some additional sets of numbers that still
17 crash gsl_sf_bessel_J_CF1() even with the cvs version.   Symptom
18 is exactly the same as what I reported before.  I tested on
19 x86_64.
20
21 main()
22 {
23 //    this used to crash, but now fixed in the current cvs.
24 //    double a = gsl_sf_bessel_jl( 30,  3875.6138424501978 );
25
26 //    at least the following three sets of values still crashes.
27      double a = gsl_sf_bessel_jl( 49, 9912.6308956132361 );
28 //    double a = gsl_sf_bessel_jl( 49, 9950.3478935215589 );
29 //    double a = gsl_sf_bessel_jl( 52, 9930.5181281798232 );
30
31      printf("%g\n",a);
32 }
33
34 Let me know if there is anything I could do to help you fixing
35 this issue.
36
37 thanks,
38 Koichi
39
40 From: Jonny Taylor <j.m.taylor@dur.ac.uk>
41 To: Koichi Takahashi <ktakahashi@molsci.org>
42 Cc: bug-gsl@gnu.org
43 Subject: [Bug-gsl] Re: gsl_sf_bessel__J_CF1 bug again
44 Date: Sun, 2 Dec 2007 10:49:33 +0000
45
46 While the symptom is the same, the cause is different. For those  
47 numbers it seems that 10,000 iterations is simply not enough.  
48 Interestingly, In fact, in all three cases it requires less than 50  
49 additional iterations to converge!?
50
51 The naive fix is simply to increase the maximum permitted number of  
52 iterations, but a more sophisticated fix would probably need to  
53 justify a maximum number of iterations, and propose an alternative  
54 method of generating the result in the cases where the number of  
55 iterations is prohibitive...
56
57 Jonny
58 From: Koichi Takahashi <ktakahashi@molsci.org>
59 To: Jonny Taylor <j.m.taylor@dur.ac.uk>
60 Cc: bug-gsl@gnu.org
61 Subject: [Bug-gsl] Re: gsl_sf_bessel__J_CF1 bug again
62 Date: Sun, 02 Dec 2007 06:06:11 -0800
63
64 At this range, x is still not large enough to use the asymptotic form?
65 In gsl_sf_bessel_jl_e,
66
67    else if(x > 1000.0 && x > 100.0*l*l)
68    {
69      //asymptotic
70    }
71    else
72    {
73      //CF1
74    }
75
76 so, for example, 100 * 50 * 50 = 250,000.
77 For l=50, the iteration starts to exceed 10,000 around x=9900.
78 If we want to stick to 10,000 max iteration, we have to switch to
79 the asymptotic version with something like x > 3*l*l.  Maybe this is
80 too small?   If so I'd consider increasing the max iteration.
81 Maybe we should do both.  Or there can be a better method.
82
83 koichi
84
85 ------------------------------------------------------------------------
86 BUG-ID:   21826   
87 STATUS:   Open            
88 CATEGORY: Build
89 SUMMARY:  libtool problem on hp-ux
90
91 From: "Benoit, Gerard" <GERARD.BENOIT@astrium.eads.net>
92 To: bug-gsl@gnu.org
93 Subject: [Bug-gsl] gsl-1.9 : error in compilation scripts
94 Date: Fri, 13 Jul 2007 12:28:35 +0200
95
96 Hello,
97
98 I wish to report a bug in the compilation scripts:
99 GSL version 1.9  downloaded from ftp.gnu.org
100 computer HP 9000/785 under HP-UX  B.11.00 A 
101 config.guess -> hppa2.0w-hp-hpux11.00
102 compiler  : cc -> /opt/ansic/bin/cc   HP C  HP92453-01 A.11.01.20
103 compilation options : -Ae
104 linker  : ld -> /bin/ld
105
106 fatal error during the build of the shared libraries( first for cblas/libgslcblas.sl )
107 command executed : $archive_cmds 
108 gsl-1.9/libtool ( line 214 ) : archive_cmds="\$CC -b \${wl}+h \${wl}\$soname \${wl}+b \${wl}\$install_libdir -o \$lib \$libobjs \$deplibs \$compiler_flags"
109 coming from gsl-1.9/aclocal.m4 ( line 6541 ) : 
110    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
111
112 the compiler cc don't recognize the "-b" option ( it is a linker option ) and throw it : the linker looks for a main module and don't find it
113 with the correct form ${wl}-b to pass the option to the linker, cc add a start-up module ( like /usr/ccs/lib/crt0.o or /opt/langtools/lib/crt0.o ) which is useless for a shared library and has not be compiled with a PIC option ( +z or +Z ) and the linker stops.
114
115 In the preceding version 1.6 ( I have never downloaded version 1.7 and 1.8 ) the command was :
116 gsl-1.6/libtool ( line 187 ) : archive_cmds="\$LD -b +h \$soname +b \$install_libdir -o \$lib \$libobjs \$deplibs \$linker_flags"
117 from
118 gsl-1.6/aclocal.m4 ( line 2441 ) :    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
119
120 This command works fine
121
122 so, look for a way to return to the LD command in gsl-1.9/aclocal.m4 ( line 6541 ) :
123
124 Best regards
125
126 Gérard BENOIT
127
128 Ce courriel (incluant ses éventuelles pièces jointes) peut contenir des informations confidentielles et/ou protégées ou dont la diffusion est restreinte. Si vous avez reçu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu à quiconque. Merci d’en avertir immédiatement l’expéditeur et d’effacer ce courriel de votre système. Astrium décline toute responsabilité en cas de corruption par virus, d’altération ou de falsification de ce courriel lors de sa transmission par voie électronique.
129
130 This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments, do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Astrium disclaims any and all liability if this email transmission was virus corrupted, altered or falsified.
131 ----------------------------------------------------------------
132 Astrium SAS (393 341 516 RCS Paris) - Siège social: 6 rue Laurent Pichat, 75016 Paris, France
133 _______________________________________________
134 Bug-gsl mailing list
135 Bug-gsl@gnu.org
136 http://lists.gnu.org/mailman/listinfo/bug-gsl
137
138 ------------------------------------------------------------------------
139 BUG-ID:   21828   
140 STATUS:   Open/Confirmed  
141 CATEGORY: Performance
142 SUMMARY:  suboptimal performance of gsl_fdfsolver_lmsder
143
144 From: "Alexander Usov" <a.s.usov@gmail.com>
145 To: help-gsl@gnu.org
146 Subject: [Help-gsl] Strange performance of gsl_fdfsolver_lmsder
147 Date: Wed, 24 Oct 2007 20:45:01 +0200
148
149 Hi all,
150
151 I am currently working on the problem involving source extraction from
152 astronomical images, which essentially boils down to fitting a number of
153 2d gaussians to the image.
154
155 One of the traditionally used fitters in this field is a Levenberg-Marquardt,
156 which gsl_fdfsolver_lmsder is and implementation of.
157
158 At some moment I have notices that for the bigger images (about 550
159 pixels, 20-30 parameters) gsl's lmsder algorithm spends a large fraction
160 of the run-time (about 50%) doing household transform.
161
162 While looking around for are different minimization algorithms I have made
163 a surprising finding that original netlib/minpack/lmder is almost twice faster
164 that that of gsl.
165
166 Could anyone explain such a big difference in performace?
167
168 -- 
169 Best regards,
170   Alexander.
171
172 _______________________________________________
173 Help-gsl mailing list
174 Help-gsl@gnu.org
175 http://lists.gnu.org/mailman/listinfo/help-gsl
176
177 Reply-To: help-gsl@gnu.org
178 From: Brian Gough <bjg@network-theory.co.uk>
179 To: "Alexander Usov" <a.s.usov@gmail.com>
180 Cc: help-gsl@gnu.org
181 Subject: Re: [Help-gsl] Strange performance of gsl_fdfsolver_lmsder
182 Date: Thu, 25 Oct 2007 21:57:08 +0100
183
184 At Wed, 24 Oct 2007 20:45:01 +0200,
185 Alexander Usov wrote:
186 > At some moment I have notices that for the bigger images (about 550
187 > pixels, 20-30 parameters) gsl's lmsder algorithm spends a large fraction
188 > of the run-time (about 50%) doing household transform.
189
190 > While looking around for are different minimization algorithms I have made
191 > a surprising finding that original netlib/minpack/lmder is almost twice faster
192 > that that of gsl.
193
194 > Could anyone explain such a big difference in performace?
195
196 I have a vague memory that there was some quantity (Jacobian?) that
197 MINPACK only computes fully at the end, but in GSL it is accessible to
198 the user at each step so I felt I had to update it on each iteration
199 in the absence of some alternate scheme.  Sorry this is not a great
200 answer but I am not able to look at it in detail now.
201
202 -- 
203 Brian Gough
204
205 _______________________________________________
206 Help-gsl mailing list
207 Help-gsl@gnu.org
208 http://lists.gnu.org/mailman/listinfo/help-gsl
209
210 ------------------------------------------------------------------------
211 BUG-ID:   21830   
212 STATUS:   Open/Confirmed  
213 CATEGORY: None
214 SUMMARY:  provide function to retrieve size of chebyshev data
215
216 Reply-To: help-gsl@gnu.org
217 From: Brian Gough <bjg@network-theory.co.uk>
218 To: help-gsl@gnu.org
219 Subject: Re: [Help-gsl] Writing Chebychev coefficients to disk
220 Date: Mon, 12 Mar 2007 21:40:21 +0000
221
222 At Mon, 12 Mar 2007 10:28:10 -0600,
223 Patrick Alken wrote:
224
225 > It seems to me the simplest way to do this is just:
226
227 > fwrite(gsl_cheb_ptr, sizeof(gsl_cheb_series), 1, fp);
228 > fwrite(gsl_cheb_ptr->c, sizeof(double), n, fp);
229
230 > and later:
231
232 > fread(gsl_cheb_ptr, sizeof(gsl_cheb_series), 1, fp);
233 > fread(gsl_cheb_ptr->c, sizeof(double), n, fp);
234
235
236 Yes, the library should help in getting the correct value of "n"
237 (which is c->order + 1 in this case) to avoid subtle off-by-one
238 errors.
239
240 It's certainly more useful to expose the memory than provide the read
241 and write functions directly though.
242
243 -- 
244 Brian Gough
245
246 Network Theory Ltd,
247 Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/
248
249 _______________________________________________
250 Help-gsl mailing list
251 Help-gsl@gnu.org
252 http://lists.gnu.org/mailman/listinfo/help-gsl
253
254 None
255
256 ------------------------------------------------------------------------
257 BUG-ID:   21831   
258 STATUS:   Open            
259 CATEGORY: Accuracy problem
260 SUMMARY:  Levý random number generator for alpha < 1
261
262 From: rafael@fis.unb.br
263 To: bug-gsl@gnu.org
264 Subject: [Bug-gsl] Levý random number generator
265 Date: Mon, 26 Mar 2007 19:48:01 -0300
266
267 The Levý skew random number generator (gsl_ran_levy_skew) does not  
268 procuce a Levý random number when beta=0 (symmetric case), and the  
269 gsl_ran_levy function does not work as stated in the docs. I made some  
270 histograms from 10^6 samples to check the accuracy of the algorithms,  
271 by comparison agaisnt the numerical integration of the equation of  
272 Levý's PDF. For the gsl_ran_levy function there is a good precison for  
273 alpha [1,2], for alpha (0.3,1) you must sum a series of random numbers  
274 to get the same precision (tipicaly 100 or more gsl_ran_levy numbers).  
275 For alpha<=0.3 the algorithm does not work properly, even worse, the  
276 error increases as you add more random numbers. This contradicts the  
277 manual that says "the algoritm only works for alpha (0,2]". The  
278 function gsl_ran_levy_skew does not produce levy random numbers when  
279 beta=0, instead the pdf of the random numbers is a linear (?!?!) one.
280
281 ----------------------------------------------------------------
282 This message was sent using IMP, the Internet Messaging Program.
283
284 _______________________________________________
285 Bug-gsl mailing list
286 Bug-gsl@gnu.org
287 http://lists.gnu.org/mailman/listinfo/bug-gsl
288
289 From: rafael@fis.unb.br
290 To: Brian Gough <bjg@network-theory.co.uk>
291 Cc: 
292 Subject: Re: [Bug-gsl] Lev� random number generator
293 Date: Tue, 27 Mar 2007 09:35:15 -0300
294
295 Thanks for your quick answer, and sorry about my poor english, it is  
296 not my natural language.
297
298 The code below generates 10^6 random numbers, and makes a normalized  
299 histogram wich is compared to the levy pdf. To get the levy pdf, it  
300 numericaly integrates the characteristic function for levy process  
301 (the function f in the code). The n parameter just adds a series of  
302 levy numbers to get better precision. The code saves 2 files:  
303 lhist-$alpha-$n (the normalized histogram) and lpdf-$alpha (the pdf  
304 for the levy process). It also prints to the stdout the absolute error  
305 (square of the difference) between the histogram and the pdf.
306
307 The function levy skew shows problems for alpha<1.
308
309 With this code, you can also check the problems related to the  
310 gsl_ran_levy function (just change gsl_ran_levy_skew by gsl_ran_levy,  
311 cutting the last paramenter).
312
313 I am using the pre-compiled gsl that comes with debian etch (gsl  
314 version 1.8.2).
315
316 If you are interested, I also encoded a routine to generate levy skew  
317 random numbers, it is not fully tested, but it works for beta=0 and  
318 alpha<1 (it suffers from the same precision problem as gsl_ran_levy  
319 function for small alpha)
320
321 #include <stdio.h>
322 #include <stdlib.h>
323 #include <math.h>
324 #include <time.h>
325 #include <sys/time.h>
326 #include <unistd.h>
327 #include <string.h>
328 #include <gsl/gsl_rng.h>
329 #include <gsl/gsl_randist.h>
330 #include <gsl/gsl_statistics_double.h>
331 #include <gsl/gsl_histogram.h>
332 #include <gsl/gsl_integration.h>
333
334 double f (double x, void *params)
335 {
336         double alpha = *(double *) params;
337         double f = exp(-pow(x,alpha))/M_PI;
338         return f;
339 }
340
341 double *levy_pdf(double alpha,int hist_size,double a,double b)
342 {
343         double abserr,*lpdf,dx;
344         gsl_function F;
345         int i;
346         gsl_integration_workspace *w=gsl_integration_workspace_alloc(1000);
347         gsl_integration_workspace *cw=gsl_integration_workspace_alloc(1000);
348         gsl_integration_qawo_table  
349 *wf=gsl_integration_qawo_table_alloc(0.0,1.0,GSL_INTEG_COSINE,200);
350         lpdf=(double*)calloc(hist_size,sizeof(double));
351         F.function=&f;
352         F.params=&alpha;
353         dx=(double)(b-a)/(double)hist_size;
354         for (i=0;i<hist_size;i++)
355         {
356                 gsl_integration_qawo_table_set(wf,i*dx+a,1.0,GSL_INTEG_COSINE);
357                 gsl_integration_qawf (&F,0.0,1e-10,1000,w,cw,wf,&lpdf[i],&abserr);
358         }
359         gsl_integration_qawo_table_free(wf);
360         gsl_integration_workspace_free(w);
361         gsl_integration_workspace_free(cw);
362         return (lpdf);
363 }
364
365 int main (int argc,char *argv[])
366 {
367         double *l,*lpdf,a=-20,b=20,alpha,dx,n,errabs=0.0;
368         unsigned long int rnd_seed;
369         int i,j,rand_numbers=1e6,hist_size=400;
370         gsl_histogram *h;
371         gsl_rng *r;
372         struct timeval *tv;
373         struct timezone *tz;
374         char filename[50];
375         FILE *f1,*f2;
376         if(argc!=3)
377         {
378                 printf("\nThe program must be called with 2 parameters: alpha and n\n \n");
379                 exit(1);
380         }
381         dx=(double)(b-a)/(double)hist_size;
382         h=gsl_histogram_alloc(hist_size);
383         alpha=atof(argv[1]);
384         n=atof(argv[2]);
385         strcpy(filename,"lhist-");
386         strcat(filename,argv[1]);
387         strcat(filename,"-");
388         strcat(filename,argv[2]);
389         f1=fopen(filename,"w+");
390         strcpy(filename,"lpdf-");
391         strcat(filename,argv[1]);
392         f2=fopen(filename,"w+");
393         l=(double*)calloc(rand_numbers,sizeof(double));
394         lpdf=(double*)calloc(hist_size,sizeof(double));
395         r=gsl_rng_alloc (gsl_rng_mt19937);
396         gettimeofday(tv,tz);
397         rnd_seed=(unsigned long int)tv->tv_usec;
398         gsl_rng_set(r,rnd_seed);
399         i=0;
400         do
401         {
402                 l[i]=0.0;
403                 for (j=1;j<n;j++) l[i]+=gsl_ran_levy_skew(r,1.0,alpha,0.0);
404                 l[i]=l[i]/pow(n,1.0/alpha);
405                 if (abs(l[i])<=20) i++;//picks only random numbers in the interval  
406 [a,b] to get good precision in the histogram
407         }while(i<rand_numbers);
408         gsl_histogram_set_ranges_uniform(h,a,b);
409         for(i=0;i<rand_numbers;i++) gsl_histogram_increment(h,l[i]);
410         gsl_histogram_scale(h,(double)hist_size/((b-a)*gsl_histogram_sum(h)));
411         gsl_histogram_fprintf(f1,h,"%g","%g");
412         lpdf=levy_pdf(alpha,hist_size,a,b);
413         for (i=0;i<hist_size;i++) fprintf(f2,"%e\t%e\n",i*dx+a,lpdf[i]);
414         for (i=0;i<hist_size;i++) errabs+=pow((gsl_histogram_get(h,i)-lpdf[i]),2.0);
415         printf("%e\n",errabs/(double)hist_size);
416         gsl_histogram_free(h);
417         gsl_rng_free(r);
418         fclose(f1);
419         exit (0);
420 }
421
422 > At Mon, 26 Mar 2007 19:48:01 -0300,
423 > rafael@fis.unb.br wrote:
424 >>
425 >> The Lev� skew random number generator (gsl_ran_levy_skew) does not
426 >> procuce a Lev� random number when beta=0 (symmetric case), and the
427 >> gsl_ran_levy function does not work as stated in the docs. I made some
428 >> histograms from 10^6 samples to check the accuracy of the algorithms,
429 >> by comparison agaisnt the numerical integration of the equation of
430 >> Lev�'s PDF. For the gsl_ran_levy function there is a good precison for
431 >> alpha [1,2], for alpha (0.3,1) you must sum a series of random numbers
432 >> to get the same precision (tipicaly 100 or more gsl_ran_levy numbers).
433 >> For alpha<=0.3 the algorithm does not work properly, even worse, the
434 >> error increases as you add more random numbers. This contradicts the
435 >> manual that says "the algoritm only works for alpha (0,2]". The
436 >> function gsl_ran_levy_skew does not produce levy random numbers when
437 >> beta=0, instead the pdf of the random numbers is a linear (?!?!) one.
438 >
439 > Thanks for your email.  Please can you send a small example program
440 > which demonstrates the problem.
441 >
442 > Note that the Levy skew generator is tested in the GSL test suite for
443 > several cases where beta=0 -- if you have not done so, can you run
444 > "make check" and confirm that it works for these cases.
445 >
446 > --
447 > Brian Gough
448 > (GSL Maintainer)
449 >
450 > Network Theory Ltd,
451 > Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/
452 >
453
454 ----------------------------------------------------------------
455 This message was sent using IMP, the Internet Messaging Program.
456
457 _______________________________________________
458 Bug-gsl mailing list
459 Bug-gsl@gnu.org
460 http://lists.gnu.org/mailman/listinfo/bug-gsl
461
462 -
463
464 ------------------------------------------------------------------------
465 BUG-ID:   21832   
466 STATUS:   Open/Fixed      
467 CATEGORY: None
468 SUMMARY:  gsl infnan.c configure/build bug on solaris
469
470 From: Richard Smith <Richard.Smith@Sun.COM>
471 To: bug-gsl@gnu.org
472 Subject: [Bug-gsl] gsl infnan.c configure/build bug
473 Date: Tue, 24 Jul 2007 10:24:22 +1000
474
475 infnan.c currently fails to compile on Solaris with Sun Studio 12 compilers
476 when using default compiler options as generated by running configure with
477 no options. Here is an extract of the output when running make:
478
479 /bin/bash ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H  -I. 
480 -I../../sys
481  -I.. -I..     -g -c -o infnan.lo ../../sys/infnan.c
482  cc -DHAVE_CONFIG_H -I. -I../../sys -I.. -I.. -g -c ../../sys/infnan.c  
483 -KPIC -D
484 PIC -o .libs/infnan.o
485 "/usr/include/ieeefp.h", line 74: syntax error before or at: 
486 __builtin_isfinite
487 cc: acomp failed for ../../sys/infnan.c
488
489 The problem seems to occur as a result of the following combination of 
490 things:
491 1. "finite" function is used in various source files
492 2. configure.ac checks for <ieeefp.h> and finds it
493 3. On Solaris, "finite" is defined in <ieeefp.h>
494 4. configure.ac only checks <math.h> for "finite", and doesn't find it.
495 5. Since its a c99 environment, "isfinite" is found.
496 6. config.h ends up containing amongst other things the following lines:
497 #define HAVE_DECL_FINITE 0
498 #define HAVE_DECL_ISFINITE 1
499 #if !HAVE_DECL_FINITE
500 #if HAVE_DECL_ISFINITE
501 #define finite isfinite
502 #else
503 #define finite gsl_finite
504 #endif
505 #endif
506    This means that "finite" macro has the value "isfinite"
507 7. "isfinite" is a macro, ultimately defined in <iso/math_c99.h>:
508 #define        isfinite(x)     __builtin_isfinite(x)
509 8. <ieeefp.h> declares "finite" function:
510 extern int      finite(double);
511 9. After macro expansion the compiler sees
512 extern int      __builtin_isfinite ( double ) ;
513 and complains with an error.
514
515 There's probably multiple ways of overcoming the problem. A workaround is
516 to force the compiler not to use a C99 environment e.g. -xc99=%none. However
517 since it would be desirable to have configure work well by default, maybe
518 the test in configure.ac for "finite" should be something like:
519 AC_CHECK_DECLS(finite,,,[#include <math.h>
520 #if HAVE_IEEEFP_H
521 # include <ieeefp.h>
522 #endif])
523
524 Alternatively all uses of "finite" could be changed to use "isfinite", and
525 the configuration/build be based around assuming a C99 environment, with
526 substitute functions and macros being provided where the necessary C99
527 facilities are missing. On Linux, the BSD floating point classification
528 functions are documented as being obsolete, so their use should probably
529 be avoided.
530
531 -- 
532 ============================================================================
533    ,-_|\   Richard Smith - Technical Specialist
534   /     \  Sun Microsystems Australia         Phone : +61 3 9869 6200
535 richard.smith@Sun.COM                        Direct : +61 3 9869 6224
536   \_,-._/  476 St Kilda Road                    Fax : +61 3 9869 6290
537        v   Melbourne Vic 3004 Australia
538 =========================================================================== 
539
540 _______________________________________________
541 Bug-gsl mailing list
542 Bug-gsl@gnu.org
543 http://lists.gnu.org/mailman/listinfo/bug-gsl
544
545 ------------------------------------------------------------------------
546 BUG-ID:   21833   
547 STATUS:   Open            
548 CATEGORY: Performance
549 SUMMARY:  suboptimal performance of gsl permutation?
550
551 From: "djamel anonymous" <djam8193ah@hotmail.com>
552 To: bjg@network-theory.co.uk
553 Subject: gsl permutation
554 Date: Wed, 24 Jan 2007 07:42:06 +0000
555
556 Hi.
557 i am sending you this email about a possible issue in glibc permutation 
558 algorithm.i think it has qudratic worst case running time.for example if we 
559 have the permutation
560 1,2,3,4,,,,,n,0
561 we will permute all elements in first iteration then for each iteration we 
562 will traverse on average half the cycle (which is of size n) before we know 
563 that the elements of cycle have already been permuted.there is two possible 
564 solutions to make the algorithm linear:
565 1-at each step we traverse the full cycle and permute all elements in the 
566 cycle.for each permuted element i  we assign p[i]=i.the disavantage of this 
567 is that it will destroy the original permutation.
568 2-use a bit array of size n bits.each time we permute an element we set the 
569 relevant bit.if at iteration i we find that bit i is already set we skip to 
570 next iteration.the disavantage of this is that it equires additional storage 
571 allocation.
572 best regards.
573
574 _________________________________________________________________
575 MSN Hotmail sur i-mode\99 : envoyez et recevez des e-mails depuis votre 
576 téléphone portable ! http://www.msn.fr/hotmailimode/
577
578 3 - Normal
579
580 ------------------------------------------------------------------------
581 BUG-ID:   21835   
582 STATUS:   Open            
583 CATEGORY: Accuracy problem
584 SUMMARY:  gsl_sf_hyperg_2F1 problematic arguments
585
586 BUG#1 -- gsl_sf_hyperg_2F1_e fails for some arguments 
587
588 From: keith.briggs@bt.com
589 Subject: gsl_sf_hyperg_2F1 bug report
590 Date: Thu, 31 Jan 2002 12:30:04 -0000
591
592 gsl_sf_hyperg_2F1_e fails with arguments (1,13,14,0.999227196008978,&r).
593 It should return 53.4645... .
594
595 #include <gsl/gsl_sf.h>
596 #include <stdio.h>
597
598 int main (void)
599 {
600   gsl_sf_result r;
601   gsl_sf_hyperg_2F1_e (1,13,14,0.999227196008978,&r);
602   printf("r = %g %g\n", r.val, r.err);
603 }
604
605 NOTES: The program overflows the maximum number of iterations in
606 gsl_sf_hyperg_2F1, due to the presence of a nearby singularity at
607 (c=a+b,x=1) so the sum is slowly convergent.
608
609 The exact result is 53.46451441879150950530608621 as calculated by
610 gp-pari using sumpos(k=0,gamma(a+k)*gamma(b+k)*gamma(c)*gamma(1)/
611 (gamma(c+k)*gamma(1+k)*gamma(a)*gamma(b))*x^k)
612
613 The code needs to be extended to handle the case c=a+b. This is the
614 main problem. The case c=a+b is special and needs to be computed
615 differently.  There is a special formula given for it in Abramowitz &
616 Stegun 15.3.10
617
618 As reported by Lee Warren <warren@atom.chem.utk.edu> another set of
619 arguments which fail are:
620
621 #include <gsl/gsl_sf.h>
622 #include <stdio.h>
623
624 int main (void)
625 {
626   gsl_sf_result r;
627   gsl_sf_hyperg_2F1_e (-1, -1, -0.5, 1.5, &r);
628   printf("r = %g %g\n", r.val, r.err);
629 }
630
631 The correct value is -2.
632
633 See also, 
634
635 From: Olaf Wucknitz <wucknitz@jive.nl>
636 To: bug-gsl@gnu.org
637 Subject: [Bug-gsl] gsl_sf_hyperg_2F1
638
639 Hi,
640
641 I am having a problem with gsl_sf_hyperg_2F1.
642 With the parameters (-0.5, 0.5, 1, x) the returned values show a jump at 
643 x=0.5. For x<0.5 the results seem to be correct, while for x>0.5 they 
644 aren't.
645 The function gsl_sf_hyperg_2F1_e calls hyperg_2F1_series for x<0.5, but
646 hyperg_2F1_reflect for x>0.5. The latter function checks for c-a-b being 
647 an integer (which it is in my case). If I change one of the parameters 
648 a,b,c by a small amount, the other branch of the function is taken and the 
649 results are correct again.
650 Unfortunately I know too little about the numerics of 2F1 to suggest a 
651 patch at the moment.
652
653 Regards,
654 Olaf Wucknitz
655 -- 
656 Joint Institute for VLBI in Europe                wucknitz@jive.nl
657
658 ------------------------------------------------------------------------
659 BUG-ID:   21836   
660 STATUS:   Open/Confirmed  
661 CATEGORY: Accuracy problem
662 SUMMARY:  gamma_inc_P and gamma_inc_Q only satisfy P+Q=1 within errors
663
664 BUG#44 -- gamma_inc_P and gamma_inc_Q only satisfy P+Q=1 within errors
665
666 The sum of gamma_inc_P and gamma_inc_Q doesn't always satisfy the
667 identity P+Q=1 exactly (although it is correct within errors), due the
668 slightly different branch conditions for the series and continued
669 fraction expansions.  These could be made identical so that P+Q=1 exactly.
670
671 #include <stdio.h>
672 #include <gsl/gsl_sf_gamma.h>
673
674 int
675 main (void)
676 {
677   gsl_sf_result r1, r2;
678   double a = 0.3, x = 1.0;
679   gsl_sf_gamma_inc_P_e (a, x, &r1);
680   gsl_sf_gamma_inc_Q_e (a, x, &r2);
681   printf("%.18e\n", r1.val);
682   printf("%.18e\n", r2.val);
683   printf("%.18e\n", r1.val + r2.val);
684 }
685
686 $ ./a.out
687 9.156741562411074842e-01
688 8.432584375889111417e-02
689 9.999999999999985567e-01
690
691 3 - NormalNone
692
693 ------------------------------------------------------------------------
694 BUG-ID:   21837   
695 STATUS:   Open/Confirmed  
696 CATEGORY: Runtime error
697 SUMMARY:  gsl_linalg_solve_symm_tridiag requires positive definite matrix
698
699 A zero on the diagonal will cause NaNs even though a reasonable
700 solution could be computed in principle. 
701
702 #include <gsl/gsl_linalg.h>
703
704 int main (void)
705 {
706   double d[] = { 0.00, 1.21, 0.80, 1.55, 0.76 } ;
707   double e[] = { 0.82, 0.39, 0.09, 0.68 } ;
708   double b[] = { 0.07, 0.62, 0.81, 0.11, 0.65} ;
709   double x[] = { 0.00, 0.00, 0.00, 0.00, 0.00} ;
710
711   gsl_vector_view dv = gsl_vector_view_array(d, 5);
712   gsl_vector_view ev = gsl_vector_view_array(e, 4);
713   gsl_vector_view bv = gsl_vector_view_array(b, 5);
714   gsl_vector_view xv = gsl_vector_view_array(x, 5);
715
716   gsl_linalg_solve_symm_tridiag(&dv.vector, &ev.vector, &bv.vector, &xv.vector);
717   gsl_vector_fprintf(stdout, &xv.vector, "% .5f");
718
719   d[0] += 1e-5;
720   gsl_linalg_solve_symm_tridiag(&dv.vector, &ev.vector, &bv.vector, &xv.vector);
721   gsl_vector_fprintf(stdout, &xv.vector, "% .5f");
722 }
723
724 $ ./a.out
725  nan
726  nan
727  nan
728  nan
729  nan
730  0.13626
731  0.08536
732  1.03840
733 -0.60009
734  1.39219
735
736 AUG 2007: We now return an error code for this case.  To return a solution
737 we would need to do a permutation, see slatec/dgtsl.f
738
739 3 - NormalNone
740
741 ------------------------------------------------------------------------
742 BUG-ID:   22478   
743 STATUS:   Open/Confirmed  
744 CATEGORY: None
745 SUMMARY:  Missing functions for complex vectors
746
747 From: Federico Zenith <federico.zenith@member.fsf.org>
748 To: help-gsl@gnu.org
749 Subject: [Help-gsl] Missing functions for complex vectors
750 Date: Mon, 03 Mar 2008 13:50:43 +0100
751
752 Hi,
753 I am working on a C++ GSL wrapper (yes, there are not enough of them
754 already around :-), and I have been working on vectors last week; while
755 writing the wrapper, I noticed a couple of oddities I'd like to point
756 out before reporting them as a bug (I am using the GSL version 1.10):
757
758 1) complex vectors have defined all properties mentioned on this page:
759 http://www.gnu.org/software/gsl/manual/html_node/Vector-properties.html
760 except isnonneg(). I am not sure what's the meaning of ispos() or
761 isneg() for a vector of complex numbers, I suppose it means "both real
762 AND imaginary part are positive", but this should be documented;
763 furthermore, I do not understand why, if ispos() and isneg() could be
764 defined, why could not isnonneg() be as well.
765
766 2) Vector operations, defined on this page:
767 http://www.gnu.org/software/gsl/manual/html_node/Vector-operations.html
768 are not defined for complex types. As far as I can guess, all these
769 operations would still make sense for complex numbers. What is really
770 odd is, the same operations are defined for complex matrices.
771
772 Did I miss something?
773
774 Cheers,
775 -Federico
776
777 ------------------------------------------------------------------------