enum matherr {
	KMATHERR_ACOS = 1,			/* acos(|x|>1) */
	KMATHERR_ASIN,				/* asin(|x|>1) */
	KMATHERR_ATAN2,				/* atan2(+-0,+-0) */
	KMATHERR_HYPOT,				/* hypot overflow */
	KMATHERR_COSH,				/* cosh overflow */
	KMATHERR_EXP_OVERFLOW,		/* exp overflow */
	KMATHERR_EXP_UNDERFLOW,		/* exp underflow */
	KMATHERR_Y0_ZERO,			/* y0(0) */
	KMATHERR_Y0_MINUS,			/* y0(x<0) */
	KMATHERR_Y1_ZERO,			/* y1(0) */
	KMATHERR_Y1_MINUS,			/* y1(x<0) */
	KMATHERR_YN_ZERO,			/* yn(0) */
	KMATHERR_YN_MINUS,			/* yn(x<0) */
	KMATHERR_LGAMMA_OVERFLOW,	/* lgamma(finite) overflow */
	KMATHERR_LGAMMA_MINUS,		/* lgamma(-integer) */
	KMATHERR_LOG_ZERO,			/* log(0) */
	KMATHERR_LOG_MINUS,			/* log(x<0) */
	KMATHERR_LOG10_ZERO,		/* log10(0) */
	KMATHERR_LOG10_MINUS,		/* log10(x<0) */
	KMATHERR_POW_ZERO,			/* pow(0.0,0.0) */
	KMATHERR_POW_OVERFLOW,		/* pow(x,y) overflow */
	KMATHERR_POW_UNDERFLOW,		/* pow(x,y) underflow */
	KMATHERR_POW_MINUS,			/* pow(0,negative) */
	KMATHERR_POW_NONINT,		/* pow(neg,non-integral) */
	KMATHERR_SINH,				/* sinh(finite) overflow */
	KMATHERR_SQRT,				/* sqrt(negative) */
	KMATHERR_FMOD,				/* fmod(x,0) */
	KMATHERR_REMAINDER,			/* remainder(x,0) */
	KMATHERR_ACOSH,				/* acosh(x<1) */
	KMATHERR_ATANH_PLUSONE,		/* atanh(|x|>1) */
	KMATHERR_ATANH_ONE,			/* atanh(|x|=1) */
	KMATHERR_SCALB_OVERFLOW,	/* scalb overflow */
	KMATHERR_SCALB_UNDERFLOW,	/* scalb underflow */
	KMATHERR_J0_TLOSS,			/* j0(|x|>X_TLOSS) */
	KMATHERR_Y0_TLOSS,			/* y0(x>X_TLOSS) */
	KMATHERR_J1_TLOSS,			/* j1(|x|>X_TLOSS) */
	KMATHERR_Y1_TLOSS,			/* y1(x>X_TLOSS) */
	KMATHERR_JN_TLOSS,			/* jn(|x|>X_TLOSS) */
	KMATHERR_YN_TLOSS,			/* yn(x>X_TLOSS) */
	KMATHERR_TGAMMA_OVERFLOW,	/* tgamma(finite) overflow */
	KMATHERR_TGAMMA_MINUS,		/* tgamma(-integer) */
	KMATHERR_POW_NAN,			/* pow(NaN,0.0) */
	KMATHERR_POW_ZEROMINUS,		/* +0**neg */
	KMATHERR_EXP2_OVERFLOW,		/* exp2 overflow */
	KMATHERR_EXP2_UNDERFLOW,	/* exp2 underflow */
	KMATHERR_EXP10_OVERFLOW,	/* exp10 overflow */
	KMATHERR_EXP10_UNDERFLOW,	/* exp10 underflow */
	KMATHERR_LOG2_ZERO,			/* log2(0) */
	KMATHERR_LOG2_MINUS,		/* log2(x<0) */
	KMATHERR_TGAMMA_ZERO,		/* tgamma(+-0) */
	KMATHERR_COS_INF,			/* cos(inf) */
	KMATHERR_SIN_INF,			/* sin(inf) */
	KMATHERR_TAN_INF,			/* tan(inf) */
	KMATHERR_SCALB_INVALID,		/* scalb invalid */
	KMATHERR_TGAMMA_UNDERFLOW,	/* tgamma(finite) underflow */
	KMATHERR_ILOGB,				/* ilogb(0 or NaN) */
	KMATHERR_EXPM1_OVERFLOW,	/* expm1 overflow */
	KMATHERR_EXPM1_UNDERFLOW,	/* expm1 underflow */
 
