1b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar//===-- divdc3_test.c - Test __divdc3 -------------------------------------===// 2b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// 3b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// The LLVM Compiler Infrastructure 4b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// 59ad441ffec97db647fee3725b3424284fb913e14Howard Hinnant// This file is dual licensed under the MIT and the University of Illinois Open 69ad441ffec97db647fee3725b3424284fb913e14Howard Hinnant// Source Licenses. See LICENSE.TXT for details. 7b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// 8b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar//===----------------------------------------------------------------------===// 9b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// 10b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// This file tests __divdc3 for the compiler_rt library. 11b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// 12b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar//===----------------------------------------------------------------------===// 13b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 14b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar#include "int_lib.h" 15b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar#include <math.h> 16b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar#include <complex.h> 17b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar#include <stdio.h> 18b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 19b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// Returns: the quotient of (a + ib) / (c + id) 20b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 21b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbardouble _Complex __divdc3(double __a, double __b, double __c, double __d); 22b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 23b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbarenum {zero, non_zero, inf, NaN, non_zero_nan}; 24b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 25b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbarint 26b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbarclassify(double _Complex x) 27b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar{ 28b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (x == 0) 29b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return zero; 30b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (isinf(creal(x)) || isinf(cimag(x))) 31b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return inf; 32b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (isnan(creal(x)) && isnan(cimag(x))) 33b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return NaN; 34b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (isnan(creal(x))) 35b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 36b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (cimag(x) == 0) 37b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return NaN; 38b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return non_zero_nan; 39b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 40b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (isnan(cimag(x))) 41b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 42b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (creal(x) == 0) 43b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return NaN; 44b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return non_zero_nan; 45b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 46b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return non_zero; 47b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar} 48b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 49b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbarint test__divdc3(double a, double b, double c, double d) 50b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar{ 51b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar double _Complex r = __divdc3(a, b, c, d); 52b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// printf("test__divdc3(%f, %f, %f, %f) = %f + I%f\n", 53b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar// a, b, c, d, creal(r), cimag(r)); 54b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar double _Complex dividend; 55b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar double _Complex divisor; 56b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 57b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar __real__ dividend = a; 58b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar __imag__ dividend = b; 59b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar __real__ divisor = c; 60b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar __imag__ divisor = d; 61b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 62b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar switch (classify(dividend)) 63b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 64b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case zero: 65b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar switch (classify(divisor)) 66b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 67b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case zero: 68b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 69b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 70b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 71b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero: 72b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != zero) 73b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 74b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 75b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case inf: 76b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != zero) 77b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 78b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 79b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case NaN: 80b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 81b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 82b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 83b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero_nan: 84b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 85b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 86b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 87b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 88b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 89b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero: 90b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar switch (classify(divisor)) 91b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 92b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case zero: 93b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != inf) 94b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 95b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 96b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero: 97b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != non_zero) 98b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 99b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 100b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar double _Complex z = (a * c + b * d) / (c * c + d * d) 101b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar + (b * c - a * d) / (c * c + d * d) * _Complex_I; 102b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (cabs((r-z)/r) > 1.e-6) 103b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 104b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 105b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 106b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case inf: 107b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != zero) 108b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 109b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 110b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case NaN: 111b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 112b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 113b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 114b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero_nan: 115b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 116b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 117b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 118b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 119b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 120b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case inf: 121b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar switch (classify(divisor)) 122b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 123b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case zero: 124b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != inf) 125b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 126b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 127b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero: 128b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != inf) 129b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 130b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 131b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case inf: 132b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 133b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 134b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 135b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case NaN: 136b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 137b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 138b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 139b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero_nan: 140b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 141b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 142b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 143b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 144b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 145b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case NaN: 146b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar switch (classify(divisor)) 147b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 148b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case zero: 149b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 150b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 151b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 152b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero: 153b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 154b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 155b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 156b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case inf: 157b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 158b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 159b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 160b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case NaN: 161b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 162b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 163b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 164b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero_nan: 165b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 166b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 167b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 168b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 169b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 170b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero_nan: 171b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar switch (classify(divisor)) 172b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 173b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case zero: 174b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != inf) 175b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 176b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 177b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero: 178b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 179b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 180b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 181b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case inf: 182b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 183b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 184b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 185b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case NaN: 186b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 187b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 188b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 189b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar case non_zero_nan: 190b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (classify(r) != NaN) 191b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 192b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 193b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 194b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar break; 195b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 196b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 197b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 0; 198b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar} 199b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 200b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbardouble x[][2] = 201b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar{ 202b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e-6, 1.e-6}, 203b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e-6, 1.e-6}, 204b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e-6, -1.e-6}, 205b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e-6, -1.e-6}, 206b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 207b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e+6, 1.e-6}, 208b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e+6, 1.e-6}, 209b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e+6, -1.e-6}, 210b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e+6, -1.e-6}, 211b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 212b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e-6, 1.e+6}, 213b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e-6, 1.e+6}, 214b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e-6, -1.e+6}, 215b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e-6, -1.e+6}, 216b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 217b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e+6, 1.e+6}, 218b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e+6, 1.e+6}, 219b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1.e+6, -1.e+6}, 220b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 1.e+6, -1.e+6}, 221b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 222b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, NAN}, 223b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, NAN}, 224b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, NAN}, 225b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, NAN}, 226b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, NAN}, 227b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., NAN}, 228b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., NAN}, 229b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, NAN}, 230b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, NAN}, 231b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, NAN}, 232b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, NAN}, 233b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 234b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, -INFINITY}, 235b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, -INFINITY}, 236b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, -INFINITY}, 237b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, -INFINITY}, 238b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, -INFINITY}, 239b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., -INFINITY}, 240b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., -INFINITY}, 241b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, -INFINITY}, 242b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, -INFINITY}, 243b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, -INFINITY}, 244b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, -INFINITY}, 245b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 246b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, -2}, 247b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, -2}, 248b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, -2}, 249b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, -2}, 250b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, -2}, 251b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., -2}, 252b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., -2}, 253b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, -2}, 254b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, -2}, 255b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, -2}, 256b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, -2}, 257b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 258b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, -1}, 259b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, -1}, 260b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, -1}, 261b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, -1}, 262b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, -1}, 263b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., -1}, 264b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., -1}, 265b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, -1}, 266b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, -1}, 267b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, -1}, 268b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, -1}, 269b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 270b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, -0.5}, 271b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, -0.5}, 272b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, -0.5}, 273b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, -0.5}, 274b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, -0.5}, 275b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., -0.5}, 276b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., -0.5}, 277b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, -0.5}, 278b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, -0.5}, 279b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, -0.5}, 280b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, -0.5}, 281b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 282b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, -0.}, 283b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, -0.}, 284b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, -0.}, 285b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, -0.}, 286b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, -0.}, 287b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., -0.}, 288b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., -0.}, 289b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, -0.}, 290b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, -0.}, 291b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, -0.}, 292b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, -0.}, 293b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 294b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, 0.}, 295b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, 0.}, 296b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, 0.}, 297b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, 0.}, 298b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, 0.}, 299b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., 0.}, 300b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., 0.}, 301b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, 0.}, 302b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, 0.}, 303b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, 0.}, 304b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, 0.}, 305b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 306b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, 0.5}, 307b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, 0.5}, 308b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, 0.5}, 309b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, 0.5}, 310b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, 0.5}, 311b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., 0.5}, 312b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., 0.5}, 313b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, 0.5}, 314b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, 0.5}, 315b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, 0.5}, 316b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, 0.5}, 317b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 318b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, 1}, 319b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, 1}, 320b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, 1}, 321b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, 1}, 322b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, 1}, 323b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., 1}, 324b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., 1}, 325b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, 1}, 326b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, 1}, 327b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, 1}, 328b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, 1}, 329b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 330b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, 2}, 331b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, 2}, 332b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, 2}, 333b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, 2}, 334b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, 2}, 335b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., 2}, 336b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., 2}, 337b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, 2}, 338b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, 2}, 339b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, 2}, 340b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, 2}, 341b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 342b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {NAN, INFINITY}, 343b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-INFINITY, INFINITY}, 344b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-2, INFINITY}, 345b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-1, INFINITY}, 346b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0.5, INFINITY}, 347b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {-0., INFINITY}, 348b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {+0., INFINITY}, 349b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {0.5, INFINITY}, 350b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {1, INFINITY}, 351b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {2, INFINITY}, 352b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar {INFINITY, INFINITY} 353b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 354b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar}; 355b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 356b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbarint main() 357b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar{ 358b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar const unsigned N = sizeof(x) / sizeof(x[0]); 359b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar unsigned i, j; 360b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar for (i = 0; i < N; ++i) 361b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 362b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar for (j = 0; j < N; ++j) 363b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar { 364b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar if (test__divdc3(x[i][0], x[i][1], x[j][0], x[j][1])) 365b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 1; 366b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 367b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar } 368b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar 369b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar return 0; 370b3a6901e66f55b35aa9e01bcb24134e6a65ea004Daniel Dunbar} 371