/* j1.c
*
* Bessel function of order one
*
*
*
* SYNOPSIS :
*
* double x , y , j1 ( ) ;
*
* y = j1 ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns Bessel function of order one of the argument .
*
* The domain is divided into the intervals [ 0 , 8 ] and
* ( 8 , infinity ) . In the first interval a 24 term Chebyshev
* expansion is used . In the second , the asymptotic
* trigonometric representation is employed using two
* rational functions of degree 5 / 5 .
*
*
*
* ACCURACY :
*
* Absolute error :
* arithmetic domain # trials peak rms
* DEC 0 , 30 10000 4 . 0 e - 17 1 . 1 e - 17
* IEEE 0 , 30 30000 2 . 6 e - 16 1 . 1 e - 16
*
*
*/
/* y1.c
*
* Bessel function of second kind of order one
*
*
*
* SYNOPSIS :
*
* double x , y , y1 ( ) ;
*
* y = y1 ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns Bessel function of the second kind of order one
* of the argument .
*
* The domain is divided into the intervals [ 0 , 8 ] and
* ( 8 , infinity ) . In the first interval a 25 term Chebyshev
* expansion is used , and a call to j1 ( ) is required .
* In the second , the asymptotic trigonometric representation
* is employed using two rational functions of degree 5 / 5 .
*
*
*
* ACCURACY :
*
* Absolute error :
* arithmetic domain # trials peak rms
* DEC 0 , 30 10000 8 . 6 e - 17 1 . 3 e - 17
* IEEE 0 , 30 30000 1 . 0 e - 15 1 . 3 e - 16
*
* ( error criterion relative when | y1 | > 1 ) .
*
*/
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 1989 , 2000 by Stephen L . Moshier
*/
/*
# define PIO4 . 78539816339744830962
# define THPIO4 2 . 35619449019234492885
# define SQ2OPI . 79788456080286535588
*/
#include "mconf.h"
#ifdef UNK
static double RP[4 ] = {
-8 .99971225705559398224 E8,
4 .52228297998194034323 E11,
-7 .27494245221818276015 E13,
3 .68295732863852883286 E15,
};
static double RQ[8 ] = {
/* 1.00000000000000000000E0,*/
6 .20836478118054335476 E2,
2 .56987256757748830383 E5,
8 .35146791431949253037 E7,
2 .21511595479792499675 E10,
4 .74914122079991414898 E12,
7 .84369607876235854894 E14,
8 .95222336184627338078 E16,
5 .32278620332680085395 E18,
};
#endif
#ifdef DEC
static unsigned short RP[16 ] = {
0147526 ,0110742 ,0063322 ,0077052 ,
0051722 ,0112720 ,0065034 ,0061530 ,
0153604 ,0052227 ,0033147 ,0105650 ,
0055121 ,0055025 ,0032276 ,0022015 ,
};
static unsigned short RQ[32 ] = {
/*0040200,0000000,0000000,0000000,*/
0042433 ,0032610 ,0155604 ,0033473 ,
0044572 ,0173320 ,0067270 ,0006616 ,
0046637 ,0045246 ,0162225 ,0006606 ,
0050645 ,0004773 ,0157577 ,0053004 ,
0052612 ,0033734 ,0001667 ,0176501 ,
0054462 ,0054121 ,0173147 ,0121367 ,
0056237 ,0002777 ,0121451 ,0176007 ,
0057623 ,0136253 ,0131601 ,0044710 ,
};
#endif
#ifdef IBMPC
static unsigned short RP[16 ] = {
0 x4fc5,0 x4cda,0 xd23c,0 xc1ca,
0 x8c6b,0 x0d43,0 x52ba,0 x425a,
0 xf175,0 xe6cc,0 x8a92,0 xc2d0,
0 xc482,0 xa697,0 x2b42,0 x432a,
};
static unsigned short RQ[32 ] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x86e7,0 x1b70,0 x66b1,0 x4083,
0 x01b2,0 x0dd7,0 x5eda,0 x410f,
0 xa1b1,0 xdc92,0 xe954,0 x4193,
0 xeac1,0 x7bef,0 xa13f,0 x4214,
0 xffa8,0 x8076,0 x46fb,0 x4291,
0 xf45f,0 x3ecc,0 x4b0a,0 x4306,
0 x3f81,0 xf465,0 xe0bf,0 x4373,
0 x2939,0 x7670,0 x7795,0 x43d2,
};
#endif
#ifdef MIEEE
static unsigned short RP[16 ] = {
0 xc1ca,0 xd23c,0 x4cda,0 x4fc5,
0 x425a,0 x52ba,0 x0d43,0 x8c6b,
0 xc2d0,0 x8a92,0 xe6cc,0 xf175,
0 x432a,0 x2b42,0 xa697,0 xc482,
};
static unsigned short RQ[32 ] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x4083,0 x66b1,0 x1b70,0 x86e7,
0 x410f,0 x5eda,0 x0dd7,0 x01b2,
0 x4193,0 xe954,0 xdc92,0 xa1b1,
0 x4214,0 xa13f,0 x7bef,0 xeac1,
0 x4291,0 x46fb,0 x8076,0 xffa8,
0 x4306,0 x4b0a,0 x3ecc,0 xf45f,
0 x4373,0 xe0bf,0 xf465,0 x3f81,
0 x43d2,0 x7795,0 x7670,0 x2939,
};
#endif
#ifdef UNK
static double PP[7 ] = {
7 .62125616208173112003 E-4 ,
7 .31397056940917570436 E-2 ,
1 .12719608129684925192 E0,
5 .11207951146807644818 E0,
8 .42404590141772420927 E0,
5 .21451598682361504063 E0,
1 .00000000000000000254 E0,
};
static double PQ[7 ] = {
5 .71323128072548699714 E-4 ,
6 .88455908754495404082 E-2 ,
1 .10514232634061696926 E0,
5 .07386386128601488557 E0,
8 .39985554327604159757 E0,
5 .20982848682361821619 E0,
9 .99999999999999997461 E-1 ,
};
#endif
#ifdef DEC
static unsigned short PP[28 ] = {
0035507 ,0144542 ,0061543 ,0024326 ,
0037225 ,0145105 ,0017766 ,0022661 ,
0040220 ,0043766 ,0010254 ,0133255 ,
0040643 ,0113047 ,0142611 ,0151521 ,
0041006 ,0144344 ,0055351 ,0074261 ,
0040646 ,0156520 ,0120574 ,0006416 ,
0040200 ,0000000 ,0000000 ,0000000 ,
};
static unsigned short PQ[28 ] = {
0035425 ,0142330 ,0115041 ,0165514 ,
0037214 ,0177352 ,0145105 ,0052026 ,
0040215 ,0072515 ,0141207 ,0073255 ,
0040642 ,0056427 ,0137222 ,0106405 ,
0041006 ,0062716 ,0166427 ,0165450 ,
0040646 ,0133352 ,0035425 ,0123304 ,
0040200 ,0000000 ,0000000 ,0000000 ,
};
#endif
#ifdef IBMPC
static unsigned short PP[28 ] = {
0 x651b,0 x4c6c,0 xf92c,0 x3f48,
0 xc4b6,0 xa3fe,0 xb948,0 x3fb2,
0 x96d6,0 xc215,0 x08fe,0 x3ff2,
0 x3a6a,0 xf8b1,0 x72c4,0 x4014,
0 x2f16,0 x8b5d,0 xd91c,0 x4020,
0 x81a2,0 x142f,0 xdbaa,0 x4014,
0 x0000,0 x0000,0 x0000,0 x3ff0,
};
static unsigned short PQ[28 ] = {
0 x3d69,0 x1344,0 xb89b,0 x3f42,
0 xaa83,0 x5948,0 x9fdd,0 x3fb1,
0 xeed6,0 xb850,0 xaea9,0 x3ff1,
0 x51a1,0 xf7d2,0 x4ba2,0 x4014,
0 xfd65,0 xdda2,0 xccb9,0 x4020,
0 xb4d9,0 x4762,0 xd6dd,0 x4014,
0 x0000,0 x0000,0 x0000,0 x3ff0,
};
#endif
#ifdef MIEEE
static unsigned short PP[28 ] = {
0 x3f48,0 xf92c,0 x4c6c,0 x651b,
0 x3fb2,0 xb948,0 xa3fe,0 xc4b6,
0 x3ff2,0 x08fe,0 xc215,0 x96d6,
0 x4014,0 x72c4,0 xf8b1,0 x3a6a,
0 x4020,0 xd91c,0 x8b5d,0 x2f16,
0 x4014,0 xdbaa,0 x142f,0 x81a2,
0 x3ff0,0 x0000,0 x0000,0 x0000,
};
static unsigned short PQ[28 ] = {
0 x3f42,0 xb89b,0 x1344,0 x3d69,
0 x3fb1,0 x9fdd,0 x5948,0 xaa83,
0 x3ff1,0 xaea9,0 xb850,0 xeed6,
0 x4014,0 x4ba2,0 xf7d2,0 x51a1,
0 x4020,0 xccb9,0 xdda2,0 xfd65,
0 x4014,0 xd6dd,0 x4762,0 xb4d9,
0 x3ff0,0 x0000,0 x0000,0 x0000,
};
#endif
#ifdef UNK
static double QP[8 ] = {
5 .10862594750176621635 E-2 ,
4 .98213872951233449420 E0,
7 .58238284132545283818 E1,
3 .66779609360150777800 E2,
7 .10856304998926107277 E2,
5 .97489612400613639965 E2,
2 .11688757100572135698 E2,
2 .52070205858023719784 E1,
};
static double QQ[7 ] = {
/* 1.00000000000000000000E0,*/
7 .42373277035675149943 E1,
1 .05644886038262816351 E3,
4 .98641058337653607651 E3,
9 .56231892404756170795 E3,
7 .99704160447350683650 E3,
2 .82619278517639096600 E3,
3 .36093607810698293419 E2,
};
#endif
#ifdef DEC
static unsigned short QP[32 ] = {
0037121 ,0037723 ,0055605 ,0151004 ,
0040637 ,0066656 ,0031554 ,0077264 ,
0041627 ,0122714 ,0153170 ,0161466 ,
0042267 ,0061712 ,0036520 ,0140145 ,
0042461 ,0133315 ,0131573 ,0071176 ,
0042425 ,0057525 ,0147500 ,0013201 ,
0042123 ,0130122 ,0061245 ,0154131 ,
0041311 ,0123772 ,0064254 ,0172650 ,
};
static unsigned short QQ[28 ] = {
/*0040200,0000000,0000000,0000000,*/
0041624 ,0074603 ,0002112 ,0101670 ,
0042604 ,0007135 ,0010162 ,0175565 ,
0043233 ,0151510 ,0157757 ,0172010 ,
0043425 ,0064506 ,0112006 ,0104276 ,
0043371 ,0164125 ,0032271 ,0164242 ,
0043060 ,0121425 ,0122750 ,0136013 ,
0042250 ,0005773 ,0053472 ,0146267 ,
};
#endif
#ifdef IBMPC
static unsigned short QP[32 ] = {
0 xba40,0 x6b70,0 x27fa,0 x3faa,
0 x8fd6,0 xc66d,0 xedb5,0 x4013,
0 x1c67,0 x9acf,0 xf4b9,0 x4052,
0 x180d,0 x47aa,0 xec79,0 x4076,
0 x6e50,0 xb66f,0 x36d9,0 x4086,
0 x02d0,0 xb9e8,0 xabea,0 x4082,
0 xbb0b,0 x4c54,0 x760a,0 x406a,
0 x9eb5,0 x4d15,0 x34ff,0 x4039,
};
static unsigned short QQ[28 ] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x5077,0 x6089,0 x8f30,0 x4052,
0 x5f6f,0 xa20e,0 x81cb,0 x4090,
0 xfe81,0 x1bfd,0 x7a69,0 x40b3,
0 xd118,0 xd280,0 xad28,0 x40c2,
0 x3d14,0 xa697,0 x3d0a,0 x40bf,
0 x1781,0 xb4bd,0 x1462,0 x40a6,
0 x5997,0 x6ae7,0 x017f,0 x4075,
};
#endif
#ifdef MIEEE
static unsigned short QP[32 ] = {
0 x3faa,0 x27fa,0 x6b70,0 xba40,
0 x4013,0 xedb5,0 xc66d,0 x8fd6,
0 x4052,0 xf4b9,0 x9acf,0 x1c67,
0 x4076,0 xec79,0 x47aa,0 x180d,
0 x4086,0 x36d9,0 xb66f,0 x6e50,
0 x4082,0 xabea,0 xb9e8,0 x02d0,
0 x406a,0 x760a,0 x4c54,0 xbb0b,
0 x4039,0 x34ff,0 x4d15,0 x9eb5,
};
static unsigned short QQ[28 ] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x4052,0 x8f30,0 x6089,0 x5077,
0 x4090,0 x81cb,0 xa20e,0 x5f6f,
0 x40b3,0 x7a69,0 x1bfd,0 xfe81,
0 x40c2,0 xad28,0 xd280,0 xd118,
0 x40bf,0 x3d0a,0 xa697,0 x3d14,
0 x40a6,0 x1462,0 xb4bd,0 x1781,
0 x4075,0 x017f,0 x6ae7,0 x5997,
};
#endif
#ifdef UNK
static double YP[6 ] = {
1 .26320474790178026440 E9,
-6 .47355876379160291031 E11,
1 .14509511541823727583 E14,
-8 .12770255501325109621 E15,
2 .02439475713594898196 E17,
-7 .78877196265950026825 E17,
};
static double YQ[8 ] = {
/* 1.00000000000000000000E0,*/
5 .94301592346128195359 E2,
2 .35564092943068577943 E5,
7 .34811944459721705660 E7,
1 .87601316108706159478 E10,
3 .88231277496238566008 E12,
6 .20557727146953693363 E14,
6 .87141087355300489866 E16,
3 .97270608116560655612 E18,
};
#endif
#ifdef DEC
static unsigned short YP[24 ] = {
0047626 ,0112763 ,0013715 ,0133045 ,
0152026 ,0134552 ,0142033 ,0024411 ,
0053720 ,0045245 ,0102210 ,0077565 ,
0155347 ,0000321 ,0136415 ,0102031 ,
0056463 ,0146550 ,0055633 ,0032605 ,
0157054 ,0171012 ,0167361 ,0054265 ,
};
static unsigned short YQ[32 ] = {
/*0040200,0000000,0000000,0000000,*/
0042424 ,0111515 ,0044773 ,0153014 ,
0044546 ,0005405 ,0171307 ,0075774 ,
0046614 ,0023575 ,0047105 ,0063556 ,
0050613 ,0143034 ,0101533 ,0156026 ,
0052541 ,0175367 ,0166514 ,0114257 ,
0054415 ,0014466 ,0134350 ,0171154 ,
0056164 ,0017436 ,0025075 ,0022101 ,
0057534 ,0103614 ,0103663 ,0121772 ,
};
#endif
#ifdef IBMPC
static unsigned short YP[24 ] = {
0 xb6c5,0 x62f9,0 xd2be,0 x41d2,
0 x6521,0 x5883,0 xd72d,0 xc262,
0 x0fef,0 xb091,0 x0954,0 x42da,
0 xb083,0 x37a1,0 xe01a,0 xc33c,
0 x66b1,0 x0b73,0 x79ad,0 x4386,
0 x2b17,0 x5dde,0 x9e41,0 xc3a5,
};
static unsigned short YQ[32 ] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x7ac2,0 xa93f,0 x9269,0 x4082,
0 xef7f,0 xbe58,0 xc160,0 x410c,
0 xacee,0 xa9c8,0 x84ef,0 x4191,
0 x7b83,0 x906b,0 x78c3,0 x4211,
0 x9316,0 xfda9,0 x3f5e,0 x428c,
0 x1e4e,0 xd71d,0 xa326,0 x4301,
0 xa488,0 xc547,0 x83e3,0 x436e,
0 x747f,0 x90f6,0 x90f1,0 x43cb,
};
#endif
#ifdef MIEEE
static unsigned short YP[24 ] = {
0 x41d2,0 xd2be,0 x62f9,0 xb6c5,
0 xc262,0 xd72d,0 x5883,0 x6521,
0 x42da,0 x0954,0 xb091,0 x0fef,
0 xc33c,0 xe01a,0 x37a1,0 xb083,
0 x4386,0 x79ad,0 x0b73,0 x66b1,
0 xc3a5,0 x9e41,0 x5dde,0 x2b17,
};
static unsigned short YQ[32 ] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x4082,0 x9269,0 xa93f,0 x7ac2,
0 x410c,0 xc160,0 xbe58,0 xef7f,
0 x4191,0 x84ef,0 xa9c8,0 xacee,
0 x4211,0 x78c3,0 x906b,0 x7b83,
0 x428c,0 x3f5e,0 xfda9,0 x9316,
0 x4301,0 xa326,0 xd71d,0 x1e4e,
0 x436e,0 x83e3,0 xc547,0 xa488,
0 x43cb,0 x90f1,0 x90f6,0 x747f,
};
#endif
#ifdef UNK
static double Z1 = 1 .46819706421238932572 E1;
static double Z2 = 4 .92184563216946036703 E1;
#endif
#ifdef DEC
static unsigned short DZ1[] = {0041152 ,0164532 ,0006114 ,0010540 };
static unsigned short DZ2[] = {0041504 ,0157663 ,0001625 ,0020621 };
#define Z1 (*(double *)DZ1)
#define Z2 (*(double *)DZ2)
#endif
#ifdef IBMPC
static unsigned short DZ1[] = {0 x822c,0 x4189,0 x5d2b,0 x402d};
static unsigned short DZ2[] = {0 xa432,0 x6072,0 x9bf6,0 x4048};
#define Z1 (*(double *)DZ1)
#define Z2 (*(double *)DZ2)
#endif
#ifdef MIEEE
static unsigned short DZ1[] = {0 x402d,0 x5d2b,0 x4189,0 x822c};
static unsigned short DZ2[] = {0 x4048,0 x9bf6,0 x6072,0 xa432};
#define Z1 (*(double *)DZ1)
#define Z2 (*(double *)DZ2)
#endif
#ifdef ANSIPROT
extern double polevl ( double , void *, int );
extern double p1evl ( double , void *, int );
extern double log ( double );
extern double sin ( double );
extern double cos ( double );
extern double sqrt ( double );
double j1 ( double );
#else
double polevl(), p1evl(), log(), sin(), cos(), sqrt();
double j1();
#endif
extern double TWOOPI, THPIO4, SQ2OPI;
double j1(x)
double x;
{
double w, z, p, q, xn;
w = x;
if ( x < 0 )
w = -x;
if ( w <= 5 .0 )
{
z = x * x;
w = polevl( z, RP, 3 ) / p1evl( z, RQ, 8 );
w = w * x * (z - Z1) * (z - Z2);
return ( w );
}
w = 5 .0 /x;
z = w * w;
p = polevl( z, PP, 6 )/polevl( z, PQ, 6 );
q = polevl( z, QP, 7 )/p1evl( z, QQ, 7 );
xn = x - THPIO4;
p = p * cos(xn) - w * q * sin(xn);
return ( p * SQ2OPI / sqrt(x) );
}
extern double MAXNUM;
double y1(x)
double x;
{
double w, z, p, q, xn;
if ( x <= 5 .0 )
{
if ( x <= 0 .0 )
{
mtherr( "y1" , DOMAIN );
return ( -MAXNUM );
}
z = x * x;
w = x * (polevl( z, YP, 5 ) / p1evl( z, YQ, 8 ));
w += TWOOPI * ( j1(x) * log(x) - 1 .0 /x );
return ( w );
}
w = 5 .0 /x;
z = w * w;
p = polevl( z, PP, 6 )/polevl( z, PQ, 6 );
q = polevl( z, QP, 7 )/p1evl( z, QQ, 7 );
xn = x - THPIO4;
p = p * sin(xn) + w * q * cos(xn);
return ( p * SQ2OPI / sqrt(x) );
}
Messung V0.5 in Prozent C=97 H=100 G=98
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-17)
¤
*© Formatika GbR, Deutschland