Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Cephes/   (Cephes Mathematical Library ©)  Datei vom 9.5.2026 mit Größe 12 kB image not shown  

Quelle  j1.c

  Sprache: C
 

/* 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.0e-17     1.1e-17
 *    IEEE      0, 30       30000       2.6e-16     1.1e-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.6e-17     1.3e-17
 *    IEEE      0, 30       30000       1.0e-15     1.3e-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.99971225705559398224E8,
    4.52228297998194034323E11,
    -7.27494245221818276015E13,
    3.68295732863852883286E15,
};
static double RQ[8] = {
    /* 1.00000000000000000000E0,*/
    6.20836478118054335476E2,  2.56987256757748830383E5,
    8.35146791431949253037E7,  2.21511595479792499675E10,
    4.74914122079991414898E12, 7.84369607876235854894E14,
    8.95222336184627338078E16, 5.32278620332680085395E18,
};
#endif
#ifdef DEC
static unsigned short RP[16] = {
    01475260110742006332200770520051722011272000650340061530,
    01536040052227003314701056500055121005502500322760022015,
};
static unsigned short RQ[32] = {
    /*0040200,0000000,0000000,0000000,*/
    00424330032610015560400334730044572017332000672700006616,
    00466370045246016222500066060050645000477301575770053004,
    00526120033734000166701765010054462005412101731470121367,
    00562370002777012145101760070057623013625301316010044710,
};
#endif
#ifdef IBMPC
static unsigned short RP[16] = {
    0x4fc5, 0x4cda, 0xd23c, 0xc1ca, 0x8c6b, 0x0d43, 0x52ba, 0x425a,
    0xf175, 0xe6cc, 0x8a92, 0xc2d0, 0xc482, 0xa697, 0x2b42, 0x432a,
};
static unsigned short RQ[32] = {
    /*0x0000,0x0000,0x0000,0x3ff0,*/
    0x86e7, 0x1b70, 0x66b1, 0x4083, 0x01b2, 0x0dd7, 0x5eda, 0x410f,
    0xa1b1, 0xdc92, 0xe954, 0x4193, 0xeac1, 0x7bef, 0xa13f, 0x4214,
    0xffa8, 0x8076, 0x46fb, 0x4291, 0xf45f, 0x3ecc, 0x4b0a, 0x4306,
    0x3f81, 0xf465, 0xe0bf, 0x4373, 0x2939, 0x7670, 0x7795, 0x43d2,
};
#endif
#ifdef MIEEE
static unsigned short RP[16] = {
    0xc1ca, 0xd23c, 0x4cda, 0x4fc5, 0x425a, 0x52ba, 0x0d43, 0x8c6b,
    0xc2d0, 0x8a92, 0xe6cc, 0xf175, 0x432a, 0x2b42, 0xa697, 0xc482,
};
static unsigned short RQ[32] = {
    /*0x3ff0,0x0000,0x0000,0x0000,*/
    0x4083, 0x66b1, 0x1b70, 0x86e7, 0x410f, 0x5eda, 0x0dd7, 0x01b2,
    0x4193, 0xe954, 0xdc92, 0xa1b1, 0x4214, 0xa13f, 0x7bef, 0xeac1,
    0x4291, 0x46fb, 0x8076, 0xffa8, 0x4306, 0x4b0a, 0x3ecc, 0xf45f,
    0x4373, 0xe0bf, 0xf465, 0x3f81, 0x43d2, 0x7795, 0x7670, 0x2939,
};
#endif

