~ubuntu-branches/ubuntu/jaunty/plotutils/jaunty

« back to all changes in this revision

Viewing changes to ode/bessel.c

  • Committer: Bazaar Package Importer
  • Author(s): Floris Bruynooghe
  • Date: 2007-05-10 19:48:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070510194854-mrr3lgwzpxd8hovo
Tags: 2.5-2
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the GNU plotutils package. */
 
2
 
1
3
/* Bessel function approximations, as given in the book "Computer
2
4
 * Approximations" by Hart, Cheney et al., Wiley, 1968.  Taken in part from
3
5
 * the file standard.c in the gnuplot 3.5 distribution. */
258
260
/* Bessel function approximations */
259
261
 
260
262
double 
261
 
#ifdef _HAVE_PROTOS
262
263
jzero (double x)
263
 
#else
264
 
jzero (x)
265
 
     double x;
266
 
#endif
267
264
{
268
265
  double p, q, x2;
269
266
  int n;
280
277
}
281
278
 
282
279
static double 
283
 
#ifdef _HAVE_PROTOS
284
280
pzero (double x)
285
 
#else
286
 
pzero (x)
287
 
     double x;
288
 
#endif
289
281
{
290
282
  double p, q, z, z2;
291
283
  int n;
303
295
}
304
296
 
305
297
static double 
306
 
#ifdef _HAVE_PROTOS
307
298
qzero (double x)
308
 
#else
309
 
qzero (x)
310
 
     double x;
311
 
#endif
312
299
{
313
300
  double p, q, z, z2;
314
301
  int n;
326
313
}
327
314
 
328
315
static double 
329
 
#ifdef _HAVE_PROTOS
330
316
yzero (double x)
331
 
#else
332
 
yzero (x)
333
 
     double x;
334
 
#endif
335
317
{
336
318
  double p, q, x2;
337
319
  int n;
348
330
}
349
331
 
350
332
double 
351
 
#ifdef _HAVE_PROTOS
352
333
j0 (double x)
353
 
#else
354
 
j0 (x)
355
 
     double x;
356
 
#endif
357
334
{
358
335
  if (x <= 0.0)
359
336
    x = -x;
366
343
}
367
344
 
368
345
double 
369
 
#ifdef _HAVE_PROTOS
370
346
y0 (double x)
371
 
#else
372
 
y0 (x)
373
 
     double x;
374
 
#endif
375
347
{
376
348
  if (x < 0.0)
377
349
    return (dzero/dzero);       /* IEEE machines: invalid operation */
385
357
}
386
358
 
387
359
static double 
388
 
#ifdef _HAVE_PROTOS
389
360
jone (double x)
390
 
#else
391
 
jone (x)
392
 
     double x;
393
 
#endif
394
361
{
395
362
  double p, q, x2;
396
363
  int n;
407
374
}
408
375
 
409
376
static double 
410
 
#ifdef _HAVE_PROTOS
411
377
pone (double x)
412
 
#else
413
 
pone (x)
414
 
     double x;
415
 
#endif
416
378
{
417
379
  double p, q, z, z2;
418
380
  int n;
430
392
}
431
393
 
432
394
static double 
433
 
#ifdef _HAVE_PROTOS
434
395
qone (double x)
435
 
#else
436
 
qone (x)
437
 
     double x;
438
 
#endif
439
396
{
440
397
  double p, q, z, z2;
441
398
  int n;
453
410
}
454
411
 
455
412
static double 
456
 
#ifdef _HAVE_PROTOS
457
413
yone (double x)
458
 
#else
459
 
yone (x)
460
 
     double x;
461
 
#endif
462
414
{
463
415
  double p, q, x2;
464
416
  int n;
475
427
}
476
428
 
477
429
double 
478
 
#ifdef _HAVE_PROTOS
479
430
j1 (double x)
480
 
#else
481
 
j1 (x)
482
 
     double x;
483
 
#endif
484
431
{
485
432
  double v,w;
486
433
  v = x;
500
447
}
501
448
 
502
449
double 
503
 
#ifdef _HAVE_PROTOS
504
450
y1 (double x)
505
 
#else
506
 
y1 (x)
507
 
     double x;
508
 
#endif
509
451
{
510
452
  if (x <= 0.0)
511
453
    return (dzero/dzero);       /* IEEE machines: invalid operation */
535
477
*/
536
478
 
537
479
double
538
 
#ifdef _HAVE_PROTOS
539
480
jn (int n, double x) 
540
 
#else
541
 
jn (n, x) 
542
 
     int n; 
543
 
     double x;
544
 
#endif
545
481
{
546
482
  int i;
547
483
  
590
526
}
591
527
 
592
528
double
593
 
#ifdef _HAVE_PROTOS
594
529
yn (int n, double x) 
595
 
#else
596
 
yn (n, x) 
597
 
     int n;
598
 
     double x;
599
 
#endif
600
530
{
601
531
  int i, sign;
602
532
  double a, b, tmp;