/* Test whether a basic fma invocation works. */
/* This test is generated by misc/genbasic.c. */

#include <errno.h>
#include <fenv.h>
#include <math.h>

#include "../basic.h"

#pragma STDC FENV_ACCESS ON

#define MF_UNSPEC1 (1 << 0)
#define MF_UNSPEC2 (1 << 1)
#define MF_MAYERR (1 << 2)

// Soft fail on rounding errors and report only one.
int imprecise;

static const char* fperrname(int excepts)
{
	switch ( excepts )
	{
	case 0: return "FE_NONE";
	case FE_INVALID: return "FE_INVALID";
	case FE_DIVBYZERO: return "FE_DIVBYZERO";
	case FE_OVERFLOW: return "FE_OVERFLOW";
	case FE_UNDERFLOW: return "FE_UNDERFLOW";
	default: return "FE_MULTIPLE";
	}
}

void test(int variant, double input1, double input2, double input3, int errnum, int fperr, double lower, double expected, double upper, int flags)
{
	errno = 0;
	if ( feclearexcept(FE_ALL_EXCEPT) )
		errx(1, "feclearexcept");
	double output = fma(input1, input2, input3);
	if ( errnum == 0 && errno )
		err(1, "(%d.) fma(%.4f, %.4f, %.4f) failed",
                    variant, input1, input2, input3);
	if ( (math_errhandling & MATH_ERRNO) && errnum && errno != errnum )
		errx(1, "(%d.) fma(%.4f, %.4f, %.4f) did not %s",
                     variant, input1, input2, input3, strerrno(errnum));
	int excepts = fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW);
	if ( fperr == 0 && excepts )
		errx(1, "(%d.) fma(%.4f, %.4f, %.4f) %s",
                     variant, input1, input2, input3, fperrname(excepts));
	if ( (math_errhandling & MATH_ERREXCEPT) && fperr != 0 &&
	     excepts != fperr && !((flags & MF_MAYERR) && !excepts) )
		errx(1, "(%d.) fma(%.4f, %.4f, %.4f) did not %s",
                     variant, input1, input2, input3, fperrname(fperr));
	if ( !(flags & MF_UNSPEC1) )
	{
		if ( !(isnan(expected) ? isnan(output) :
		       isfinite(expected) && expected != 0.0 ?
		       isfinite(output) && (output == expected || (lower < output && output < upper)) :
		       output == expected) )
		{
			if ( imprecise && isfinite(output) && isfinite(expected) )
				return;
			warnx("(%d.) fma(%.4f, %.4f, %.4f) = %.14a, not %.14a, diff %.14a, ratio %.16g",
			     variant, input1, input2, input3, output, expected,
			     output - expected, output / expected);
			if ( !isfinite(output) || !isfinite(expected) )
				exit(1);
			imprecise = 1;
		}
	}
}