#ifdef UNK
static double PP[7] = {
    7.62125616208173112003E-47.31397056940917570436E-2,
    1.12719608129684925192E0,  5.11207951146807644818E0,
    8.42404590141772420927E0,  5.21451598682361504063E0,
    1.00000000000000000254E0,
};
static double PQ[7] = {
    5.71323128072548699714E-46.88455908754495404082E-2,
    1.10514232634061696926E0,  5.07386386128601488557E0,
    8.39985554327604159757E0,  5.20982848682361821619E0,
    9.99999999999999997461E-1,
};
#endif
#ifdef DEC
static unsigned short PP[28] = {
    0035507014454200615430024326003722501451050017766,
    0022661004022000437660010254013325500406430113047,
    0142611015152100410060144344005535100742610040646,
    0156520012057400064160040200000000000000000000000,
};
static unsigned short PQ[28] = {
    0035425014233001150410165514003721401773520145105,
    0052026004021500725150141207007325500406420056427,
    0137222010640500410060062716016642701654500040646,
    0133352003542501233040040200000000000000000000000,
};
#endif
#ifdef IBMPC
static unsigned short PP[28] = {
    0x651b, 0x4c6c, 0xf92c, 0x3f48, 0xc4b6, 0xa3fe, 0xb948,
    0x3fb2, 0x96d6, 0xc215, 0x08fe, 0x3ff2, 0x3a6a, 0xf8b1,
    0x72c4, 0x4014, 0x2f16, 0x8b5d, 0xd91c, 0x4020, 0x81a2,
    0x142f, 0xdbaa, 0x4014, 0x0000, 0x0000, 0x0000, 0x3ff0,
};
static unsigned short PQ[28] = {
    0x3d69, 0x1344, 0xb89b, 0x3f42, 0xaa83, 0x5948, 0x9fdd,
    0x3fb1, 0xeed6, 0xb850, 0xaea9, 0x3ff1, 0x51a1, 0xf7d2,
    0x4ba2, 0x4014, 0xfd65, 0xdda2, 0xccb9, 0x4020, 0xb4d9,
    0x4762, 0xd6dd, 0x4014, 0x0000, 0x0000, 0x0000, 0x3ff0,
};
#endif
#ifdef MIEEE
static unsigned short PP[28] = {
    0x3f48, 0xf92c, 0x4c6c, 0x651b, 0x3fb2, 0xb948, 0xa3fe,
    0xc4b6, 0x3ff2, 0x08fe, 0xc215, 0x96d6, 0x4014, 0x72c4,
    0xf8b1, 0x3a6a, 0x4020, 0xd91c, 0x8b5d, 0x2f16, 0x4014,
    0xdbaa, 0x142f, 0x81a2, 0x3ff0, 0x0000, 0x0000, 0x0000,
};
static unsigned short PQ[28] = {
    0x3f42, 0xb89b, 0x1344, 0x3d69, 0x3fb1, 0x9fdd, 0x5948,
    0xaa83, 0x3ff1, 0xaea9, 0xb850, 0xeed6, 0x4014, 0x4ba2,
    0xf7d2, 0x51a1, 0x4020, 0xccb9, 0xdda2, 0xfd65, 0x4014,
    0xd6dd, 0x4762, 0xb4d9, 0x3ff0, 0x0000, 0x0000, 0x0000,
};
#endif

#ifdef UNK
static double QP[8] = {
    5.10862594750176621635E-24.98213872951233449420E0,
    7.58238284132545283818E1,  3.66779609360150777800E2,
    7.10856304998926107277E2,  5.97489612400613639965E2,
    2.11688757100572135698E2,  2.52070205858023719784E1,
};
static double QQ[7] = {
    /* 1.00000000000000000000E0,*/
    7.42373277035675149943E1, 1.05644886038262816351E3,
    4.98641058337653607651E3, 9.56231892404756170795E3,
    7.99704160447350683650E3, 2.82619278517639096600E3,
    3.36093607810698293419E2,
};
#endif
#ifdef DEC
static unsigned short QP[32] = {
    00371210037723005560501510040040637006665600315540077264,
    00416270122714015317001614660042267006171200365200140145,
    00424610133315013157300711760042425005752501475000013201,
    00421230130122006124501541310041311012377200642540172650,
};
static unsigned short QQ[28] = {
    /*0040200,0000000,0000000,0000000,*/
    0041624007460300021120101670004260400071350010162,
    0175565004323301515100157757017201000434250064506,
    0112006010427600433710164125003227101642420043060,
    0121425012275001360130042250000577300534720146267,
};
#endif
#ifdef IBMPC
static unsigned short QP[32] = {
    0xba40, 0x6b70, 0x27fa, 0x3faa, 0x8fd6, 0xc66d, 0xedb5, 0x4013,
    0x1c67, 0x9acf, 0xf4b9, 0x4052, 0x180d, 0x47aa, 0xec79, 0x4076,
    0x6e50, 0xb66f, 0x36d9, 0x4086, 0x02d0, 0xb9e8, 0xabea, 0x4082,
    0xbb0b, 0x4c54, 0x760a, 0x406a, 0x9eb5, 0x4d15, 0x34ff, 0x4039,
};
static unsigned short QQ[28] = {
    /*0x0000,0x0000,0x0000,0x3ff0,*/
    0x5077, 0x6089, 0x8f30, 0x4052, 0x5f6f, 0xa20e, 0x81cb,
    0x4090, 0xfe81, 0x1bfd, 0x7a69, 0x40b3, 0xd118, 0xd280,
    0xad28, 0x40c2, 0x3d14, 0xa697, 0x3d0a, 0x40bf, 0x1781,
    0xb4bd, 0x1462, 0x40a6, 0x5997, 0x6ae7, 0x017f, 0x4075,
};
#endif
#ifdef MIEEE
static unsigned short QP[32] = {
    0x3faa, 0x27fa, 0x6b70, 0xba40, 0x4013, 0xedb5, 0xc66d, 0x8fd6,
    0x4052, 0xf4b9, 0x9acf, 0x1c67, 0x4076, 0xec79, 0x47aa, 0x180d,
    0x4086, 0x36d9, 0xb66f, 0x6e50, 0x4082, 0xabea, 0xb9e8, 0x02d0,
    0x406a, 0x760a, 0x4c54, 0xbb0b, 0x4039, 0x34ff, 0x4d15, 0x9eb5,
};
static unsigned short QQ[28] = {
    /*0x3ff0,0x0000,0x0000,0x0000,*/
    0x4052, 0x8f30, 0x6089, 0x5077, 0x4090, 0x81cb, 0xa20e,
    0x5f6f, 0x40b3, 0x7a69, 0x1bfd, 0xfe81, 0x40c2, 0xad28,
    0xd280, 0xd118, 0x40bf, 0x3d0a, 0xa697, 0x3d14, 0x40a6,
    0x1462, 0xb4bd, 0x1781, 0x4075, 0x017f, 0x6ae7, 0x5997,
};
#endif

