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

Quelle  qatanh.c

  Sprache: C
 

/* qatanh.c
 *
 * Inverse hyperbolic tangent
 *
 *
 *
 * SYNOPSIS:
 *
 * int qatanh( x, y );
 * QELT x[], y[];
 *
 * qatanh( x, y );
 *
 *
 *
 * DESCRIPTION:
 *
 * Returns inverse hyperbolic tangent of argument.
 *
 *        atanh(x) = 0.5 * log( (1+x)/(1-x) ).
 *
 * For very small x, the first few terms of the Taylor series
 * are summed.
 *
 */


/*
Cephes Math Library Release 2.3:  March, 1995
Copyright (C) 1987, 1995 by Stephen L. Moshier
*/


#include "qhead.h"
extern QELT qone[], qtwo[], qthree[];

int qatanh( x, y )
QELT x[], y[];
{
QELT a[NQ], b[NQ], c[NQ];
QELT sign;

qmov( x, a );
sign = a[0];
a[0] = 0;
if( qcmp( a, qone ) >= 0 )
 {
 mtherr( "qatanh", DOMAIN );
 qinfin(y);
 y[0] = sign;
 return 0;
 }
if( ((long)EXPONE - (long)a[1]) >= NBITS/4 )
 {
 /* x + x^3 / 3 + x^5 / 5  */
 qmul( a, a, b );
 qmul( a, b, y ); /* x^3 */

 qmul( b, y, b ); /* x^5 */
 qdiv( qthree, y, y );

 qadd( qthree, qtwo, c );
 qdiv( c, b, b );
 qadd( b, y, y );
 qadd( a, y, y );
 y[0] = sign;
 return 0;
 }
/* 0.5 * log((1+x)/(1-x)) */
qmov( qone, a );
qadd( x, a, a );
qmov( qone, b );
qsub( x, b, b );
qdiv( b, a, a );
qlog( a, y );
y[1] -= 1;
return 0;
}

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-06-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.