require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MATH_H_)) {
    eval 'sub _MATH_H_ () {1;}' unless defined(&_MATH_H_);
    require 'sys/_types.ph';
    require 'sys/cdefs.ph';
    require 'sys/limits.ph';
    eval 'sub HUGE_VAL () {(*( &void *) &__infinity);}' unless defined(&HUGE_VAL);
    if((defined(&__ISO_C_VISIBLE) ? &__ISO_C_VISIBLE : undef) >= 1999) {
	if(defined(&__vax__)) {
	    eval 'sub HUGE_VALF () {(*( &void *) &__infinityf);}' unless defined(&HUGE_VALF);
	} else {
	    eval 'sub HUGE_VALF () {( &HUGE_VAL);}' unless defined(&HUGE_VALF);
	}
	eval 'sub HUGE_VALL () {( &HUGE_VAL);}' unless defined(&HUGE_VALL);
	eval 'sub INFINITY () { &HUGE_VALF;}' unless defined(&INFINITY);
	unless(defined(&__vax__)) {
	    eval 'sub NAN () {(*( &void *) &__nan);}' unless defined(&NAN);
	}
	eval 'sub FP_INFINITE () {0x1;}' unless defined(&FP_INFINITE);
	eval 'sub FP_NAN () {0x2;}' unless defined(&FP_NAN);
	eval 'sub FP_NORMAL () {0x4;}' unless defined(&FP_NORMAL);
	eval 'sub FP_SUBNORMAL () {0x8;}' unless defined(&FP_SUBNORMAL);
	eval 'sub FP_ZERO () {0x10;}' unless defined(&FP_ZERO);
	eval 'sub FP_ILOGB0 () {(- &INT_MAX);}' unless defined(&FP_ILOGB0);
	eval 'sub FP_ILOGBNAN () { &INT_MAX;}' unless defined(&FP_ILOGBNAN);
	eval 'sub fpclassify {
	    my($x) = @_;
    	    eval q((($sizeof{$x} == $sizeof{\'float\'}) ?  &__fpclassifyf($x) : ($sizeof{$x} == $sizeof{\'double\'}) ?  &__fpclassify($x) :  &__fpclassifyl($x)));
	}' unless defined(&fpclassify);
	eval 'sub isfinite {
	    my($x) = @_;
    	    eval q((($sizeof{$x} == $sizeof{\'float\'}) ?  &__isfinitef($x) : ($sizeof{$x} == $sizeof{\'double\'}) ?  &__isfinite($x) :  &__isfinitel($x)));
	}' unless defined(&isfinite);
	eval 'sub isnormal {
	    my($x) = @_;
    	    eval q((($sizeof{$x} == $sizeof{\'float\'}) ?  &__isnormalf($x) : ($sizeof{$x} == $sizeof{\'double\'}) ?  &__isnormal($x) :  &__isnormall($x)));
	}' unless defined(&isnormal);
	eval 'sub signbit {
	    my($x) = @_;
    	    eval q((($sizeof{$x} == $sizeof{\'float\'}) ?  &__signbitf($x) : ($sizeof{$x} == $sizeof{\'double\'}) ?  &__signbit($x) :  &__signbitl($x)));
	}' unless defined(&signbit);
	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);
	eval 'sub isunordered {
	    my($x, $y) = @_;
    	    eval q(( &isnan($x) ||  &isnan($y)));
	}' unless defined(&isunordered);
    }
    eval 'sub isinf {
        my($x) = @_;
	    eval q((($sizeof{$x} == $sizeof{\'float\'}) ?  &__isinff($x) : ($sizeof{$x} == $sizeof{\'double\'}) ?  &__isinf($x) :  &__isinfl($x)));
    }' unless defined(&isinf);
    eval 'sub isnan {
        my($x) = @_;
	    eval q((($sizeof{$x} == $sizeof{\'float\'}) ?  &__isnanf($x) : ($sizeof{$x} == $sizeof{\'double\'}) ?  &__isnan($x) :  &__isnanl($x)));
    }' unless defined(&isnan);
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : undef)) {
	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);
	if(defined(&__vax__)) {
	    eval 'sub MAXFLOAT () {(1.70141173319264430e+38);}' unless defined(&MAXFLOAT);
	} else {
	    eval 'sub MAXFLOAT () {(3.40282346638528860e+38);}' unless defined(&MAXFLOAT);
	}
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef)) {
	eval 'sub HUGE () { &MAXFLOAT;}' unless defined(&HUGE);
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef) || (defined(&__ISO_C_VISIBLE) ? &__ISO_C_VISIBLE : undef) >= 1999|| (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : undef)) {
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : undef)) {
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : undef) <= 500) {
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef)) {
    }
    if((defined(&__ISO_C_VISIBLE) ? &__ISO_C_VISIBLE : undef) >= 1999) {
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : undef)) {
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : undef) <= 500) {
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef)) {
    }
    if((defined(&__ISO_C_VISIBLE) ? &__ISO_C_VISIBLE : undef) >= 1999) {
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
	if(0) {
	}
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : undef)  && defined( &__vax__)) {
    }
}
1;
