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

Quelle  ellpe.c

  Sprache: C
 

/* ellpe.c
 *
 * Complete elliptic integral of the second kind
 *
 *
 *
 * SYNOPSIS:
 *
 * double m1, y, ellpe();
 *
 * y = ellpe( m1 );
 *
 *
 *
 * DESCRIPTION:
 *
 * Approximates the integral
 *
 *
 *            pi/2
 *             -
 *            | |                 2
 * E(m)  =    |    sqrt( 1 - m sin t ) dt
 *          | |
 *           -
 *            0
 *
 * Where m = 1 - m1, using the approximation
 *
 *      P(x)  -  x log x Q(x).
 *
 * Though there are no singularities, the argument m1 is used
 * rather than m for compatibility with ellpk().
 *
 * E(1) = 1; E(0) = pi/2.
 *
 *
 * ACCURACY:
 *
 *                      Relative error:
 * arithmetic   domain     # trials      peak         rms
 *    DEC        0, 1       13000       3.1e-17     9.4e-18
 *    IEEE       0, 1       10000       2.1e-16     7.3e-17
 *
 *
 * ERROR MESSAGES:
 *
 *   message         condition      value returned
 * ellpe domain      x<0, x>1            0.0
 *
 */


/* ellpe.c */

/* Elliptic integral of second kind */

/*
Cephes Math Library, Release 2.8: June, 2000
Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier
*/


#include "mconf.h"

#ifdef UNK
static double P[] = {1.53552577301013293365E-42.50888492163602060990E-3,
                     8.68786816565889628429E-31.07350949056076193403E-2,
                     7.77395492516787092951E-37.58395289413514708519E-3,
                     1.15688436810574127319E-22.18317996015557253103E-2,
                     5.68051945617860553470E-24.43147180560990850618E-1,
                     1.00000000000000000299E0};
static double Q[] = {3.27954898576485872656E-51.00962792679356715133E-3,
                     6.50609489976927491433E-31.68862163993311317300E-2,
                     2.61769742454493659583E-23.34833904888224918614E-2,
                     4.27180926518931511717E-25.85936634471101055642E-2,
                     9.37499997197644278445E-22.49999999999888314361E-1};
#endif

#ifdef DEC
static unsigned short P[] = {
    00350410001364014157201175550036044006603201300270033404,
    00364160053617006445601026320036457016110000611770122612,
    00363760136251001240301241620036370010131601517150131613,
    00364750105477005031701332720036662015423200246450171552,
    00371500126220004705400300640037742016205701676450165612,
    0040200000000000000000000000};
static unsigned short Q[] = {
    00344110106743011577100554620035604005257501551710045540,
    00363250030424006433201677560036612005236600630060115175,
    00367260070430000453301246540037011002274100306750030711,
    00370560174452012706201321220037157017775001420410072523,
    00372770177777017313700026270037577017777701777770101101};
#endif

#ifdef IBMPC
static unsigned short P[] = {
    0x53ee, 0x986f, 0x205e, 0x3f24, 0xe6e0, 0x5602, 0x8d83, 0x3f64, 0xd0b3,
    0xed25, 0xcaf1, 0x3f81, 0xf4b1, 0x0c4f, 0xfc48, 0x3f85, 0x750e, 0x22a0,
    0xd795, 0x3f7f, 0xb671, 0xda79, 0x1059, 0x3f7f, 0xf6d7, 0xea19, 0xb167,
    0x3f87, 0xbe6d, 0x4534, 0x5b13, 0x3f96, 0x8607, 0x09c5, 0x1592, 0x3fad,
    0xbd71, 0xfdf4, 0x5c85, 0x3fdc, 0x0000, 0x0000, 0x0000, 0x3ff0};
static unsigned short Q[] = {
    0x2b66, 0x737f, 0x31bc, 0x3f01, 0x296c, 0xbb4f, 0x8aaf, 0x3f50,
    0x5dfe, 0x8d1b, 0xa622, 0x3f7a, 0xd350, 0xccc0, 0x4a9e, 0x3f91,
    0x7535, 0x012b, 0xce23, 0x3f9a, 0xa639, 0x2637, 0x24bc, 0x3fa1,
    0x568a, 0x55c6, 0xdf25, 0x3fa5, 0x2eaa, 0x1884, 0xfffd, 0x3fad,
    0xe0b3, 0xfecb, 0xffff, 0x3fb7, 0xf048, 0xffff, 0xffff, 0x3fcf};
#endif

#ifdef MIEEE
static unsigned short P[] = {
    0x3f24, 0x205e, 0x986f, 0x53ee, 0x3f64, 0x8d83, 0x5602, 0xe6e0, 0x3f81,
    0xcaf1, 0xed25, 0xd0b3, 0x3f85, 0xfc48, 0x0c4f, 0xf4b1, 0x3f7f, 0xd795,
    0x22a0, 0x750e, 0x3f7f, 0x1059, 0xda79, 0xb671, 0x3f87, 0xb167, 0xea19,
    0xf6d7, 0x3f96, 0x5b13, 0x4534, 0xbe6d, 0x3fad, 0x1592, 0x09c5, 0x8607,
    0x3fdc, 0x5c85, 0xfdf4, 0xbd71, 0x3ff0, 0x0000, 0x0000, 0x0000};
static unsigned short Q[] = {
    0x3f01, 0x31bc, 0x737f, 0x2b66, 0x3f50, 0x8aaf, 0xbb4f, 0x296c,
    0x3f7a, 0xa622, 0x8d1b, 0x5dfe, 0x3f91, 0x4a9e, 0xccc0, 0xd350,
    0x3f9a, 0xce23, 0x012b, 0x7535, 0x3fa1, 0x24bc, 0x2637, 0xa639,
    0x3fa5, 0xdf25, 0x55c6, 0x568a, 0x3fad, 0xfffd, 0x1884, 0x2eaa,
    0x3fb7, 0xffff, 0xfecb, 0xe0b3, 0x3fcf, 0xffff, 0xffff, 0xf048};
#endif

#ifdef ANSIPROT
extern double polevl(doublevoid *, int);
extern double log(double);
#else
double polevl(), log();
#endif

double ellpe(x) double x;
{

  if ((x <= 0.0) || (x > 1.0)) {
    if (x == 0.0)
      return (1.0);
    mtherr("ellpe", DOMAIN);
    return (0.0);
  }
  return (polevl(x, P, 10) - log(x) * (x * polevl(x, Q, 9)));
}

Messung V0.5 in Prozent
C=93 H=93 G=92

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© 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.