#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: w_log.c,v 1.11 2024/07/16 14:52:50 riastradh Exp $");
#endif
#include "namespace.h"
#include "math.h"
#include "math_private.h"
#ifndef __HAVE_LONG_DOUBLE
__weak_alias(logl, _logl)
__strong_alias(_logl, _log)
#endif
__weak_alias(log, _log)
double
log(double x)
{
#ifdef _IEEE_LIBM
return __ieee754_log(x);
#else
double z;
z = __ieee754_log(x);
if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z;
if(x==0.0)
return __kernel_standard(x,x,16);
else
return __kernel_standard(x,x,17);
#endif
}