longdouble logl(x) longdouble x;
{ longdouble y, z; int e;
/* Test for domain */ if( x <= 0.0L )
{ if( x == 0.0L )
mtherr( fname, SING ); else
mtherr( fname, DOMAIN ); return( MINLOGL );
}
/* separate mantissa from exponent */
/* Note, frexp is used so that denormal numbers *willbehandledproperly.
*/
x = frexpl( x, &e );
/* logarithm using log(x) = z + z^3 P(z^2)/Q(z^2), *wherez=2(x-1)/x+1)
*/ if( (e > 2) || (e < -2) )
{ if( x < SQRTH )
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
z = x - 0.5L;
y = 0.5L * z + 0.5L;
} else
{ /* 2 (x-1)/(x+1) */
z = x - 0.5L;
z -= 0.5L;
y = 0.5L * x + 0.5L;
}
x = z / y;
z = x*x;
z = x * ( z * polevll( z, R, 5 ) / p1evll( z, S, 6 ) );
z = z + e * C2;
z = z + x;
z = z + e * C1; return( z );
}
/* logarithm using log(1+x) = x - .5x**2 + x**3 P(x)/Q(x) */
if( x < SQRTH )
{
e -= 1;
x = ldexpl( x, 1 ) - 1.0L; /* 2x - 1 */
} else
{
x = x - 1.0L;
}
z = x*x;
y = x * ( z * polevll( x, P, 12 ) / p1evll( x, Q, 12 ) );
y = y + e * C2;
z = y - ldexpl( z, -1 ); /* y - 0.5 * z */ /* Note, the sum of above terms does not exceed x/4, *soitcontributesatmostabout1/4lsbtotheerror.
*/
z = z + x;
z = z + e * C1; /* This sum has an error of 1/2 lsb. */ return( z );
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-14)
¤
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.