	KMATHERRF_FIRST = 100,
	KMATHERRF_ACOS = KMATHERR_ACOS + KMATHERRF_FIRST,
	KMATHERRF_ASIN = KMATHERR_ASIN + KMATHERRF_FIRST,
	KMATHERRF_ATAN2 = KMATHERR_ATAN2 + KMATHERRF_FIRST,
	KMATHERRF_HYPOT = KMATHERR_HYPOT + KMATHERRF_FIRST,
	KMATHERRF_COSH = KMATHERR_COSH + KMATHERRF_FIRST,
	KMATHERRF_EXP_OVERFLOW = KMATHERR_EXP_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_EXP_UNDERFLOW = KMATHERR_EXP_UNDERFLOW + KMATHERRF_FIRST,
	KMATHERRF_Y0_ZERO = KMATHERR_Y0_ZERO + KMATHERRF_FIRST,
	KMATHERRF_Y0_MINUS = KMATHERR_Y0_MINUS + KMATHERRF_FIRST,
	KMATHERRF_Y1_ZERO = KMATHERR_Y1_ZERO + KMATHERRF_FIRST,
	KMATHERRF_Y1_MINUS = KMATHERR_Y1_MINUS + KMATHERRF_FIRST,
	KMATHERRF_YN_ZERO = KMATHERR_YN_ZERO + KMATHERRF_FIRST,
	KMATHERRF_YN_MINUS = KMATHERR_YN_MINUS + KMATHERRF_FIRST,
	KMATHERRF_LGAMMA_OVERFLOW = KMATHERR_LGAMMA_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_LGAMMA_MINUS = KMATHERR_LGAMMA_MINUS + KMATHERRF_FIRST,
	KMATHERRF_LOG_ZERO = KMATHERR_LOG_ZERO + KMATHERRF_FIRST,
	KMATHERRF_LOG_MINUS = KMATHERR_LOG_MINUS + KMATHERRF_FIRST,
	KMATHERRF_LOG10_ZERO = KMATHERR_LOG10_ZERO + KMATHERRF_FIRST,
	KMATHERRF_LOG10_MINUS = KMATHERR_LOG10_MINUS + KMATHERRF_FIRST,
	KMATHERRF_POW_ZERO = KMATHERR_POW_ZERO + KMATHERRF_FIRST,
	KMATHERRF_POW_OVERFLOW = KMATHERR_POW_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_POW_UNDERFLOW = KMATHERR_POW_UNDERFLOW + KMATHERRF_FIRST,
	KMATHERRF_POW_MINUS = KMATHERR_POW_MINUS + KMATHERRF_FIRST,
	KMATHERRF_POW_NONINT = KMATHERR_POW_NONINT + KMATHERRF_FIRST,
	KMATHERRF_SINH = KMATHERR_SINH + KMATHERRF_FIRST,
	KMATHERRF_SQRT = KMATHERR_SQRT + KMATHERRF_FIRST,
	KMATHERRF_FMOD = KMATHERR_FMOD + KMATHERRF_FIRST,
	KMATHERRF_REMAINDER = KMATHERR_REMAINDER + KMATHERRF_FIRST,
	KMATHERRF_ACOSH = KMATHERR_ACOSH + KMATHERRF_FIRST,
	KMATHERRF_ATANH_PLUSONE = KMATHERR_ATANH_PLUSONE + KMATHERRF_FIRST,
	KMATHERRF_ATANH_ONE = KMATHERR_ATANH_ONE + KMATHERRF_FIRST,
	KMATHERRF_SCALB_OVERFLOW = KMATHERR_SCALB_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_SCALB_UNDERFLOW = KMATHERR_SCALB_UNDERFLOW + KMATHERRF_FIRST,
	KMATHERRF_J0_TLOSS = KMATHERR_J0_TLOSS + KMATHERRF_FIRST,
	KMATHERRF_Y0_TLOSS = KMATHERR_Y0_TLOSS + KMATHERRF_FIRST,
	KMATHERRF_J1_TLOSS = KMATHERR_J1_TLOSS + KMATHERRF_FIRST,
	KMATHERRF_Y1_TLOSS = KMATHERR_Y1_TLOSS + KMATHERRF_FIRST,
	KMATHERRF_JN_TLOSS = KMATHERR_JN_TLOSS + KMATHERRF_FIRST,
	KMATHERRF_YN_TLOSS = KMATHERR_YN_TLOSS + KMATHERRF_FIRST,
	KMATHERRF_TGAMMA_OVERFLOW = KMATHERR_TGAMMA_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_TGAMMA_MINUS = KMATHERR_TGAMMA_MINUS + KMATHERRF_FIRST,
	KMATHERRF_POW_NAN = KMATHERR_POW_NAN + KMATHERRF_FIRST,
	KMATHERRF_POW_ZEROMINUS = KMATHERR_POW_ZEROMINUS + KMATHERRF_FIRST,
	KMATHERRF_EXP2_OVERFLOW = KMATHERR_EXP2_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_EXP2_UNDERFLOW = KMATHERR_EXP2_UNDERFLOW + KMATHERRF_FIRST,
	KMATHERRF_EXP10_OVERFLOW = KMATHERR_EXP10_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_EXP10_UNDERFLOW = KMATHERR_EXP10_UNDERFLOW + KMATHERRF_FIRST,
	KMATHERRF_LOG2_ZERO = KMATHERR_LOG2_ZERO + KMATHERRF_FIRST,
	KMATHERRF_LOG2_MINUS = KMATHERR_LOG2_MINUS + KMATHERRF_FIRST,
	KMATHERRF_TGAMMA_ZERO = KMATHERR_TGAMMA_ZERO + KMATHERRF_FIRST,
	KMATHERRF_COS_INF = KMATHERR_COS_INF + KMATHERRF_FIRST,
	KMATHERRF_SIN_INF = KMATHERR_SIN_INF + KMATHERRF_FIRST,
	KMATHERRF_TAN_INF = KMATHERR_TAN_INF + KMATHERRF_FIRST,
	KMATHERRF_SCALB_INVALID = KMATHERR_SCALB_INVALID + KMATHERRF_FIRST,
	KMATHERRF_TGAMMA_UNDERFLOW = KMATHERR_TGAMMA_UNDERFLOW + KMATHERRF_FIRST,
	KMATHERRF_ILOGB = KMATHERR_ILOGB + KMATHERRF_FIRST,
	KMATHERRF_EXPM1_OVERFLOW = KMATHERR_EXPM1_OVERFLOW + KMATHERRF_FIRST,
	KMATHERRF_EXPM1_UNDERFLOW = KMATHERR_EXPM1_UNDERFLOW + KMATHERRF_FIRST,
	