#ifdef UNK
static double YP[6] = {
    1.26320474790178026440E9,  -6.47355876379160291031E11,
    1.14509511541823727583E14, -8.12770255501325109621E15,
    2.02439475713594898196E17, -7.78877196265950026825E17,
};
static double YQ[8] = {
    /* 1.00000000000000000000E0,*/
    5.94301592346128195359E2,  2.35564092943068577943E5,
    7.34811944459721705660E7,  1.87601316108706159478E10,
    3.88231277496238566008E12, 6.20557727146953693363E14,
    6.87141087355300489866E16, 3.97270608116560655612E18,
};
#endif
#ifdef DEC
static unsigned short YP[24] = {
    00476260112763001371501330450152026013455201420330024411,
    00537200045245010221000775650155347000032101364150102031,
    00564630146550005563300326050157054017101201673610054265,
};
static unsigned short YQ[32] = {
    /*0040200,0000000,0000000,0000000,*/
    00424240111515004477301530140044546000540501713070075774,
    00466140023575004710500635560050613014303401015330156026,
    00525410175367016651401142570054415001446601343500171154,
    00561640017436002507500221010057534010361401036630121772,
};
#endif
#ifdef IBMPC
static unsigned short YP[24] = {
    0xb6c5, 0x62f9, 0xd2be, 0x41d2, 0x6521, 0x5883, 0xd72d, 0xc262,
    0x0fef, 0xb091, 0x0954, 0x42da, 0xb083, 0x37a1, 0xe01a, 0xc33c,
    0x66b1, 0x0b73, 0x79ad, 0x4386, 0x2b17, 0x5dde, 0x9e41, 0xc3a5,
};
static unsigned short YQ[32] = {
    /*0x0000,0x0000,0x0000,0x3ff0,*/
    0x7ac2, 0xa93f, 0x9269, 0x4082, 0xef7f, 0xbe58, 0xc160, 0x410c,
    0xacee, 0xa9c8, 0x84ef, 0x4191, 0x7b83, 0x906b, 0x78c3, 0x4211,
    0x9316, 0xfda9, 0x3f5e, 0x428c, 0x1e4e, 0xd71d, 0xa326, 0x4301,
    0xa488, 0xc547, 0x83e3, 0x436e, 0x747f, 0x90f6, 0x90f1, 0x43cb,
};
#endif
#ifdef MIEEE
static unsigned short YP[24] = {
    0x41d2, 0xd2be, 0x62f9, 0xb6c5, 0xc262, 0xd72d, 0x5883, 0x6521,
    0x42da, 0x0954, 0xb091, 0x0fef, 0xc33c, 0xe01a, 0x37a1, 0xb083,
    0x4386, 0x79ad, 0x0b73, 0x66b1, 0xc3a5, 0x9e41, 0x5dde, 0x2b17,
};
static unsigned short YQ[32] = {
    /*0x3ff0,0x0000,0x0000,0x0000,*/
    0x4082, 0x9269, 0xa93f, 0x7ac2, 0x410c, 0xc160, 0xbe58, 0xef7f,
    0x4191, 0x84ef, 0xa9c8, 0xacee, 0x4211, 0x78c3, 0x906b, 0x7b83,
    0x428c, 0x3f5e, 0xfda9, 0x9316, 0x4301, 0xa326, 0xd71d, 0x1e4e,
    0x436e, 0x83e3, 0xc547, 0xa488, 0x43cb, 0x90f1, 0x90f6, 0x747f,
};
#endif

#ifdef UNK
static double Z1 = 1.46819706421238932572E1;
static double Z2 = 4.92184563216946036703E1;
#endif

#ifdef DEC
static unsigned short DZ1[] = {0041152016453200061140010540};
static unsigned short DZ2[] = {0041504015766300016250020621};
#define Z1 (*(double *)DZ1)
#define Z2 (*(double *)DZ2)
#endif

#ifdef IBMPC
static unsigned short DZ1[] = {0x822c, 0x4189, 0x5d2b, 0x402d};
static unsigned short DZ2[] = {0xa432, 0x6072, 0x9bf6, 0x4048};
#define Z1 (*(double *)DZ1)
#define Z2 (*(double *)DZ2)
#endif

#ifdef MIEEE
static unsigned short DZ1[] = {0x402d, 0x5d2b, 0x4189, 0x822c};
static unsigned short DZ2[] = {0x4048, 0x9bf6, 0x6072, 0xa432};
#define Z1 (*(double *)DZ1)
#define Z2 (*(double *)DZ2)
#endif

#ifdef ANSIPROT
extern double polevl(doublevoid *, int);
extern double p1evl(doublevoid *, 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=96 H=97 G=96

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.