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

Quelle  asinh.c

  Sprache: C
 

/* asinh.c
 *
 * Inverse hyperbolic sine
 *
 *
 *
 * SYNOPSIS:
 *
 * double x, y, asinh();
 *
 * y = asinh( x );
 *
 *
 *
 * DESCRIPTION:
 *
 * Returns inverse hyperbolic sine of argument.
 *
 * If |x| < 0.5, the function is approximated by a rational
 * form  x + x**3 P(x)/Q(x).  Otherwise,
 *
 *     asinh(x) = log( x + sqrt(1 + x*x) ).
 *
 *
 *
 * ACCURACY:
 *
 *                      Relative error:
 * arithmetic   domain     # trials      peak         rms
 *    DEC      -3,3         75000       4.6e-17     1.1e-17
 *    IEEE     -1,1         30000       3.7e-16     7.8e-17
 *    IEEE      1,3         30000       2.5e-16     6.7e-17
 *
 */


/* asinh.c */

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


#include "mconf.h"

#ifdef UNK
static double P[] = {-4.33231683752342103572E-3, -5.91750212056387121207E-1,
                     -4.37390226194356683570E0, -9.09030533308377316566E0,
                     -5.56682227230859640450E0};
static double Q[] = {
    /* 1.00000000000000000000E0,*/
    1.28757002067426453537E1, 4.86042483805291788324E1,
    6.95722521337257608734E1, 3.34009336338516356383E1};
#endif

#ifdef DEC
static unsigned short P[] = {01362150173033011041001054750140027,
                             00763610020056016452001406130173401,
                             01601360053142014102100707440000503,
                             01762610140662002155000731060133351};
static unsigned short Q[] = {
    /* 0040200,0000000,0000000,0000000,*/
    00411160001336003412001730540041502006530000131440021231,
    00416130022376003551601530630041405011521600542650004557};
#endif

#ifdef IBMPC
static unsigned short P[] = {0x1168, 0x7221, 0xbec3, 0xbf71, 0xdd2a,
                             0x2405, 0xef9e, 0xbfe2, 0xcacc, 0x3c0b,
                             0x7ee0, 0xc011, 0x7f96, 0x8028, 0x2e3c,
                             0xc022, 0xd6dd, 0x0ec8, 0x446d, 0xc016};
static unsigned short Q[] = {
    /* 0x0000,0x0000,0x0000,0x3ff0,*/
    0x1ec5, 0xc70a, 0xc05b, 0x4029, 0x8453, 0x02cc, 0x4d58, 0x4048,
    0xdac6, 0xc769, 0x649f, 0x4051, 0xa12e, 0xcb16, 0xb351, 0x4040};
#endif

#ifdef MIEEE
static unsigned short P[] = {0xbf71, 0xbec3, 0x7221, 0x1168, 0xbfe2,
                             0xef9e, 0x2405, 0xdd2a, 0xc011, 0x7ee0,
                             0x3c0b, 0xcacc, 0xc022, 0x2e3c, 0x8028,
                             0x7f96, 0xc016, 0x446d, 0x0ec8, 0xd6dd};
static unsigned short Q[] = {0x4029, 0xc05b, 0xc70a, 0x1ec5, 0x4048, 0x4d58,
                             0x02cc, 0x8453, 0x4051, 0x649f, 0xc769, 0xdac6,
                             0x4040, 0xb351, 0xcb16, 0xa12e};
#endif

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

double asinh(xx) double xx;
{
  double a, z, x;
  int sign;

#ifdef MINUSZERO
  if (xx == 0.0)
    return (xx);
#endif
  if (xx < 0.0) {
    sign = -1;
    x = -xx;
  } else {
    sign = 1;
    x = xx;
  }

  if (x > 1.0e8) {
#ifdef INFINITIES
    if (x == INFINITY)
      return (xx);
#endif
    return (sign * (log(x) + LOGE2));
  }

  z = x * x;
  if (x < 0.5) {
    a = (polevl(z, P, 4) / p1evl(z, Q, 4)) * z;
    a = a * x + x;
    if (sign < 0)
      a = -a;
    return (a);
  }

  a = sqrt(z + 1.0);
  return (sign * log(x + a));
}

Messung V0.5 in Prozent
C=95 H=90 G=92

¤ Dauer der Verarbeitung: 0.3 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.