	KMATHERRL_FIRST = 200,
	KMATHERRL_ACOS = KMATHERR_ACOS + KMATHERRL_FIRST,
	KMATHERRL_ASIN = KMATHERR_ASIN + KMATHERRL_FIRST,
	KMATHERRL_ATAN2 = KMATHERR_ATAN2 + KMATHERRL_FIRST,
	KMATHERRL_HYPOT = KMATHERR_HYPOT + KMATHERRL_FIRST,
	KMATHERRL_COSH = KMATHERR_COSH + KMATHERRL_FIRST,
	KMATHERRL_EXP_OVERFLOW = KMATHERR_EXP_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_EXP_UNDERFLOW = KMATHERR_EXP_UNDERFLOW + KMATHERRL_FIRST,
	KMATHERRL_Y0_ZERO = KMATHERR_Y0_ZERO + KMATHERRL_FIRST,
	KMATHERRL_Y0_MINUS = KMATHERR_Y0_MINUS + KMATHERRL_FIRST,
	KMATHERRL_Y1_ZERO = KMATHERR_Y1_ZERO + KMATHERRL_FIRST,
	KMATHERRL_Y1_MINUS = KMATHERR_Y1_MINUS + KMATHERRL_FIRST,
	KMATHERRL_YN_ZERO = KMATHERR_YN_ZERO + KMATHERRL_FIRST,
	KMATHERRL_YN_MINUS = KMATHERR_YN_MINUS + KMATHERRL_FIRST,
	KMATHERRL_LGAMMA_OVERFLOW = KMATHERR_LGAMMA_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_LGAMMA_MINUS = KMATHERR_LGAMMA_MINUS + KMATHERRL_FIRST,
	KMATHERRL_LOG_ZERO = KMATHERR_LOG_ZERO + KMATHERRL_FIRST,
	KMATHERRL_LOG_MINUS = KMATHERR_LOG_MINUS + KMATHERRL_FIRST,
	KMATHERRL_LOG10_ZERO = KMATHERR_LOG10_ZERO + KMATHERRL_FIRST,
	KMATHERRL_LOG10_MINUS = KMATHERR_LOG10_MINUS + KMATHERRL_FIRST,
	KMATHERRL_POW_ZERO = KMATHERR_POW_ZERO + KMATHERRL_FIRST,
	KMATHERRL_POW_OVERFLOW = KMATHERR_POW_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_POW_UNDERFLOW = KMATHERR_POW_UNDERFLOW + KMATHERRL_FIRST,
	KMATHERRL_POW_MINUS = KMATHERR_POW_MINUS + KMATHERRL_FIRST,
	KMATHERRL_POW_NONINT = KMATHERR_POW_NONINT + KMATHERRL_FIRST,
	KMATHERRL_SINH = KMATHERR_SINH + KMATHERRL_FIRST,
	KMATHERRL_SQRT = KMATHERR_SQRT + KMATHERRL_FIRST,
	KMATHERRL_FMOD = KMATHERR_FMOD + KMATHERRL_FIRST,
	KMATHERRL_REMAINDER = KMATHERR_REMAINDER + KMATHERRL_FIRST,
	KMATHERRL_ACOSH = KMATHERR_ACOSH + KMATHERRL_FIRST,
	KMATHERRL_ATANH_PLUSONE = KMATHERR_ATANH_PLUSONE + KMATHERRL_FIRST,
	KMATHERRL_ATANH_ONE = KMATHERR_ATANH_ONE + KMATHERRL_FIRST,
	KMATHERRL_SCALB_OVERFLOW = KMATHERR_SCALB_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_SCALB_UNDERFLOW = KMATHERR_SCALB_UNDERFLOW + KMATHERRL_FIRST,
	KMATHERRL_J0_TLOSS = KMATHERR_J0_TLOSS + KMATHERRL_FIRST,
	KMATHERRL_Y0_TLOSS = KMATHERR_Y0_TLOSS + KMATHERRL_FIRST,
	KMATHERRL_J1_TLOSS = KMATHERR_J1_TLOSS + KMATHERRL_FIRST,
	KMATHERRL_Y1_TLOSS = KMATHERR_Y1_TLOSS + KMATHERRL_FIRST,
	KMATHERRL_JN_TLOSS = KMATHERR_JN_TLOSS + KMATHERRL_FIRST,
	KMATHERRL_YN_TLOSS = KMATHERR_YN_TLOSS + KMATHERRL_FIRST,
	KMATHERRL_TGAMMA_OVERFLOW = KMATHERR_TGAMMA_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_TGAMMA_MINUS = KMATHERR_TGAMMA_MINUS + KMATHERRL_FIRST,
	KMATHERRL_POW_NAN = KMATHERR_POW_NAN + KMATHERRL_FIRST,
	KMATHERRL_POW_ZEROMINUS = KMATHERR_POW_ZEROMINUS + KMATHERRL_FIRST,
	KMATHERRL_EXP2_OVERFLOW = KMATHERR_EXP2_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_EXP2_UNDERFLOW = KMATHERR_EXP2_UNDERFLOW + KMATHERRL_FIRST,
	KMATHERRL_EXP10_OVERFLOW = KMATHERR_EXP10_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_EXP10_UNDERFLOW = KMATHERR_EXP10_UNDERFLOW + KMATHERRL_FIRST,
	KMATHERRL_LOG2_ZERO = KMATHERR_LOG2_ZERO + KMATHERRL_FIRST,
	KMATHERRL_LOG2_MINUS = KMATHERR_LOG2_MINUS + KMATHERRL_FIRST,
	KMATHERRL_TGAMMA_ZERO = KMATHERR_TGAMMA_ZERO + KMATHERRL_FIRST,
	KMATHERRL_COS_INF = KMATHERR_COS_INF + KMATHERRL_FIRST,
	KMATHERRL_SIN_INF = KMATHERR_SIN_INF + KMATHERRL_FIRST,
	KMATHERRL_TAN_INF = KMATHERR_TAN_INF + KMATHERRL_FIRST,
	KMATHERRL_SCALB_INVALID = KMATHERR_SCALB_INVALID + KMATHERRL_FIRST,
	KMATHERRL_TGAMMA_UNDERFLOW = KMATHERR_TGAMMA_UNDERFLOW + KMATHERRL_FIRST,
	KMATHERRL_ILOGB = KMATHERR_ILOGB + KMATHERRL_FIRST,
	KMATHERRL_EXPM1_OVERFLOW = KMATHERR_EXPM1_OVERFLOW + KMATHERRL_FIRST,
	KMATHERRL_EXPM1_UNDERFLOW = KMATHERR_EXPM1_UNDERFLOW + KMATHERRL_FIRST
};

double __kernel_standard(double arg1, double arg2, double retval, enum matherr type);
float __kernel_standard_f(float arg1, float arg2, float retval, enum matherr type);
long double __kernel_standard_l(long double arg1, long double arg2, long double retval, enum matherr type);
