#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: w_exp.c,v 1.11 2025/08/24 21:37:31 nat Exp $");
#endif
#include "namespace.h"
#include "math.h"
#include "math_private.h"
#ifdef __weak_alias
__weak_alias(exp, _exp)
#endif
#ifndef _IEEE_LIBM
static const double
o_threshold= 7.09782712893383973096e+02,
u_threshold= -7.45133219101941108420e+02;
#endif
double
exp(double x)
{
#ifdef _IEEE_LIBM
return __ieee754_exp(x);
#else
double z;
z = __ieee754_exp(x);
if(_LIB_VERSION == _IEEE_) return z;
if(finite(x)) {
if(x>o_threshold)
return __kernel_standard(x,x,6);
else if(x<u_threshold)
return __kernel_standard(x,x,7);
}
return z;
#endif
}