int main(void)
{
	test(1, 90.01, 13.37, 10.1, 0, 0, 0x1.2f6228240b77fp+10, 0x1.2f6228240b78p+10, 0x1.2f6228240b781p+10, 0);
	test(2, -12.34, 13.37, 10.1, 0, 0, -0x1.35c58793dd98p+7, -0x1.35c58793dd97fp+7, -0x1.35c58793dd97ep+7, 0);
	test(3, nan(""), 13.37, 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(4, strtod("inf", NULL), 13.37, 10.1, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(5, strtod("-inf", NULL), 13.37, 10.1, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(6, 0.0, 13.37, 10.1, 0, 0, 0x1.4333333333332p+3, 0x1.4333333333333p+3, 0x1.4333333333334p+3, 0);
	test(7, 90.01, -12.34, 10.1, 0, 0, -0x1.1327e5c91d14fp+10, -0x1.1327e5c91d14ep+10, -0x1.1327e5c91d14dp+10, 0);
	test(8, -12.34, -12.34, 10.1, 0, 0, 0x1.44c04ea4a8c14p+7, 0x1.44c04ea4a8c15p+7, 0x1.44c04ea4a8c16p+7, 0);
	test(9, nan(""), -12.34, 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(10, strtod("inf", NULL), -12.34, 10.1, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(11, strtod("-inf", NULL), -12.34, 10.1, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(12, 0.0, -12.34, 10.1, 0, 0, 0x1.4333333333332p+3, 0x1.4333333333333p+3, 0x1.4333333333334p+3, 0);
	test(13, 90.01, nan(""), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(14, -12.34, nan(""), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(15, nan(""), nan(""), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(16, strtod("inf", NULL), nan(""), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(17, strtod("-inf", NULL), nan(""), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(18, 0.0, nan(""), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(19, 90.01, strtod("inf", NULL), 10.1, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(20, -12.34, strtod("inf", NULL), 10.1, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(21, nan(""), strtod("inf", NULL), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(22, strtod("inf", NULL), strtod("inf", NULL), 10.1, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(23, strtod("-inf", NULL), strtod("inf", NULL), 10.1, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(24, 0.0, strtod("inf", NULL), 10.1, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(25, 90.01, strtod("-inf", NULL), 10.1, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(26, -12.34, strtod("-inf", NULL), 10.1, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(27, nan(""), strtod("-inf", NULL), 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(28, strtod("inf", NULL), strtod("-inf", NULL), 10.1, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(29, strtod("-inf", NULL), strtod("-inf", NULL), 10.1, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(30, 0.0, strtod("-inf", NULL), 10.1, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(31, 90.01, 0.0, 10.1, 0, 0, 0x1.4333333333332p+3, 0x1.4333333333333p+3, 0x1.4333333333334p+3, 0);
	test(32, -12.34, 0.0, 10.1, 0, 0, 0x1.4333333333332p+3, 0x1.4333333333333p+3, 0x1.4333333333334p+3, 0);
	test(33, nan(""), 0.0, 10.1, 0, 0, nan(""), nan(""), nan(""), 0);
	test(34, strtod("inf", NULL), 0.0, 10.1, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(35, strtod("-inf", NULL), 0.0, 10.1, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(36, 0.0, 0.0, 10.1, 0, 0, 0x1.4333333333332p+3, 0x1.4333333333333p+3, 0x1.4333333333334p+3, 0);
	test(37, 90.01, 13.37, -12.34, 0, 0, 0x1.29c5ff2e48e89p+10, 0x1.29c5ff2e48e8ap+10, 0x1.29c5ff2e48e8bp+10, 0);
	test(38, -12.34, 13.37, -12.34, 0, 0, -0x1.62a6cf41f212ep+7, -0x1.62a6cf41f212dp+7, -0x1.62a6cf41f212cp+7, 0);
	test(39, nan(""), 13.37, -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(40, strtod("inf", NULL), 13.37, -12.34, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(41, strtod("-inf", NULL), 13.37, -12.34, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(42, 0.0, 13.37, -12.34, 0, 0, -0x1.8ae147ae147afp+3, -0x1.8ae147ae147aep+3, -0x1.8ae147ae147adp+3, 0);
	test(43, 90.01, -12.34, -12.34, 0, 0, -0x1.18c40ebedfa45p+10, -0x1.18c40ebedfa44p+10, -0x1.18c40ebedfa43p+10, 0);
	test(44, -12.34, -12.34, -12.34, 0, 0, 0x1.17df06f694466p+7, 0x1.17df06f694467p+7, 0x1.17df06f694468p+7, 0);
	test(45, nan(""), -12.34, -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(46, strtod("inf", NULL), -12.34, -12.34, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(47, strtod("-inf", NULL), -12.34, -12.34, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(48, 0.0, -12.34, -12.34, 0, 0, -0x1.8ae147ae147afp+3, -0x1.8ae147ae147aep+3, -0x1.8ae147ae147adp+3, 0);
	test(49, 90.01, nan(""), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(50, -12.34, nan(""), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(51, nan(""), nan(""), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(52, strtod("inf", NULL), nan(""), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(53, strtod("-inf", NULL), nan(""), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(54, 0.0, nan(""), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(55, 90.01, strtod("inf", NULL), -12.34, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(56, -12.34, strtod("inf", NULL), -12.34, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(57, nan(""), strtod("inf", NULL), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(58, strtod("inf", NULL), strtod("inf", NULL), -12.34, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(59, strtod("-inf", NULL), strtod("inf", NULL), -12.34, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(60, 0.0, strtod("inf", NULL), -12.34, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(61, 90.01, strtod("-inf", NULL), -12.34, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(62, -12.34, strtod("-inf", NULL), -12.34, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(63, nan(""), strtod("-inf", NULL), -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(64, strtod("inf", NULL), strtod("-inf", NULL), -12.34, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(65, strtod("-inf", NULL), strtod("-inf", NULL), -12.34, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(66, 0.0, strtod("-inf", NULL), -12.34, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(67, 90.01, 0.0, -12.34, 0, 0, -0x1.8ae147ae147afp+3, -0x1.8ae147ae147aep+3, -0x1.8ae147ae147adp+3, 0);
	test(68, -12.34, 0.0, -12.34, 0, 0, -0x1.8ae147ae147afp+3, -0x1.8ae147ae147aep+3, -0x1.8ae147ae147adp+3, 0);
	test(69, nan(""), 0.0, -12.34, 0, 0, nan(""), nan(""), nan(""), 0);
	test(70, strtod("inf", NULL), 0.0, -12.34, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(71, strtod("-inf", NULL), 0.0, -12.34, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(72, 0.0, 0.0, -12.34, 0, 0, -0x1.8ae147ae147afp+3, -0x1.8ae147ae147aep+3, -0x1.8ae147ae147adp+3, 0);
	test(73, 90.01, 13.37, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(74, -12.34, 13.37, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(75, nan(""), 13.37, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(76, strtod("inf", NULL), 13.37, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(77, strtod("-inf", NULL), 13.37, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(78, 0.0, 13.37, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(79, 90.01, -12.34, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(80, -12.34, -12.34, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(81, nan(""), -12.34, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(82, strtod("inf", NULL), -12.34, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(83, strtod("-inf", NULL), -12.34, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(84, 0.0, -12.34, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(85, 90.01, nan(""), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(86, -12.34, nan(""), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(87, nan(""), nan(""), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(88, strtod("inf", NULL), nan(""), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(89, strtod("-inf", NULL), nan(""), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(90, 0.0, nan(""), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(91, 90.01, strtod("inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(92, -12.34, strtod("inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(93, nan(""), strtod("inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(94, strtod("inf", NULL), strtod("inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(95, strtod("-inf", NULL), strtod("inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(96, 0.0, strtod("inf", NULL), nan(""), EDOM, FE_INVALID, nan(""), nan(""), nan(""), 0 | MF_MAYERR);
	test(97, 90.01, strtod("-inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(98, -12.34, strtod("-inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(99, nan(""), strtod("-inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(100, strtod("inf", NULL), strtod("-inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(101, strtod("-inf", NULL), strtod("-inf", NULL), nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(102, 0.0, strtod("-inf", NULL), nan(""), EDOM, FE_INVALID, nan(""), nan(""), nan(""), 0 | MF_MAYERR);
	test(103, 90.01, 0.0, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(104, -12.34, 0.0, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(105, nan(""), 0.0, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(106, strtod("inf", NULL), 0.0, nan(""), EDOM, FE_INVALID, nan(""), nan(""), nan(""), 0 | MF_MAYERR);
	test(107, strtod("-inf", NULL), 0.0, nan(""), EDOM, FE_INVALID, nan(""), nan(""), nan(""), 0 | MF_MAYERR);
	test(108, 0.0, 0.0, nan(""), 0, 0, nan(""), nan(""), nan(""), 0);
	test(109, 90.01, 13.37, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(110, -12.34, 13.37, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(111, nan(""), 13.37, strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(112, strtod("inf", NULL), 13.37, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(113, strtod("-inf", NULL), 13.37, strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(114, 0.0, 13.37, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(115, 90.01, -12.34, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(116, -12.34, -12.34, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(117, nan(""), -12.34, strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(118, strtod("inf", NULL), -12.34, strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(119, strtod("-inf", NULL), -12.34, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(120, 0.0, -12.34, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(121, 90.01, nan(""), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(122, -12.34, nan(""), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(123, nan(""), nan(""), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(124, strtod("inf", NULL), nan(""), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(125, strtod("-inf", NULL), nan(""), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(126, 0.0, nan(""), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(127, 90.01, strtod("inf", NULL), strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(128, -12.34, strtod("inf", NULL), strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(129, nan(""), strtod("inf", NULL), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(130, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(131, strtod("-inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(132, 0.0, strtod("inf", NULL), strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(133, 90.01, strtod("-inf", NULL), strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(134, -12.34, strtod("-inf", NULL), strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(135, nan(""), strtod("-inf", NULL), strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(136, strtod("inf", NULL), strtod("-inf", NULL), strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(137, strtod("-inf", NULL), strtod("-inf", NULL), strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(138, 0.0, strtod("-inf", NULL), strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(139, 90.01, 0.0, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(140, -12.34, 0.0, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(141, nan(""), 0.0, strtod("inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(142, strtod("inf", NULL), 0.0, strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(143, strtod("-inf", NULL), 0.0, strtod("inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(144, 0.0, 0.0, strtod("inf", NULL), 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(145, 90.01, 13.37, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(146, -12.34, 13.37, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(147, nan(""), 13.37, strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(148, strtod("inf", NULL), 13.37, strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(149, strtod("-inf", NULL), 13.37, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(150, 0.0, 13.37, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(151, 90.01, -12.34, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(152, -12.34, -12.34, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(153, nan(""), -12.34, strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(154, strtod("inf", NULL), -12.34, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(155, strtod("-inf", NULL), -12.34, strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(156, 0.0, -12.34, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(157, 90.01, nan(""), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(158, -12.34, nan(""), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(159, nan(""), nan(""), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(160, strtod("inf", NULL), nan(""), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(161, strtod("-inf", NULL), nan(""), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(162, 0.0, nan(""), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(163, 90.01, strtod("inf", NULL), strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(164, -12.34, strtod("inf", NULL), strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(165, nan(""), strtod("inf", NULL), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(166, strtod("inf", NULL), strtod("inf", NULL), strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(167, strtod("-inf", NULL), strtod("inf", NULL), strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(168, 0.0, strtod("inf", NULL), strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(169, 90.01, strtod("-inf", NULL), strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(170, -12.34, strtod("-inf", NULL), strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(171, nan(""), strtod("-inf", NULL), strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(172, strtod("inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(173, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(174, 0.0, strtod("-inf", NULL), strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(175, 90.01, 0.0, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(176, -12.34, 0.0, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(177, nan(""), 0.0, strtod("-inf", NULL), 0, 0, nan(""), nan(""), nan(""), 0);
	test(178, strtod("inf", NULL), 0.0, strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(179, strtod("-inf", NULL), 0.0, strtod("-inf", NULL), 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(180, 0.0, 0.0, strtod("-inf", NULL), 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(181, 90.01, 13.37, 0.0, 0, 0, 0x1.2cdbc1bda5119p+10, 0x1.2cdbc1bda511ap+10, 0x1.2cdbc1bda511bp+10, 0);
	test(182, -12.34, 13.37, 0.0, 0, 0, -0x1.49f8bac710cb3p+7, -0x1.49f8bac710cb2p+7, -0x1.49f8bac710cb1p+7, 0);
	test(183, nan(""), 13.37, 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(184, strtod("inf", NULL), 13.37, 0.0, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(185, strtod("-inf", NULL), 13.37, 0.0, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(186, 0.0, 13.37, 0.0, 0, 0, -0x0.0000000000001p-1022, 0x0.0p+0, 0x0.0000000000001p-1022, 0);
	test(187, 90.01, -12.34, 0.0, 0, 0, -0x1.15ae4c2f837b6p+10, -0x1.15ae4c2f837b5p+10, -0x1.15ae4c2f837b4p+10, 0);
	test(188, -12.34, -12.34, 0.0, 0, 0, 0x1.308d1b71758e1p+7, 0x1.308d1b71758e2p+7, 0x1.308d1b71758e3p+7, 0);
	test(189, nan(""), -12.34, 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(190, strtod("inf", NULL), -12.34, 0.0, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(191, strtod("-inf", NULL), -12.34, 0.0, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(192, 0.0, -12.34, 0.0, 0, 0, -0x0.0000000000001p-1022, 0x0.0p+0, 0x0.0000000000001p-1022, 0);
	test(193, 90.01, nan(""), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(194, -12.34, nan(""), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(195, nan(""), nan(""), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(196, strtod("inf", NULL), nan(""), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(197, strtod("-inf", NULL), nan(""), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(198, 0.0, nan(""), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(199, 90.01, strtod("inf", NULL), 0.0, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(200, -12.34, strtod("inf", NULL), 0.0, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(201, nan(""), strtod("inf", NULL), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(202, strtod("inf", NULL), strtod("inf", NULL), 0.0, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(203, strtod("-inf", NULL), strtod("inf", NULL), 0.0, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(204, 0.0, strtod("inf", NULL), 0.0, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(205, 90.01, strtod("-inf", NULL), 0.0, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(206, -12.34, strtod("-inf", NULL), 0.0, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(207, nan(""), strtod("-inf", NULL), 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(208, strtod("inf", NULL), strtod("-inf", NULL), 0.0, 0, 0, strtod("-inf", NULL), strtod("-inf", NULL), strtod("-inf", NULL), 0);
	test(209, strtod("-inf", NULL), strtod("-inf", NULL), 0.0, 0, 0, strtod("inf", NULL), strtod("inf", NULL), strtod("inf", NULL), 0);
	test(210, 0.0, strtod("-inf", NULL), 0.0, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(211, 90.01, 0.0, 0.0, 0, 0, -0x0.0000000000001p-1022, 0x0.0p+0, 0x0.0000000000001p-1022, 0);
	test(212, -12.34, 0.0, 0.0, 0, 0, -0x0.0000000000001p-1022, 0x0.0p+0, 0x0.0000000000001p-1022, 0);
	test(213, nan(""), 0.0, 0.0, 0, 0, nan(""), nan(""), nan(""), 0);
	test(214, strtod("inf", NULL), 0.0, 0.0, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(215, strtod("-inf", NULL), 0.0, 0.0, 0, FE_INVALID, nan(""), nan(""), nan(""), 0);
	test(216, 0.0, 0.0, 0.0, 0, 0, -0x0.0000000000001p-1022, 0x0.0p+0, 0x0.0000000000001p-1022, 0);
	return imprecise;
}
