require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MATH_H_)) {
    eval 'sub _MATH_H_ () {1;}' unless defined(&_MATH_H_);
    require 'sys/cdefs.ph';
    require 'sys/featuretest.ph';
    require 'machine/math.ph';
    require 'limits.ph';
    if((!defined(&_ANSI_SOURCE)  && !defined(&_POSIX_C_SOURCE)  && !defined(&_XOPEN_SOURCE)) || (((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || defined(&_ISOC99_SOURCE) || ((defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) - 0) >= 199901 || ((defined(&__cplusplus) ? &__cplusplus : undef) - 0) >= 201103 || defined(&_NETBSD_SOURCE))) {
	eval 'sub __MATH_C99_FEATURES () {1;}' unless defined(&__MATH_C99_FEATURES);
    }
    if(defined(&__MATH_C99_FEATURES)) {
	if(defined(&__FLT_EVAL_METHOD__)  && ((defined(&__FLT_EVAL_METHOD__) ? &__FLT_EVAL_METHOD__ : undef) - 0) == 0) {
	}
 elsif(((defined(&__FLT_EVAL_METHOD__) ? &__FLT_EVAL_METHOD__ : undef) - 0) == 1) {
	}
 elsif(((defined(&__FLT_EVAL_METHOD__) ? &__FLT_EVAL_METHOD__ : undef) - 0) == 2) {
	}
    }
    if(defined(&__HAVE_LONG_DOUBLE)) {
	eval 'sub __fpmacro_unary_floating {
	    my($__name, $__arg0) = @_;
    	    eval q((($sizeof{$__arg0} == $sizeof{\'float\'}) ?  &__  $__name   &f ($__arg0) : ($sizeof{$__arg0} == $sizeof{\'double\'}) ?  &__  $__name   &d ($__arg0) :  &__  $__name   &l ($__arg0)));
	}' unless defined(&__fpmacro_unary_floating);
    } else {
	eval 'sub __fpmacro_unary_floating {
	    my($__name, $__arg0) = @_;
    	    eval q((($sizeof{$__arg0} == $sizeof{\'float\'}) ?  &__  $__name   &f ($__arg0) :  &__  $__name   &d ($__arg0)));
	}' unless defined(&__fpmacro_unary_floating);
    }
    if( &__GNUC_PREREQ__(3, 3)) {
	eval 'sub HUGE_VAL () { &__builtin_huge_val();}' unless defined(&HUGE_VAL);
    } else {
	eval 'sub HUGE_VAL () { ($__infinity->{__val});}' unless defined(&HUGE_VAL);
    }
    if(defined(&__MATH_C99_FEATURES) || ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 600) {
	if( &__GNUC_PREREQ__(3, 3)) {
	    eval 'sub HUGE_VALF () { &__builtin_huge_valf();}' unless defined(&HUGE_VALF);
	    eval 'sub HUGE_VALL () { &__builtin_huge_vall();}' unless defined(&HUGE_VALL);
	} else {
	    eval 'sub HUGE_VALF () { ($__infinityf->{__val});}' unless defined(&HUGE_VALF);
	    eval 'sub HUGE_VALL () { ($__infinityl->{__val});}' unless defined(&HUGE_VALL);
	}
	if(defined(&__INFINITY)) {
	    eval 'sub INFINITY () { &__INFINITY;}' unless defined(&INFINITY);
	}
 elsif( &__GNUC_PREREQ__(3, 3)) {
	    eval 'sub INFINITY () { &__builtin_inff();}' unless defined(&INFINITY);
	} else {
	    eval 'sub INFINITY () { &HUGE_VALF;}' unless defined(&INFINITY);
	}
	if(defined(&__HAVE_NANF)) {
	    if( &__GNUC_PREREQ__(3,3)) {
		eval 'sub NAN () { &__builtin_nanf("");}' unless defined(&NAN);
	    } else {
		eval 'sub NAN () { ($__nanf->{__val});}' unless defined(&NAN);
	    }
	}
	eval 'sub FP_INFINITE () {0x;}' unless defined(&FP_INFINITE);
	eval 'sub FP_NAN () {0x1;}' unless defined(&FP_NAN);
	eval 'sub FP_NORMAL () {0x2;}' unless defined(&FP_NORMAL);
	eval 'sub FP_SUBNORMAL () {0x3;}' unless defined(&FP_SUBNORMAL);
	eval 'sub FP_ZERO () {0x4;}' unless defined(&FP_ZERO);
	eval 'sub _FP_LOMD () {0x80;}' unless defined(&_FP_LOMD);
	eval 'sub _FP_HIMD () {0xff;}' unless defined(&_FP_HIMD);
	if( &__GNUC_PREREQ__(4, 4)) {
	    if(defined(&__FP_FAST_FMA)) {
		eval 'sub FP_FAST_FMA () {1;}' unless defined(&FP_FAST_FMA);
	    }
	    if(defined(&__FP_FAST_FMAF)) {
		eval 'sub FP_FAST_FMAF () {1;}' unless defined(&FP_FAST_FMAF);
	    }
	    if(defined(&__FP_FAST_FMAL)) {
		eval 'sub FP_FAST_FMAL () {1;}' unless defined(&FP_FAST_FMAL);
	    }
	}
	eval 'sub FP_ILOGB0 () { &INT_MIN;}' unless defined(&FP_ILOGB0);
	eval 'sub FP_ILOGBNAN () { &INT_MAX;}' unless defined(&FP_ILOGBNAN);
	eval 'sub MATH_ERRNO () {1;}' unless defined(&MATH_ERRNO);
	eval 'sub MATH_ERREXCEPT () {2;}' unless defined(&MATH_ERREXCEPT);
	if(defined(&__vax__)) {
	    eval 'sub math_errhandling () { &MATH_ERRNO;}' unless defined(&math_errhandling);
	} else {
	    eval 'sub math_errhandling () { &MATH_ERREXCEPT;}' unless defined(&math_errhandling);
	}
    }
    if(defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	eval 'sub M_E () {2.7182818284590452354;}' unless defined(&M_E);
	eval 'sub M_LOG2E () {1.4426950408889634074;}' unless defined(&M_LOG2E);
	eval 'sub M_LOG10E () {0.43429448190325182765;}' unless defined(&M_LOG10E);
	eval 'sub M_LN2 () {0.69314718055994530942;}' unless defined(&M_LN2);
	eval 'sub M_LN10 () {2.30258509299404568402;}' unless defined(&M_LN10);
	eval 'sub M_PI () {3.14159265358979323846;}' unless defined(&M_PI);
	eval 'sub M_PI_2 () {1.57079632679489661923;}' unless defined(&M_PI_2);
	eval 'sub M_PI_4 () {0.78539816339744830962;}' unless defined(&M_PI_4);
	eval 'sub M_1_PI () {0.31830988618379067154;}' unless defined(&M_1_PI);
	eval 'sub M_2_PI () {0.63661977236758134308;}' unless defined(&M_2_PI);
	eval 'sub M_2_SQRTPI () {1.12837916709551257390;}' unless defined(&M_2_SQRTPI);
	eval 'sub M_SQRT2 () {1.41421356237309504880;}' unless defined(&M_SQRT2);
	eval 'sub M_SQRT1_2 () {0.70710678118654752440;}' unless defined(&M_SQRT1_2);
	eval 'sub MAXFLOAT () {(3.40282346638528860e+38);}' unless defined(&MAXFLOAT);
    }
    if(defined(&_NETBSD_SOURCE)) {
	eval("sub fdlibm_ieee () { -1; }") unless defined(&fdlibm_ieee);
	eval("sub fdlibm_svid () { 0; }") unless defined(&fdlibm_svid);
	eval("sub fdlibm_xopen () { 1; }") unless defined(&fdlibm_xopen);
	eval("sub fdlibm_posix () { 2; }") unless defined(&fdlibm_posix);
	eval 'sub _LIB_VERSION_TYPE () { &enum  &fdversion;}' unless defined(&_LIB_VERSION_TYPE);
	eval 'sub _LIB_VERSION () { &_fdlib_version;}' unless defined(&_LIB_VERSION);
	eval 'sub _IEEE_ () { &fdlibm_ieee;}' unless defined(&_IEEE_);
	eval 'sub _SVID_ () { &fdlibm_svid;}' unless defined(&_SVID_);
	eval 'sub _XOPEN_ () { &fdlibm_xopen;}' unless defined(&_XOPEN_);
	eval 'sub _POSIX_ () { &fdlibm_posix;}' unless defined(&_POSIX_);
	unless(defined(&__cplusplus)) {
	}
	eval 'sub HUGE () { &MAXFLOAT;}' unless defined(&HUGE);
	eval 'sub X_TLOSS () {1.41484755040568800000e+16;}' unless defined(&X_TLOSS);
	eval 'sub DOMAIN () {1;}' unless defined(&DOMAIN);
	eval 'sub SING () {2;}' unless defined(&SING);
	eval 'sub OVERFLOW () {3;}' unless defined(&OVERFLOW);
	eval 'sub UNDERFLOW () {4;}' unless defined(&UNDERFLOW);
	eval 'sub TLOSS () {5;}' unless defined(&TLOSS);
	eval 'sub PLOSS () {6;}' unless defined(&PLOSS);
    }
    if(defined(&__MATH_C99_FEATURES) || defined(&_XOPEN_SOURCE)) {
    }
    if(defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	if(((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	}
    }
    if(defined(&__MATH_C99_FEATURES) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500) {
    }
    if(defined(&__MATH_C99_FEATURES) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 600|| ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112) {
	eval 'sub fpclassify {
	    my($__x) = @_;
    	    eval q( &__fpmacro_unary_floating( &fpclassify, $__x));
	}' unless defined(&fpclassify);
	eval 'sub isfinite {
	    my($__x) = @_;
    	    eval q( &__fpmacro_unary_floating( &isfinite, $__x));
	}' unless defined(&isfinite);
	eval 'sub isnormal {
	    my($__x) = @_;
    	    eval q(( &fpclassify($__x) ==  &FP_NORMAL));
	}' unless defined(&isnormal);
	eval 'sub signbit {
	    my($__x) = @_;
    	    eval q( &__fpmacro_unary_floating( &signbit, $__x));
	}' unless defined(&signbit);
	eval 'sub isunordered {
	    my($x, $y) = @_;
    	    eval q(( &isnan($x) ||  &isnan($y)));
	}' unless defined(&isunordered);
	eval 'sub isgreater {
	    my($x, $y) = @_;
    	    eval q((! &isunordered(($x), ($y))  && ($x) > ($y)));
	}' unless defined(&isgreater);
	eval 'sub isgreaterequal {
	    my($x, $y) = @_;
    	    eval q((! &isunordered(($x), ($y))  && ($x) >= ($y)));
	}' unless defined(&isgreaterequal);
	eval 'sub isless {
	    my($x, $y) = @_;
    	    eval q((! &isunordered(($x), ($y))  && ($x) < ($y)));
	}' unless defined(&isless);
	eval 'sub islessequal {
	    my($x, $y) = @_;
    	    eval q((! &isunordered(($x), ($y))  && ($x) <= ($y)));
	}' unless defined(&islessequal);
	eval 'sub islessgreater {
	    my($x, $y) = @_;
    	    eval q((! &isunordered(($x), ($y))  && (($x) > ($y) || ($y) > ($x))));
	}' unless defined(&islessgreater);
    }
    if(defined(&__MATH_C99_FEATURES) || ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112) {
	if(defined(&__isinf) || defined(&__HAVE_INLINE___ISINF)) {
	    eval 'sub isinf {
	        my($__x) = @_;
    		eval q( &__isinf($__x));
	    }' unless defined(&isinf);
	} else {
	    eval 'sub isinf {
	        my($__x) = @_;
    		eval q( &__fpmacro_unary_floating( &isinf, $__x));
	    }' unless defined(&isinf);
	}
	if(defined(&__isnan) || defined(&__HAVE_INLINE___ISNAN)) {
	    eval 'sub isnan {
	        my($__x) = @_;
    		eval q( &__isnan($__x));
	    }' unless defined(&isnan);
	} else {
	    eval 'sub isnan {
	        my($__x) = @_;
    		eval q( &__fpmacro_unary_floating( &isnan, $__x));
	    }' unless defined(&isnan);
	}
    }
    if(defined(&_NETBSD_SOURCE)) {
	unless(defined(&__cplusplus)) {
	}
    }
    if(defined(&_NETBSD_SOURCE) || defined(&_REENTRANT)) {
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    if(defined(&_NETBSD_SOURCE) || defined(&_REENTRANT)) {
    }
    if(defined(&__HAVE_LONG_DOUBLE)) {
    }
}
1;
