123 #include <fpu_control.h>
142 #define REALPRINT doubleprint
143 #define REALRAND doublerand
144 #define NARROWRAND narrowdoublerand
145 #define UNIFORMRAND uniformdoublerand
153 #define Absolute(a) ((a) >= 0.0 ? (a) : -(a))
169 #define Fast_Two_Sum_Tail(a, b, x, y) \
173 #define Fast_Two_Sum(a, b, x, y) \
174 x = (REAL) (a + b); \
175 Fast_Two_Sum_Tail(a, b, x, y)
177 #define Fast_Two_Diff_Tail(a, b, x, y) \
181 #define Fast_Two_Diff(a, b, x, y) \
182 x = (REAL) (a - b); \
183 Fast_Two_Diff_Tail(a, b, x, y)
185 #define Two_Sum_Tail(a, b, x, y) \
186 bvirt = (REAL) (x - a); \
188 bround = b - bvirt; \
189 around = a - avirt; \
192 #define Two_Sum(a, b, x, y) \
193 x = (REAL) (a + b); \
194 Two_Sum_Tail(a, b, x, y)
196 #define Two_Diff_Tail(a, b, x, y) \
197 bvirt = (REAL) (a - x); \
199 bround = bvirt - b; \
200 around = a - avirt; \
203 #define Two_Diff(a, b, x, y) \
204 x = (REAL) (a - b); \
205 Two_Diff_Tail(a, b, x, y)
207 #define Split(a, ahi, alo) \
208 c = (REAL) (splitter * a); \
209 abig = (REAL) (c - a); \
213 #define Two_Product_Tail(a, b, x, y) \
214 Split(a, ahi, alo); \
215 Split(b, bhi, blo); \
216 err1 = x - (ahi * bhi); \
217 err2 = err1 - (alo * bhi); \
218 err3 = err2 - (ahi * blo); \
219 y = (alo * blo) - err3
221 #define Two_Product(a, b, x, y) \
222 x = (REAL) (a * b); \
223 Two_Product_Tail(a, b, x, y)
228 #define Two_Product_Presplit(a, b, bhi, blo, x, y) \
229 x = (REAL) (a * b); \
230 Split(a, ahi, alo); \
231 err1 = x - (ahi * bhi); \
232 err2 = err1 - (alo * bhi); \
233 err3 = err2 - (ahi * blo); \
234 y = (alo * blo) - err3
239 #define Two_Product_2Presplit(a, ahi, alo, b, bhi, blo, x, y) \
240 x = (REAL) (a * b); \
241 err1 = x - (ahi * bhi); \
242 err2 = err1 - (alo * bhi); \
243 err3 = err2 - (ahi * blo); \
244 y = (alo * blo) - err3
248 #define Square_Tail(a, x, y) \
249 Split(a, ahi, alo); \
250 err1 = x - (ahi * ahi); \
251 err3 = err1 - ((ahi + ahi) * alo); \
252 y = (alo * alo) - err3
254 #define Square(a, x, y) \
255 x = (REAL) (a * a); \
261 #define Two_One_Sum(a1, a0, b, x2, x1, x0) \
262 Two_Sum(a0, b , _i, x0); \
263 Two_Sum(a1, _i, x2, x1)
265 #define Two_One_Diff(a1, a0, b, x2, x1, x0) \
266 Two_Diff(a0, b , _i, x0); \
267 Two_Sum( a1, _i, x2, x1)
269 #define Two_Two_Sum(a1, a0, b1, b0, x3, x2, x1, x0) \
270 Two_One_Sum(a1, a0, b0, _j, _0, x0); \
271 Two_One_Sum(_j, _0, b1, x3, x2, x1)
273 #define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0) \
274 Two_One_Diff(a1, a0, b0, _j, _0, x0); \
275 Two_One_Diff(_j, _0, b1, x3, x2, x1)
277 #define Four_One_Sum(a3, a2, a1, a0, b, x4, x3, x2, x1, x0) \
278 Two_One_Sum(a1, a0, b , _j, x1, x0); \
279 Two_One_Sum(a3, a2, _j, x4, x3, x2)
281 #define Four_Two_Sum(a3, a2, a1, a0, b1, b0, x5, x4, x3, x2, x1, x0) \
282 Four_One_Sum(a3, a2, a1, a0, b0, _k, _2, _1, _0, x0); \
283 Four_One_Sum(_k, _2, _1, _0, b1, x5, x4, x3, x2, x1)
285 #define Four_Four_Sum(a3, a2, a1, a0, b4, b3, b1, b0, x7, x6, x5, x4, x3, x2, \
287 Four_Two_Sum(a3, a2, a1, a0, b1, b0, _l, _2, _1, _0, x1, x0); \
288 Four_Two_Sum(_l, _2, _1, _0, b4, b3, x7, x6, x5, x4, x3, x2)
290 #define Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b, x8, x7, x6, x5, x4, \
292 Four_One_Sum(a3, a2, a1, a0, b , _j, x3, x2, x1, x0); \
293 Four_One_Sum(a7, a6, a5, a4, _j, x8, x7, x6, x5, x4)
295 #define Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, x9, x8, x7, \
296 x6, x5, x4, x3, x2, x1, x0) \
297 Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b0, _k, _6, _5, _4, _3, _2, \
299 Eight_One_Sum(_k, _6, _5, _4, _3, _2, _1, _0, b1, x9, x8, x7, x6, x5, x4, \
302 #define Eight_Four_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b4, b3, b1, b0, x11, \
303 x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0) \
304 Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, _l, _6, _5, _4, _3, \
305 _2, _1, _0, x1, x0); \
306 Eight_Two_Sum(_l, _6, _5, _4, _3, _2, _1, _0, b4, b3, x11, x10, x9, x8, \
307 x7, x6, x5, x4, x3, x2)
311 #define Two_One_Product(a1, a0, b, x3, x2, x1, x0) \
312 Split(b, bhi, blo); \
313 Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \
314 Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \
315 Two_Sum(_i, _0, _k, x1); \
316 Fast_Two_Sum(_j, _k, x3, x2)
318 #define Four_One_Product(a3, a2, a1, a0, b, x7, x6, x5, x4, x3, x2, x1, x0) \
319 Split(b, bhi, blo); \
320 Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \
321 Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \
322 Two_Sum(_i, _0, _k, x1); \
323 Fast_Two_Sum(_j, _k, _i, x2); \
324 Two_Product_Presplit(a2, b, bhi, blo, _j, _0); \
325 Two_Sum(_i, _0, _k, x3); \
326 Fast_Two_Sum(_j, _k, _i, x4); \
327 Two_Product_Presplit(a3, b, bhi, blo, _j, _0); \
328 Two_Sum(_i, _0, _k, x5); \
329 Fast_Two_Sum(_j, _k, x7, x6)
331 #define Two_Two_Product(a1, a0, b1, b0, x7, x6, x5, x4, x3, x2, x1, x0) \
332 Split(a0, a0hi, a0lo); \
333 Split(b0, bhi, blo); \
334 Two_Product_2Presplit(a0, a0hi, a0lo, b0, bhi, blo, _i, x0); \
335 Split(a1, a1hi, a1lo); \
336 Two_Product_2Presplit(a1, a1hi, a1lo, b0, bhi, blo, _j, _0); \
337 Two_Sum(_i, _0, _k, _1); \
338 Fast_Two_Sum(_j, _k, _l, _2); \
339 Split(b1, bhi, blo); \
340 Two_Product_2Presplit(a0, a0hi, a0lo, b1, bhi, blo, _i, _0); \
341 Two_Sum(_1, _0, _k, x1); \
342 Two_Sum(_2, _k, _j, _1); \
343 Two_Sum(_l, _j, _m, _2); \
344 Two_Product_2Presplit(a1, a1hi, a1lo, b1, bhi, blo, _j, _0); \
345 Two_Sum(_i, _0, _n, _0); \
346 Two_Sum(_1, _0, _i, x2); \
347 Two_Sum(_2, _i, _k, _1); \
348 Two_Sum(_m, _k, _l, _2); \
349 Two_Sum(_j, _n, _k, _0); \
350 Two_Sum(_1, _0, _j, x3); \
351 Two_Sum(_2, _j, _i, _1); \
352 Two_Sum(_l, _i, _m, _2); \
353 Two_Sum(_1, _k, _i, x4); \
354 Two_Sum(_2, _i, _k, x5); \
355 Two_Sum(_m, _k, x7, x6)
361 #define Two_Square(a1, a0, x5, x4, x3, x2, x1, x0) \
362 Square(a0, _j, x0); \
364 Two_Product(a1, _0, _k, _1); \
365 Two_One_Sum(_k, _1, _j, _l, _2, x1); \
366 Square(a1, _j, _1); \
367 Two_Two_Sum(_j, _1, _l, _2, x5, x4, x3, x2)
679 REAL check, lastcheck;
687 _control87(_PC_24, _MCW_PC);
689 _control87(_PC_53, _MCW_PC);
718 every_other = !every_other;
720 }
while ((check != 1.0) && (check != lastcheck));
744 half = maxx; maxx = maxz; maxz = half;
747 half = maxy; maxy = maxz; maxz = half;
749 else if (maxy < maxx) {
750 half = maxy; maxy = maxx; maxx = half;
753 ispstaticfilter = 1.2466136531027298e-13 * maxx * maxy * maxz * (maxz * maxz);
779 REAL avirt, bround, around;
782 for (eindex = 0; eindex < elen; eindex++) {
784 Two_Sum(Q, enow, Qnew, h[eindex]);
813 REAL avirt, bround, around;
817 for (eindex = 0; eindex < elen; eindex++) {
825 if ((Q != 0.0) || (hindex == 0)) {
849 int findex, hindex, hlast;
852 REAL avirt, bround, around;
855 for (hindex = 0; hindex < elen; hindex++) {
857 Two_Sum(Q, hnow, Qnew, h[hindex]);
862 for (findex = 1; findex < flen; findex++) {
864 for (hindex = findex; hindex <= hlast; hindex++) {
866 Two_Sum(Q, hnow, Qnew, h[hindex]);
893 int index, findex, hindex, hlast;
896 REAL avirt, bround, around;
899 for (hindex = 0; hindex < elen; hindex++) {
901 Two_Sum(Q, hnow, Qnew, h[hindex]);
906 for (findex = 1; findex < flen; findex++) {
908 for (hindex = findex; hindex <= hlast; hindex++) {
910 Two_Sum(Q, hnow, Qnew, h[hindex]);
916 for (index = 0; index <= hlast; index++) {
948 int eindex, findex, hindex, hlast;
951 REAL avirt, bround, around;
955 for (eindex = 0; eindex < elen; eindex++) {
965 for (findex = 1; findex < flen; findex++) {
968 for (eindex = 0; eindex <= hlast; eindex++) {
1001 REAL avirt, bround, around;
1002 int eindex, findex, hindex;
1007 eindex = findex = 0;
1008 if ((fnow > enow) == (fnow > -enow)) {
1016 if ((eindex < elen) && (findex < flen)) {
1017 if ((fnow > enow) == (fnow > -enow)) {
1026 while ((eindex < elen) && (findex < flen)) {
1027 if ((fnow > enow) == (fnow > -enow)) {
1028 Two_Sum(Q, enow, Qnew, h[hindex]);
1031 Two_Sum(Q, fnow, Qnew, h[hindex]);
1038 while (eindex < elen) {
1039 Two_Sum(Q, enow, Qnew, h[hindex]);
1044 while (findex < flen) {
1045 Two_Sum(Q, fnow, Qnew, h[hindex]);
1075 REAL avirt, bround, around;
1076 int eindex, findex, hindex;
1081 eindex = findex = 0;
1082 if ((fnow > enow) == (fnow > -enow)) {
1090 if ((eindex < elen) && (findex < flen)) {
1091 if ((fnow > enow) == (fnow > -enow)) {
1102 while ((eindex < elen) && (findex < flen)) {
1103 if ((fnow > enow) == (fnow > -enow)) {
1116 while (eindex < elen) {
1124 while (findex < flen) {
1132 if ((Q != 0.0) || (hindex == 0)) {
1156 REAL avirt, bround, around;
1157 int eindex, findex, hindex;
1163 eindex = findex = 0;
1164 if ((fnow > enow) == (fnow > -enow)) {
1171 if ((eindex < elen) && ((findex >= flen)
1172 || ((fnow > enow) == (fnow > -enow)))) {
1180 for (hindex = 0; hindex < elen + flen - 2; hindex++) {
1181 if ((eindex < elen) && ((findex >= flen)
1182 || ((fnow > enow) == (fnow > -enow)))) {
1217 REAL avirt, bround, around;
1218 int eindex, findex, hindex;
1225 eindex = findex = 0;
1227 if ((fnow > enow) == (fnow > -enow)) {
1234 if ((eindex < elen) && ((findex >= flen)
1235 || ((fnow > enow) == (fnow > -enow)))) {
1243 for (count = 2; count < elen + flen; count++) {
1244 if ((eindex < elen) && ((findex >= flen)
1245 || ((fnow > enow) == (fnow > -enow)))) {
1261 if ((Q != 0.0) || (hindex == 0)) {
1290 REAL avirt, bround, around;
1293 REAL ahi, alo, bhi, blo;
1294 REAL err1, err2, err3;
1299 for (eindex = 1; eindex < elen; eindex++) {
1302 Two_Sum(Q, product0, sum, h[hindex]);
1304 Two_Sum(product1, sum, Q, h[hindex]);
1336 REAL avirt, bround, around;
1339 REAL ahi, alo, bhi, blo;
1340 REAL err1, err2, err3;
1348 for (eindex = 1; eindex < elen; eindex++) {
1351 Two_Sum(Q, product0, sum, hh);
1360 if ((Q != 0.0) || (hindex == 0)) {
1390 for (eindex = elen - 2; eindex >= 0; eindex--) {
1401 for (hindex = bottom + 1; hindex < elen; hindex++) {
1427 for (eindex = 1; eindex < elen; eindex++) {
1461 REAL acx, bcx, acy, bcy;
1463 acx = pa[0] - pc[0];
1464 bcx = pb[0] - pc[0];
1465 acy = pa[1] - pc[1];
1466 bcy = pb[1] - pc[1];
1467 return acx * bcy - acy * bcx;
1472 INEXACT REAL axby1, axcy1, bxcy1, bxay1, cxay1, cxby1;
1473 REAL axby0, axcy0, bxcy0, bxay0, cxay0, cxby0;
1474 REAL aterms[4], bterms[4], cterms[4];
1480 REAL avirt, bround, around;
1483 REAL ahi, alo, bhi, blo;
1484 REAL err1, err2, err3;
1491 aterms3, aterms[2], aterms[1], aterms[0]);
1492 aterms[3] = aterms3;
1497 bterms3, bterms[2], bterms[1], bterms[0]);
1498 bterms[3] = bterms3;
1503 cterms3, cterms[2], cterms[1], cterms[0]);
1504 cterms[3] = cterms3;
1509 return w[wlength - 1];
1515 REAL acxtail, acytail;
1516 REAL bcxtail, bcytail;
1517 REAL negate, negatetail;
1518 REAL axby[8], bxay[8];
1524 REAL avirt, bround, around;
1527 REAL a0hi, a0lo, a1hi, a1lo, bhi, blo;
1528 REAL err1, err2, err3;
1532 Two_Diff(pa[0], pc[0], acx, acxtail);
1533 Two_Diff(pa[1], pc[1], acy, acytail);
1534 Two_Diff(pb[0], pc[0], bcx, bcxtail);
1535 Two_Diff(pb[1], pc[1], bcy, bcytail);
1538 axby7, axby[6], axby[5], axby[4],
1539 axby[3], axby[2], axby[1], axby[0]);
1542 negatetail = -acytail;
1544 bxay7, bxay[6], bxay[5], bxay[4],
1545 bxay[3], bxay[2], bxay[1], bxay[0]);
1550 return deter[deterlen - 1];
1556 REAL acxtail, acytail, bcxtail, bcytail;
1558 REAL detlefttail, detrighttail;
1560 REAL B[4], C1[8], C2[12],
D[16];
1562 int C1length, C2length, Dlength;
1569 REAL avirt, bround, around;
1572 REAL ahi, alo, bhi, blo;
1573 REAL err1, err2, err3;
1577 acx = (
REAL) (pa[0] - pc[0]);
1578 bcx = (
REAL) (pb[0] - pc[0]);
1579 acy = (
REAL) (pa[1] - pc[1]);
1580 bcy = (
REAL) (pb[1] - pc[1]);
1585 Two_Two_Diff(detleft, detlefttail, detright, detrighttail,
1586 B3, B[2], B[1], B[0]);
1591 if ((det >= errbound) || (-det >= errbound)) {
1600 if ((acxtail == 0.0) && (acytail == 0.0)
1601 && (bcxtail == 0.0) && (bcytail == 0.0)) {
1606 det += (acx * bcytail + bcy * acxtail)
1607 - (acy * bcxtail + bcx * acytail);
1608 if ((det >= errbound) || (-det >= errbound)) {
1630 return(
D[Dlength - 1]);
1635 REAL detleft, detright, det;
1636 REAL detsum, errbound;
1638 detleft = (pa[0] - pc[0]) * (pb[1] - pc[1]);
1639 detright = (pa[1] - pc[1]) * (pb[0] - pc[0]);
1640 det = detleft - detright;
1642 if (detleft > 0.0) {
1643 if (detright <= 0.0) {
1646 detsum = detleft + detright;
1648 }
else if (detleft < 0.0) {
1649 if (detright >= 0.0) {
1652 detsum = -detleft - detright;
1659 if ((det >= errbound) || (-det >= errbound)) {
1701 adx = pa[0] - pd[0];
1702 bdx = pb[0] - pd[0];
1703 cdx = pc[0] - pd[0];
1704 ady = pa[1] - pd[1];
1705 bdy = pb[1] - pd[1];
1706 cdy = pc[1] - pd[1];
1707 adz = pa[2] - pd[2];
1708 bdz = pb[2] - pd[2];
1709 cdz = pc[2] - pd[2];
1711 return adx * (bdy * cdz - bdz * cdy)
1712 + bdx * (cdy * adz - cdz * ady)
1713 + cdx * (ady * bdz - adz * bdy);
1718 INEXACT REAL axby1, bxcy1, cxdy1, dxay1, axcy1, bxdy1;
1719 INEXACT REAL bxay1, cxby1, dxcy1, axdy1, cxay1, dxby1;
1720 REAL axby0, bxcy0, cxdy0, dxay0, axcy0, bxdy0;
1721 REAL bxay0, cxby0, dxcy0, axdy0, cxay0, dxby0;
1722 REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4];
1725 REAL abc[12], bcd[12], cda[12], dab[12];
1726 int abclen, bcdlen, cdalen, dablen;
1727 REAL adet[24], bdet[24], cdet[24], ddet[24];
1728 int alen, blen, clen, dlen;
1729 REAL abdet[48], cddet[48];
1736 REAL avirt, bround, around;
1739 REAL ahi, alo, bhi, blo;
1740 REAL err1, err2, err3;
1746 Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]);
1750 Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]);
1754 Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]);
1758 Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]);
1762 Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]);
1766 Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]);
1772 for (i = 0; i < 4; i++) {
1790 return deter[deterlen - 1];
1795 INEXACT REAL adx, ady, adz, bdx, bdy, bdz, cdx, cdy, cdz;
1796 REAL adxtail, adytail, adztail;
1797 REAL bdxtail, bdytail, bdztail;
1798 REAL cdxtail, cdytail, cdztail;
1799 REAL negate, negatetail;
1800 INEXACT REAL axby7, bxcy7, axcy7, bxay7, cxby7, cxay7;
1801 REAL axby[8], bxcy[8], axcy[8], bxay[8], cxby[8], cxay[8];
1802 REAL temp16[16], temp32[32], temp32t[32];
1803 int temp16len, temp32len, temp32tlen;
1804 REAL adet[64], bdet[64], cdet[64];
1805 int alen, blen, clen;
1812 REAL avirt, bround, around;
1815 REAL a0hi, a0lo, a1hi, a1lo, bhi, blo;
1816 REAL err1, err2, err3;
1820 Two_Diff(pa[0], pd[0], adx, adxtail);
1821 Two_Diff(pa[1], pd[1], ady, adytail);
1822 Two_Diff(pa[2], pd[2], adz, adztail);
1823 Two_Diff(pb[0], pd[0], bdx, bdxtail);
1824 Two_Diff(pb[1], pd[1], bdy, bdytail);
1825 Two_Diff(pb[2], pd[2], bdz, bdztail);
1826 Two_Diff(pc[0], pd[0], cdx, cdxtail);
1827 Two_Diff(pc[1], pd[1], cdy, cdytail);
1828 Two_Diff(pc[2], pd[2], cdz, cdztail);
1831 axby7, axby[6], axby[5], axby[4],
1832 axby[3], axby[2], axby[1], axby[0]);
1835 negatetail = -adytail;
1837 bxay7, bxay[6], bxay[5], bxay[4],
1838 bxay[3], bxay[2], bxay[1], bxay[0]);
1841 bxcy7, bxcy[6], bxcy[5], bxcy[4],
1842 bxcy[3], bxcy[2], bxcy[1], bxcy[0]);
1845 negatetail = -bdytail;
1847 cxby7, cxby[6], cxby[5], cxby[4],
1848 cxby[3], cxby[2], cxby[1], cxby[0]);
1851 cxay7, cxay[6], cxay[5], cxay[4],
1852 cxay[3], cxay[2], cxay[1], cxay[0]);
1855 negatetail = -cdytail;
1857 axcy7, axcy[6], axcy[5], axcy[4],
1858 axcy[3], axcy[2], axcy[1], axcy[0]);
1882 return deter[deterlen - 1];
1887 INEXACT REAL adx, bdx, cdx, ady, bdy, cdy, adz, bdz, cdz;
1890 INEXACT REAL bdxcdy1, cdxbdy1, cdxady1, adxcdy1, adxbdy1, bdxady1;
1891 REAL bdxcdy0, cdxbdy0, cdxady0, adxcdy0, adxbdy0, bdxady0;
1892 REAL bc[4], ca[4], ab[4];
1894 REAL adet[8], bdet[8], cdet[8];
1895 int alen, blen, clen;
1898 REAL *finnow, *finother, *finswap;
1899 REAL fin1[192], fin2[192];
1905 for (i = 0; i < 8; i++) {
1906 adet[i] = bdet[i] = cdet[i] = 0.0;
1908 for (i = 0; i < 16; i++) {
1913 REAL adxtail, bdxtail, cdxtail;
1914 REAL adytail, bdytail, cdytail;
1915 REAL adztail, bdztail, cdztail;
1919 REAL at_b[4], at_c[4], bt_c[4], bt_a[4], ct_a[4], ct_b[4];
1920 int at_blen, at_clen, bt_clen, bt_alen, ct_alen, ct_blen;
1923 REAL bdxt_cdy0, cdxt_bdy0, cdxt_ady0;
1924 REAL adxt_cdy0, adxt_bdy0, bdxt_ady0;
1927 REAL bdyt_cdx0, cdyt_bdx0, cdyt_adx0;
1928 REAL adyt_cdx0, adyt_bdx0, bdyt_adx0;
1929 REAL bct[8], cat[8], abt[8];
1930 int bctlen, catlen, abtlen;
1933 REAL bdxt_cdyt0, cdxt_bdyt0, cdxt_adyt0;
1934 REAL adxt_cdyt0, adxt_bdyt0, bdxt_adyt0;
1935 REAL u[4], v[12], w[16];
1941 REAL avirt, bround, around;
1944 REAL ahi, alo, bhi, blo;
1945 REAL err1, err2, err3;
1949 adx = (
REAL) (pa[0] - pd[0]);
1950 bdx = (
REAL) (pb[0] - pd[0]);
1951 cdx = (
REAL) (pc[0] - pd[0]);
1952 ady = (
REAL) (pa[1] - pd[1]);
1953 bdy = (
REAL) (pb[1] - pd[1]);
1954 cdy = (
REAL) (pc[1] - pd[1]);
1955 adz = (
REAL) (pa[2] - pd[2]);
1956 bdz = (
REAL) (pb[2] - pd[2]);
1957 cdz = (
REAL) (pc[2] - pd[2]);
1961 Two_Two_Diff(bdxcdy1, bdxcdy0, cdxbdy1, cdxbdy0, bc3, bc[2], bc[1], bc[0]);
1967 Two_Two_Diff(cdxady1, cdxady0, adxcdy1, adxcdy0, ca3, ca[2], ca[1], ca[0]);
1973 Two_Two_Diff(adxbdy1, adxbdy0, bdxady1, bdxady0, ab3, ab[2], ab[1], ab[0]);
1982 if ((det >= errbound) || (-det >= errbound)) {
1996 if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0)
1997 && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0)
1998 && (adztail == 0.0) && (bdztail == 0.0) && (cdztail == 0.0)) {
2003 det += (adz * ((bdx * cdytail + cdy * bdxtail)
2004 - (bdy * cdxtail + cdx * bdytail))
2005 + adztail * (bdx * cdy - bdy * cdx))
2006 + (bdz * ((cdx * adytail + ady * cdxtail)
2007 - (cdy * adxtail + adx * cdytail))
2008 + bdztail * (cdx * ady - cdy * adx))
2009 + (cdz * ((adx * bdytail + bdy * adxtail)
2010 - (ady * bdxtail + bdx * adytail))
2011 + cdztail * (adx * bdy - ady * bdx));
2012 if ((det >= errbound) || (-det >= errbound)) {
2019 if (adxtail == 0.0) {
2020 if (adytail == 0.0) {
2028 at_b[1] = at_blarge;
2031 at_c[1] = at_clarge;
2035 if (adytail == 0.0) {
2037 at_b[1] = at_blarge;
2041 at_c[1] = at_clarge;
2046 Two_Two_Diff(adxt_bdy1, adxt_bdy0, adyt_bdx1, adyt_bdx0,
2047 at_blarge, at_b[2], at_b[1], at_b[0]);
2048 at_b[3] = at_blarge;
2052 Two_Two_Diff(adyt_cdx1, adyt_cdx0, adxt_cdy1, adxt_cdy0,
2053 at_clarge, at_c[2], at_c[1], at_c[0]);
2054 at_c[3] = at_clarge;
2058 if (bdxtail == 0.0) {
2059 if (bdytail == 0.0) {
2067 bt_c[1] = bt_clarge;
2070 bt_a[1] = bt_alarge;
2074 if (bdytail == 0.0) {
2076 bt_c[1] = bt_clarge;
2080 bt_a[1] = bt_alarge;
2085 Two_Two_Diff(bdxt_cdy1, bdxt_cdy0, bdyt_cdx1, bdyt_cdx0,
2086 bt_clarge, bt_c[2], bt_c[1], bt_c[0]);
2087 bt_c[3] = bt_clarge;
2091 Two_Two_Diff(bdyt_adx1, bdyt_adx0, bdxt_ady1, bdxt_ady0,
2092 bt_alarge, bt_a[2], bt_a[1], bt_a[0]);
2093 bt_a[3] = bt_alarge;
2097 if (cdxtail == 0.0) {
2098 if (cdytail == 0.0) {
2106 ct_a[1] = ct_alarge;
2109 ct_b[1] = ct_blarge;
2113 if (cdytail == 0.0) {
2115 ct_a[1] = ct_alarge;
2119 ct_b[1] = ct_blarge;
2124 Two_Two_Diff(cdxt_ady1, cdxt_ady0, cdyt_adx1, cdyt_adx0,
2125 ct_alarge, ct_a[2], ct_a[1], ct_a[0]);
2126 ct_a[3] = ct_alarge;
2130 Two_Two_Diff(cdyt_bdx1, cdyt_bdx0, cdxt_bdy1, cdxt_bdy0,
2131 ct_blarge, ct_b[2], ct_b[1], ct_b[0]);
2132 ct_b[3] = ct_blarge;
2141 finswap = finnow; finnow = finother; finother = finswap;
2147 finswap = finnow; finnow = finother; finother = finswap;
2153 finswap = finnow; finnow = finother; finother = finswap;
2155 if (adztail != 0.0) {
2159 finswap = finnow; finnow = finother; finother = finswap;
2161 if (bdztail != 0.0) {
2165 finswap = finnow; finnow = finother; finother = finswap;
2167 if (cdztail != 0.0) {
2171 finswap = finnow; finnow = finother; finother = finswap;
2174 if (adxtail != 0.0) {
2175 if (bdytail != 0.0) {
2176 Two_Product(adxtail, bdytail, adxt_bdyt1, adxt_bdyt0);
2181 finswap = finnow; finnow = finother; finother = finswap;
2182 if (cdztail != 0.0) {
2183 Two_One_Product(adxt_bdyt1, adxt_bdyt0, cdztail, u3, u[2], u[1], u[0]);
2187 finswap = finnow; finnow = finother; finother = finswap;
2190 if (cdytail != 0.0) {
2192 Two_Product(negate, cdytail, adxt_cdyt1, adxt_cdyt0);
2197 finswap = finnow; finnow = finother; finother = finswap;
2198 if (bdztail != 0.0) {
2199 Two_One_Product(adxt_cdyt1, adxt_cdyt0, bdztail, u3, u[2], u[1], u[0]);
2203 finswap = finnow; finnow = finother; finother = finswap;
2207 if (bdxtail != 0.0) {
2208 if (cdytail != 0.0) {
2209 Two_Product(bdxtail, cdytail, bdxt_cdyt1, bdxt_cdyt0);
2214 finswap = finnow; finnow = finother; finother = finswap;
2215 if (adztail != 0.0) {
2216 Two_One_Product(bdxt_cdyt1, bdxt_cdyt0, adztail, u3, u[2], u[1], u[0]);
2220 finswap = finnow; finnow = finother; finother = finswap;
2223 if (adytail != 0.0) {
2225 Two_Product(negate, adytail, bdxt_adyt1, bdxt_adyt0);
2230 finswap = finnow; finnow = finother; finother = finswap;
2231 if (cdztail != 0.0) {
2232 Two_One_Product(bdxt_adyt1, bdxt_adyt0, cdztail, u3, u[2], u[1], u[0]);
2236 finswap = finnow; finnow = finother; finother = finswap;
2240 if (cdxtail != 0.0) {
2241 if (adytail != 0.0) {
2242 Two_Product(cdxtail, adytail, cdxt_adyt1, cdxt_adyt0);
2247 finswap = finnow; finnow = finother; finother = finswap;
2248 if (bdztail != 0.0) {
2249 Two_One_Product(cdxt_adyt1, cdxt_adyt0, bdztail, u3, u[2], u[1], u[0]);
2253 finswap = finnow; finnow = finother; finother = finswap;
2256 if (bdytail != 0.0) {
2258 Two_Product(negate, bdytail, cdxt_bdyt1, cdxt_bdyt0);
2263 finswap = finnow; finnow = finother; finother = finswap;
2264 if (adztail != 0.0) {
2265 Two_One_Product(cdxt_bdyt1, cdxt_bdyt0, adztail, u3, u[2], u[1], u[0]);
2269 finswap = finnow; finnow = finother; finother = finswap;
2274 if (adztail != 0.0) {
2278 finswap = finnow; finnow = finother; finother = finswap;
2280 if (bdztail != 0.0) {
2284 finswap = finnow; finnow = finother; finother = finswap;
2286 if (cdztail != 0.0) {
2290 finswap = finnow; finnow = finother; finother = finswap;
2293 return finnow[finlength - 1];
2296 #ifdef INEXACT_GEOM_PRED
2304 adx = pa[0] - pd[0];
2305 bdx = pb[0] - pd[0];
2306 cdx = pc[0] - pd[0];
2307 ady = pa[1] - pd[1];
2308 bdy = pb[1] - pd[1];
2309 cdy = pc[1] - pd[1];
2310 adz = pa[2] - pd[2];
2311 bdz = pb[2] - pd[2];
2312 cdz = pc[2] - pd[2];
2314 return adx * (bdy * cdz - bdz * cdy)
2315 + bdx * (cdy * adz - cdz * ady)
2316 + cdx * (ady * bdz - adz * bdy);
2323 REAL adx, bdx, cdx, ady, bdy, cdy, adz, bdz, cdz;
2324 REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady;
2326 REAL permanent, errbound;
2328 adx = pa[0] - pd[0];
2329 bdx = pb[0] - pd[0];
2330 cdx = pc[0] - pd[0];
2331 ady = pa[1] - pd[1];
2332 bdy = pb[1] - pd[1];
2333 cdy = pc[1] - pd[1];
2334 adz = pa[2] - pd[2];
2335 bdz = pb[2] - pd[2];
2336 cdz = pc[2] - pd[2];
2347 det = adz * (bdxcdy - cdxbdy)
2348 + bdz * (cdxady - adxcdy)
2349 + cdz * (adxbdy - bdxady);
2361 if ((det > errbound) || (-det > errbound)) {
2368 #endif // ifdef INEXACT_GEOM_PRED
2398 REAL adx, ady, bdx, bdy, cdx, cdy;
2399 REAL abdet, bcdet, cadet;
2400 REAL alift, blift, clift;
2402 adx = pa[0] - pd[0];
2403 ady = pa[1] - pd[1];
2404 bdx = pb[0] - pd[0];
2405 bdy = pb[1] - pd[1];
2406 cdx = pc[0] - pd[0];
2407 cdy = pc[1] - pd[1];
2409 abdet = adx * bdy - bdx * ady;
2410 bcdet = bdx * cdy - cdx * bdy;
2411 cadet = cdx * ady - adx * cdy;
2412 alift = adx * adx + ady * ady;
2413 blift = bdx * bdx + bdy * bdy;
2414 clift = cdx * cdx + cdy * cdy;
2416 return alift * bcdet + blift * cadet + clift * abdet;
2421 INEXACT REAL axby1, bxcy1, cxdy1, dxay1, axcy1, bxdy1;
2422 INEXACT REAL bxay1, cxby1, dxcy1, axdy1, cxay1, dxby1;
2423 REAL axby0, bxcy0, cxdy0, dxay0, axcy0, bxdy0;
2424 REAL bxay0, cxby0, dxcy0, axdy0, cxay0, dxby0;
2425 REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4];
2428 REAL abc[12], bcd[12], cda[12], dab[12];
2429 int abclen, bcdlen, cdalen, dablen;
2430 REAL det24x[24], det24y[24], det48x[48], det48y[48];
2432 REAL adet[96], bdet[96], cdet[96], ddet[96];
2433 int alen, blen, clen, dlen;
2434 REAL abdet[192], cddet[192];
2441 REAL avirt, bround, around;
2444 REAL ahi, alo, bhi, blo;
2445 REAL err1, err2, err3;
2451 Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]);
2455 Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]);
2459 Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]);
2463 Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]);
2467 Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]);
2471 Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]);
2477 for (i = 0; i < 4; i++) {
2514 return deter[deterlen - 1];
2520 REAL adxtail, bdxtail, cdxtail;
2521 REAL adytail, bdytail, cdytail;
2522 REAL negate, negatetail;
2523 INEXACT REAL axby7, bxcy7, axcy7, bxay7, cxby7, cxay7;
2524 REAL axby[8], bxcy[8], axcy[8], bxay[8], cxby[8], cxay[8];
2527 REAL detx[32], detxx[64], detxt[32], detxxt[64], detxtxt[64];
2528 int xlen, xxlen, xtlen, xxtlen, xtxtlen;
2529 REAL x1[128], x2[192];
2531 REAL dety[32], detyy[64], detyt[32], detyyt[64], detytyt[64];
2532 int ylen, yylen, ytlen, yytlen, ytytlen;
2533 REAL y1[128], y2[192];
2535 REAL adet[384], bdet[384], cdet[384], abdet[768], deter[1152];
2536 int alen, blen, clen, ablen, deterlen;
2540 REAL avirt, bround, around;
2543 REAL a0hi, a0lo, a1hi, a1lo, bhi, blo;
2544 REAL err1, err2, err3;
2548 Two_Diff(pa[0], pd[0], adx, adxtail);
2549 Two_Diff(pa[1], pd[1], ady, adytail);
2550 Two_Diff(pb[0], pd[0], bdx, bdxtail);
2551 Two_Diff(pb[1], pd[1], bdy, bdytail);
2552 Two_Diff(pc[0], pd[0], cdx, cdxtail);
2553 Two_Diff(pc[1], pd[1], cdy, cdytail);
2556 axby7, axby[6], axby[5], axby[4],
2557 axby[3], axby[2], axby[1], axby[0]);
2560 negatetail = -adytail;
2562 bxay7, bxay[6], bxay[5], bxay[4],
2563 bxay[3], bxay[2], bxay[1], bxay[0]);
2566 bxcy7, bxcy[6], bxcy[5], bxcy[4],
2567 bxcy[3], bxcy[2], bxcy[1], bxcy[0]);
2570 negatetail = -bdytail;
2572 cxby7, cxby[6], cxby[5], cxby[4],
2573 cxby[3], cxby[2], cxby[1], cxby[0]);
2576 cxay7, cxay[6], cxay[5], cxay[4],
2577 cxay[3], cxay[2], cxay[1], cxay[0]);
2580 negatetail = -cdytail;
2582 axcy7, axcy[6], axcy[5], axcy[4],
2583 axcy[3], axcy[2], axcy[1], axcy[0]);
2593 for (i = 0; i < xxtlen; i++) {
2604 for (i = 0; i < yytlen; i++) {
2620 for (i = 0; i < xxtlen; i++) {
2631 for (i = 0; i < yytlen; i++) {
2647 for (i = 0; i < xxtlen; i++) {
2658 for (i = 0; i < yytlen; i++) {
2670 return deter[deterlen - 1];
2678 INEXACT REAL bdxcdy1, cdxbdy1, cdxady1, adxcdy1, adxbdy1, bdxady1;
2679 REAL bdxcdy0, cdxbdy0, cdxady0, adxcdy0, adxbdy0, bdxady0;
2680 REAL bc[4], ca[4], ab[4];
2682 REAL axbc[8], axxbc[16], aybc[8], ayybc[16], adet[32];
2683 int axbclen, axxbclen, aybclen, ayybclen, alen;
2684 REAL bxca[8], bxxca[16], byca[8], byyca[16], bdet[32];
2685 int bxcalen, bxxcalen, bycalen, byycalen, blen;
2686 REAL cxab[8], cxxab[16], cyab[8], cyyab[16], cdet[32];
2687 int cxablen, cxxablen, cyablen, cyyablen, clen;
2690 REAL fin1[1152], fin2[1152];
2691 REAL *finnow, *finother, *finswap;
2694 REAL adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail;
2695 INEXACT REAL adxadx1, adyady1, bdxbdx1, bdybdy1, cdxcdx1, cdycdy1;
2696 REAL adxadx0, adyady0, bdxbdx0, bdybdy0, cdxcdx0, cdycdy0;
2697 REAL aa[4], bb[4], cc[4];
2703 REAL temp8[8], temp16a[16], temp16b[16], temp16c[16];
2704 REAL temp32a[32], temp32b[32], temp48[48], temp64[64];
2705 int temp8len, temp16alen, temp16blen, temp16clen;
2706 int temp32alen, temp32blen, temp48len, temp64len;
2707 REAL axtbb[8], axtcc[8], aytbb[8], aytcc[8];
2708 int axtbblen, axtcclen, aytbblen, aytcclen;
2709 REAL bxtaa[8], bxtcc[8], bytaa[8], bytcc[8];
2710 int bxtaalen, bxtcclen, bytaalen, bytcclen;
2711 REAL cxtaa[8], cxtbb[8], cytaa[8], cytbb[8];
2712 int cxtaalen, cxtbblen, cytaalen, cytbblen;
2713 REAL axtbc[8], aytbc[8], bxtca[8], bytca[8], cxtab[8], cytab[8];
2714 int axtbclen, aytbclen, bxtcalen, bytcalen, cxtablen, cytablen;
2715 REAL axtbct[16], aytbct[16], bxtcat[16], bytcat[16], cxtabt[16], cytabt[16];
2716 int axtbctlen, aytbctlen, bxtcatlen, bytcatlen, cxtabtlen, cytabtlen;
2717 REAL axtbctt[8], aytbctt[8], bxtcatt[8];
2718 REAL bytcatt[8], cxtabtt[8], cytabtt[8];
2719 int axtbcttlen, aytbcttlen, bxtcattlen, bytcattlen, cxtabttlen, cytabttlen;
2720 REAL abt[8], bct[8], cat[8];
2721 int abtlen, bctlen, catlen;
2722 REAL abtt[4], bctt[4], catt[4];
2723 int abttlen, bcttlen, cattlen;
2728 REAL avirt, bround, around;
2731 REAL ahi, alo, bhi, blo;
2732 REAL err1, err2, err3;
2737 axtbclen = aytbclen = bxtcalen = bytcalen = cxtablen = cytablen = 0;
2739 adx = (
REAL) (pa[0] - pd[0]);
2740 bdx = (
REAL) (pb[0] - pd[0]);
2741 cdx = (
REAL) (pc[0] - pd[0]);
2742 ady = (
REAL) (pa[1] - pd[1]);
2743 bdy = (
REAL) (pb[1] - pd[1]);
2744 cdy = (
REAL) (pc[1] - pd[1]);
2748 Two_Two_Diff(bdxcdy1, bdxcdy0, cdxbdy1, cdxbdy0, bc3, bc[2], bc[1], bc[0]);
2758 Two_Two_Diff(cdxady1, cdxady0, adxcdy1, adxcdy0, ca3, ca[2], ca[1], ca[0]);
2768 Two_Two_Diff(adxbdy1, adxbdy0, bdxady1, bdxady0, ab3, ab[2], ab[1], ab[0]);
2781 if ((det >= errbound) || (-det >= errbound)) {
2791 if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0)
2792 && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0)) {
2797 det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail)
2798 - (bdy * cdxtail + cdx * bdytail))
2799 + 2.0 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx))
2800 + ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail)
2801 - (cdy * adxtail + adx * cdytail))
2802 + 2.0 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx))
2803 + ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail)
2804 - (ady * bdxtail + bdx * adytail))
2805 + 2.0 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx));
2806 if ((det >= errbound) || (-det >= errbound)) {
2813 if ((bdxtail != 0.0) || (bdytail != 0.0)
2814 || (cdxtail != 0.0) || (cdytail != 0.0)) {
2815 Square(adx, adxadx1, adxadx0);
2816 Square(ady, adyady1, adyady0);
2817 Two_Two_Sum(adxadx1, adxadx0, adyady1, adyady0, aa3, aa[2], aa[1], aa[0]);
2820 if ((cdxtail != 0.0) || (cdytail != 0.0)
2821 || (adxtail != 0.0) || (adytail != 0.0)) {
2822 Square(bdx, bdxbdx1, bdxbdx0);
2823 Square(bdy, bdybdy1, bdybdy0);
2824 Two_Two_Sum(bdxbdx1, bdxbdx0, bdybdy1, bdybdy0, bb3, bb[2], bb[1], bb[0]);
2827 if ((adxtail != 0.0) || (adytail != 0.0)
2828 || (bdxtail != 0.0) || (bdytail != 0.0)) {
2829 Square(cdx, cdxcdx1, cdxcdx0);
2830 Square(cdy, cdycdy1, cdycdy0);
2831 Two_Two_Sum(cdxcdx1, cdxcdx0, cdycdy1, cdycdy0, cc3, cc[2], cc[1], cc[0]);
2835 if (adxtail != 0.0) {
2847 temp16blen, temp16b, temp32a);
2849 temp32alen, temp32a, temp48);
2852 finswap = finnow; finnow = finother; finother = finswap;
2854 if (adytail != 0.0) {
2866 temp16blen, temp16b, temp32a);
2868 temp32alen, temp32a, temp48);
2871 finswap = finnow; finnow = finother; finother = finswap;
2873 if (bdxtail != 0.0) {
2885 temp16blen, temp16b, temp32a);
2887 temp32alen, temp32a, temp48);
2890 finswap = finnow; finnow = finother; finother = finswap;
2892 if (bdytail != 0.0) {
2904 temp16blen, temp16b, temp32a);
2906 temp32alen, temp32a, temp48);
2909 finswap = finnow; finnow = finother; finother = finswap;
2911 if (cdxtail != 0.0) {
2923 temp16blen, temp16b, temp32a);
2925 temp32alen, temp32a, temp48);
2928 finswap = finnow; finnow = finother; finother = finswap;
2930 if (cdytail != 0.0) {
2942 temp16blen, temp16b, temp32a);
2944 temp32alen, temp32a, temp48);
2947 finswap = finnow; finnow = finother; finother = finswap;
2950 if ((adxtail != 0.0) || (adytail != 0.0)) {
2951 if ((bdxtail != 0.0) || (bdytail != 0.0)
2952 || (cdxtail != 0.0) || (cdytail != 0.0)) {
2955 Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]);
2961 Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]);
2967 Two_Two_Diff(ti1, ti0, tj1, tj0, bctt3, bctt[2], bctt[1], bctt[0]);
2977 if (adxtail != 0.0) {
2983 temp32alen, temp32a, temp48);
2986 finswap = finnow; finnow = finother; finother = finswap;
2987 if (bdytail != 0.0) {
2993 finswap = finnow; finnow = finother; finother = finswap;
2995 if (cdytail != 0.0) {
3001 finswap = finnow; finnow = finother; finother = finswap;
3012 temp16blen, temp16b, temp32b);
3014 temp32blen, temp32b, temp64);
3017 finswap = finnow; finnow = finother; finother = finswap;
3019 if (adytail != 0.0) {
3025 temp32alen, temp32a, temp48);
3028 finswap = finnow; finnow = finother; finother = finswap;
3039 temp16blen, temp16b, temp32b);
3041 temp32blen, temp32b, temp64);
3044 finswap = finnow; finnow = finother; finother = finswap;
3047 if ((bdxtail != 0.0) || (bdytail != 0.0)) {
3048 if ((cdxtail != 0.0) || (cdytail != 0.0)
3049 || (adxtail != 0.0) || (adytail != 0.0)) {
3052 Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]);
3058 Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]);
3064 Two_Two_Diff(ti1, ti0, tj1, tj0, catt3, catt[2], catt[1], catt[0]);
3074 if (bdxtail != 0.0) {
3080 temp32alen, temp32a, temp48);
3083 finswap = finnow; finnow = finother; finother = finswap;
3084 if (cdytail != 0.0) {
3090 finswap = finnow; finnow = finother; finother = finswap;
3092 if (adytail != 0.0) {
3098 finswap = finnow; finnow = finother; finother = finswap;
3109 temp16blen, temp16b, temp32b);
3111 temp32blen, temp32b, temp64);
3114 finswap = finnow; finnow = finother; finother = finswap;
3116 if (bdytail != 0.0) {
3122 temp32alen, temp32a, temp48);
3125 finswap = finnow; finnow = finother; finother = finswap;
3136 temp16blen, temp16b, temp32b);
3138 temp32blen, temp32b, temp64);
3141 finswap = finnow; finnow = finother; finother = finswap;
3144 if ((cdxtail != 0.0) || (cdytail != 0.0)) {
3145 if ((adxtail != 0.0) || (adytail != 0.0)
3146 || (bdxtail != 0.0) || (bdytail != 0.0)) {
3149 Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]);
3155 Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]);
3161 Two_Two_Diff(ti1, ti0, tj1, tj0, abtt3, abtt[2], abtt[1], abtt[0]);
3171 if (cdxtail != 0.0) {
3177 temp32alen, temp32a, temp48);
3180 finswap = finnow; finnow = finother; finother = finswap;
3181 if (adytail != 0.0) {
3187 finswap = finnow; finnow = finother; finother = finswap;
3189 if (bdytail != 0.0) {
3195 finswap = finnow; finnow = finother; finother = finswap;
3206 temp16blen, temp16b, temp32b);
3208 temp32blen, temp32b, temp64);
3211 finswap = finnow; finnow = finother; finother = finswap;
3213 if (cdytail != 0.0) {
3219 temp32alen, temp32a, temp48);
3222 finswap = finnow; finnow = finother; finother = finswap;
3233 temp16blen, temp16b, temp32b);
3235 temp32blen, temp32b, temp64);
3238 finswap = finnow; finnow = finother; finother = finswap;
3242 return finnow[finlength - 1];
3247 REAL adx, bdx, cdx, ady, bdy, cdy;
3248 REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady;
3249 REAL alift, blift, clift;
3251 REAL permanent, errbound;
3253 adx = pa[0] - pd[0];
3254 bdx = pb[0] - pd[0];
3255 cdx = pc[0] - pd[0];
3256 ady = pa[1] - pd[1];
3257 bdy = pb[1] - pd[1];
3258 cdy = pc[1] - pd[1];
3262 alift = adx * adx + ady * ady;
3266 blift = bdx * bdx + bdy * bdy;
3270 clift = cdx * cdx + cdy * cdy;
3272 det = alift * (bdxcdy - cdxbdy)
3273 + blift * (cdxady - adxcdy)
3274 + clift * (adxbdy - bdxady);
3280 if ((det > errbound) || (-det > errbound)) {
3316 REAL aex, bex, cex, dex;
3317 REAL aey, bey, cey, dey;
3318 REAL aez, bez, cez, dez;
3319 REAL alift, blift, clift, dlift;
3320 REAL ab, bc, cd, da, ac, bd;
3321 REAL abc, bcd, cda, dab;
3323 aex = pa[0] - pe[0];
3324 bex = pb[0] - pe[0];
3325 cex = pc[0] - pe[0];
3326 dex = pd[0] - pe[0];
3327 aey = pa[1] - pe[1];
3328 bey = pb[1] - pe[1];
3329 cey = pc[1] - pe[1];
3330 dey = pd[1] - pe[1];
3331 aez = pa[2] - pe[2];
3332 bez = pb[2] - pe[2];
3333 cez = pc[2] - pe[2];
3334 dez = pd[2] - pe[2];
3336 ab = aex * bey - bex * aey;
3337 bc = bex * cey - cex * bey;
3338 cd = cex * dey - dex * cey;
3339 da = dex * aey - aex * dey;
3341 ac = aex * cey - cex * aey;
3342 bd = bex * dey - dex * bey;
3344 abc = aez * bc - bez * ac + cez * ab;
3345 bcd = bez * cd - cez * bd + dez * bc;
3346 cda = cez * da + dez * ac + aez * cd;
3347 dab = dez * ab + aez * bd + bez * da;
3349 alift = aex * aex + aey * aey + aez * aez;
3350 blift = bex * bex + bey * bey + bez * bez;
3351 clift = cex * cex + cey * cey + cez * cez;
3352 dlift = dex * dex + dey * dey + dez * dez;
3354 return (dlift * abc - clift * dab) + (blift * cda - alift * bcd);
3363 REAL axby0, bxcy0, cxdy0, dxey0, exay0;
3364 REAL bxay0, cxby0, dxcy0, exdy0, axey0;
3365 REAL axcy0, bxdy0, cxey0, dxay0, exby0;
3366 REAL cxay0, dxby0, excy0, axdy0, bxey0;
3367 REAL ab[4], bc[4], cd[4], de[4], ea[4];
3368 REAL ac[4], bd[4], ce[4], da[4], eb[4];
3369 REAL temp8a[8], temp8b[8], temp16[16];
3370 int temp8alen, temp8blen, temp16len;
3371 REAL abc[24], bcd[24], cde[24], dea[24], eab[24];
3372 REAL abd[24], bce[24], cda[24], deb[24], eac[24];
3373 int abclen, bcdlen, cdelen, dealen, eablen;
3374 int abdlen, bcelen, cdalen, deblen, eaclen;
3375 REAL temp48a[48], temp48b[48];
3376 int temp48alen, temp48blen;
3377 REAL abcd[96], bcde[96], cdea[96], deab[96], eabc[96];
3378 int abcdlen, bcdelen, cdealen, deablen, eabclen;
3380 REAL det384x[384], det384y[384], det384z[384];
3381 int xlen, ylen, zlen;
3384 REAL adet[1152], bdet[1152], cdet[1152], ddet[1152], edet[1152];
3385 int alen, blen, clen, dlen, elen;
3386 REAL abdet[2304], cddet[2304], cdedet[3456];
3393 REAL avirt, bround, around;
3396 REAL ahi, alo, bhi, blo;
3397 REAL err1, err2, err3;
3403 Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]);
3407 Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]);
3411 Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]);
3415 Two_Two_Diff(dxey1, dxey0, exdy1, exdy0, de[3], de[2], de[1], de[0]);
3419 Two_Two_Diff(exay1, exay0, axey1, axey0, ea[3], ea[2], ea[1], ea[0]);
3423 Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]);
3427 Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]);
3431 Two_Two_Diff(cxey1, cxey0, excy1, excy0, ce[3], ce[2], ce[1], ce[0]);
3435 Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]);
3439 Two_Two_Diff(exby1, exby0, bxey1, bxey0, eb[3], eb[2], eb[1], eb[0]);
3523 for (i = 0; i < temp48blen; i++) {
3524 temp48b[i] = -temp48b[i];
3527 temp48blen, temp48b, bcde);
3539 for (i = 0; i < temp48blen; i++) {
3540 temp48b[i] = -temp48b[i];
3543 temp48blen, temp48b, cdea);
3555 for (i = 0; i < temp48blen; i++) {
3556 temp48b[i] = -temp48b[i];
3559 temp48blen, temp48b, deab);
3571 for (i = 0; i < temp48blen; i++) {
3572 temp48b[i] = -temp48b[i];
3575 temp48blen, temp48b, eabc);
3587 for (i = 0; i < temp48blen; i++) {
3588 temp48b[i] = -temp48b[i];
3591 temp48blen, temp48b, abcd);
3606 return deter[deterlen - 1];
3611 INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez;
3612 REAL aextail, bextail, cextail, dextail;
3613 REAL aeytail, beytail, ceytail, deytail;
3614 REAL aeztail, beztail, ceztail, deztail;
3615 REAL negate, negatetail;
3616 INEXACT REAL axby7, bxcy7, cxdy7, dxay7, axcy7, bxdy7;
3617 INEXACT REAL bxay7, cxby7, dxcy7, axdy7, cxay7, dxby7;
3618 REAL axby[8], bxcy[8], cxdy[8], dxay[8], axcy[8], bxdy[8];
3619 REAL bxay[8], cxby[8], dxcy[8], axdy[8], cxay[8], dxby[8];
3620 REAL ab[16], bc[16], cd[16], da[16], ac[16], bd[16];
3621 int ablen, bclen, cdlen, dalen, aclen, bdlen;
3622 REAL temp32a[32], temp32b[32], temp64a[64], temp64b[64], temp64c[64];
3623 int temp32alen, temp32blen, temp64alen, temp64blen, temp64clen;
3624 REAL temp128[128], temp192[192];
3625 int temp128len, temp192len;
3626 REAL detx[384], detxx[768], detxt[384], detxxt[768], detxtxt[768];
3627 int xlen, xxlen, xtlen, xxtlen, xtxtlen;
3628 REAL x1[1536], x2[2304];
3630 REAL dety[384], detyy[768], detyt[384], detyyt[768], detytyt[768];
3631 int ylen, yylen, ytlen, yytlen, ytytlen;
3632 REAL y1[1536], y2[2304];
3634 REAL detz[384], detzz[768], detzt[384], detzzt[768], detztzt[768];
3635 int zlen, zzlen, ztlen, zztlen, ztztlen;
3636 REAL z1[1536], z2[2304];
3640 REAL adet[6912], bdet[6912], cdet[6912], ddet[6912];
3641 int alen, blen, clen, dlen;
3642 REAL abdet[13824], cddet[13824], deter[27648];
3647 REAL avirt, bround, around;
3650 REAL a0hi, a0lo, a1hi, a1lo, bhi, blo;
3651 REAL err1, err2, err3;
3655 Two_Diff(pa[0], pe[0], aex, aextail);
3656 Two_Diff(pa[1], pe[1], aey, aeytail);
3657 Two_Diff(pa[2], pe[2], aez, aeztail);
3658 Two_Diff(pb[0], pe[0], bex, bextail);
3659 Two_Diff(pb[1], pe[1], bey, beytail);
3660 Two_Diff(pb[2], pe[2], bez, beztail);
3661 Two_Diff(pc[0], pe[0], cex, cextail);
3662 Two_Diff(pc[1], pe[1], cey, ceytail);
3663 Two_Diff(pc[2], pe[2], cez, ceztail);
3664 Two_Diff(pd[0], pe[0], dex, dextail);
3665 Two_Diff(pd[1], pe[1], dey, deytail);
3666 Two_Diff(pd[2], pe[2], dez, deztail);
3669 axby7, axby[6], axby[5], axby[4],
3670 axby[3], axby[2], axby[1], axby[0]);
3673 negatetail = -aeytail;
3675 bxay7, bxay[6], bxay[5], bxay[4],
3676 bxay[3], bxay[2], bxay[1], bxay[0]);
3680 bxcy7, bxcy[6], bxcy[5], bxcy[4],
3681 bxcy[3], bxcy[2], bxcy[1], bxcy[0]);
3684 negatetail = -beytail;
3686 cxby7, cxby[6], cxby[5], cxby[4],
3687 cxby[3], cxby[2], cxby[1], cxby[0]);
3691 cxdy7, cxdy[6], cxdy[5], cxdy[4],
3692 cxdy[3], cxdy[2], cxdy[1], cxdy[0]);
3695 negatetail = -ceytail;
3697 dxcy7, dxcy[6], dxcy[5], dxcy[4],
3698 dxcy[3], dxcy[2], dxcy[1], dxcy[0]);
3702 dxay7, dxay[6], dxay[5], dxay[4],
3703 dxay[3], dxay[2], dxay[1], dxay[0]);
3706 negatetail = -deytail;
3708 axdy7, axdy[6], axdy[5], axdy[4],
3709 axdy[3], axdy[2], axdy[1], axdy[0]);
3713 axcy7, axcy[6], axcy[5], axcy[4],
3714 axcy[3], axcy[2], axcy[1], axcy[0]);
3717 negatetail = -aeytail;
3719 cxay7, cxay[6], cxay[5], cxay[4],
3720 cxay[3], cxay[2], cxay[1], cxay[0]);
3724 bxdy7, bxdy[6], bxdy[5], bxdy[4],
3725 bxdy[3], bxdy[2], bxdy[1], bxdy[0]);
3728 negatetail = -beytail;
3730 dxby7, dxby[6], dxby[5], dxby[4],
3731 dxby[3], dxby[2], dxby[1], dxby[0]);
3738 temp32blen, temp32b, temp64a);
3742 temp32blen, temp32b, temp64b);
3746 temp32blen, temp32b, temp64c);
3748 temp64blen, temp64b, temp128);
3750 temp128len, temp128, temp192);
3755 for (i = 0; i < xxtlen; i++) {
3765 for (i = 0; i < yytlen; i++) {
3775 for (i = 0; i < zztlen; i++) {
3787 temp32blen, temp32b, temp64a);
3791 temp32blen, temp32b, temp64b);
3795 temp32blen, temp32b, temp64c);
3797 temp64blen, temp64b, temp128);
3799 temp128len, temp128, temp192);
3804 for (i = 0; i < xxtlen; i++) {
3814 for (i = 0; i < yytlen; i++) {
3824 for (i = 0; i < zztlen; i++) {
3836 temp32blen, temp32b, temp64a);
3840 temp32blen, temp32b, temp64b);
3844 temp32blen, temp32b, temp64c);
3846 temp64blen, temp64b, temp128);
3848 temp128len, temp128, temp192);
3853 for (i = 0; i < xxtlen; i++) {
3863 for (i = 0; i < yytlen; i++) {
3873 for (i = 0; i < zztlen; i++) {
3885 temp32blen, temp32b, temp64a);
3889 temp32blen, temp32b, temp64b);
3893 temp32blen, temp32b, temp64c);
3895 temp64blen, temp64b, temp128);
3897 temp128len, temp128, temp192);
3902 for (i = 0; i < xxtlen; i++) {
3912 for (i = 0; i < yytlen; i++) {
3922 for (i = 0; i < zztlen; i++) {
3935 return deter[deterlen - 1];
3941 INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez;
3947 REAL aexbey0, bexaey0, bexcey0, cexbey0;
3948 REAL cexdey0, dexcey0, dexaey0, aexdey0;
3949 REAL aexcey0, cexaey0, bexdey0, dexbey0;
3950 REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4];
3952 REAL abeps, bceps, cdeps, daeps, aceps, bdeps;
3953 REAL temp8a[8], temp8b[8], temp8c[8], temp16[16], temp24[24], temp48[48];
3954 int temp8alen, temp8blen, temp8clen, temp16len, temp24len, temp48len;
3955 REAL xdet[96], ydet[96], zdet[96], xydet[192];
3956 int xlen, ylen, zlen, xylen;
3957 REAL adet[288], bdet[288], cdet[288], ddet[288];
3958 int alen, blen, clen, dlen;
3959 REAL abdet[576], cddet[576];
3964 REAL aextail, bextail, cextail, dextail;
3965 REAL aeytail, beytail, ceytail, deytail;
3966 REAL aeztail, beztail, ceztail, deztail;
3969 REAL avirt, bround, around;
3972 REAL ahi, alo, bhi, blo;
3973 REAL err1, err2, err3;
3977 aex = (
REAL) (pa[0] - pe[0]);
3978 bex = (
REAL) (pb[0] - pe[0]);
3979 cex = (
REAL) (pc[0] - pe[0]);
3980 dex = (
REAL) (pd[0] - pe[0]);
3981 aey = (
REAL) (pa[1] - pe[1]);
3982 bey = (
REAL) (pb[1] - pe[1]);
3983 cey = (
REAL) (pc[1] - pe[1]);
3984 dey = (
REAL) (pd[1] - pe[1]);
3985 aez = (
REAL) (pa[2] - pe[2]);
3986 bez = (
REAL) (pb[2] - pe[2]);
3987 cez = (
REAL) (pc[2] - pe[2]);
3988 dez = (
REAL) (pd[2] - pe[2]);
3992 Two_Two_Diff(aexbey1, aexbey0, bexaey1, bexaey0, ab3, ab[2], ab[1], ab[0]);
3997 Two_Two_Diff(bexcey1, bexcey0, cexbey1, cexbey0, bc3, bc[2], bc[1], bc[0]);
4002 Two_Two_Diff(cexdey1, cexdey0, dexcey1, dexcey0, cd3, cd[2], cd[1], cd[0]);
4007 Two_Two_Diff(dexaey1, dexaey0, aexdey1, aexdey0, da3, da[2], da[1], da[0]);
4012 Two_Two_Diff(aexcey1, aexcey0, cexaey1, cexaey0, ac3, ac[2], ac[1], ac[0]);
4017 Two_Two_Diff(bexdey1, bexdey0, dexbey1, dexbey0, bd3, bd[2], bd[1], bd[0]);
4024 temp8blen, temp8b, temp16);
4026 temp16len, temp16, temp24);
4040 temp8blen, temp8b, temp16);
4042 temp16len, temp16, temp24);
4056 temp8blen, temp8b, temp16);
4058 temp16len, temp16, temp24);
4072 temp8blen, temp8b, temp16);
4074 temp16len, temp16, temp24);
4090 if ((det >= errbound) || (-det >= errbound)) {
4106 if ((aextail == 0.0) && (aeytail == 0.0) && (aeztail == 0.0)
4107 && (bextail == 0.0) && (beytail == 0.0) && (beztail == 0.0)
4108 && (cextail == 0.0) && (ceytail == 0.0) && (ceztail == 0.0)
4109 && (dextail == 0.0) && (deytail == 0.0) && (deztail == 0.0)) {
4114 abeps = (aex * beytail + bey * aextail)
4115 - (aey * bextail + bex * aeytail);
4116 bceps = (bex * ceytail + cey * bextail)
4117 - (bey * cextail + cex * beytail);
4118 cdeps = (cex * deytail + dey * cextail)
4119 - (cey * dextail + dex * ceytail);
4120 daeps = (dex * aeytail + aey * dextail)
4121 - (dey * aextail + aex * deytail);
4122 aceps = (aex * ceytail + cey * aextail)
4123 - (aey * cextail + cex * aeytail);
4124 bdeps = (bex * deytail + dey * bextail)
4125 - (bey * dextail + dex * beytail);
4126 det += (((bex * bex + bey * bey + bez * bez)
4127 * ((cez * daeps + dez * aceps + aez * cdeps)
4128 + (ceztail * da3 + deztail * ac3 + aeztail * cd3))
4129 + (dex * dex + dey * dey + dez * dez)
4130 * ((aez * bceps - bez * aceps + cez * abeps)
4131 + (aeztail * bc3 - beztail * ac3 + ceztail * ab3)))
4132 - ((aex * aex + aey * aey + aez * aez)
4133 * ((bez * cdeps - cez * bdeps + dez * bceps)
4134 + (beztail * cd3 - ceztail * bd3 + deztail * bc3))
4135 + (cex * cex + cey * cey + cez * cez)
4136 * ((dez * abeps + aez * bdeps + bez * daeps)
4137 + (deztail * ab3 + aeztail * bd3 + beztail * da3))))
4138 + 2.0 * (((bex * bextail + bey * beytail + bez * beztail)
4139 * (cez * da3 + dez * ac3 + aez * cd3)
4140 + (dex * dextail + dey * deytail + dez * deztail)
4141 * (aez * bc3 - bez * ac3 + cez * ab3))
4142 - ((aex * aextail + aey * aeytail + aez * aeztail)
4143 * (bez * cd3 - cez * bd3 + dez * bc3)
4144 + (cex * cextail + cey * ceytail + cez * ceztail)
4145 * (dez * ab3 + aez * bd3 + bez * da3)));
4146 if ((det >= errbound) || (-det >= errbound)) {
4153 #ifdef INEXACT_GEOM_PRED
4157 REAL aex, bex, cex, dex;
4158 REAL aey, bey, cey, dey;
4159 REAL aez, bez, cez, dez;
4160 REAL alift, blift, clift, dlift;
4161 REAL ab, bc, cd, da, ac, bd;
4162 REAL abc, bcd, cda, dab;
4164 aex = pa[0] - pe[0];
4165 bex = pb[0] - pe[0];
4166 cex = pc[0] - pe[0];
4167 dex = pd[0] - pe[0];
4168 aey = pa[1] - pe[1];
4169 bey = pb[1] - pe[1];
4170 cey = pc[1] - pe[1];
4171 dey = pd[1] - pe[1];
4172 aez = pa[2] - pe[2];
4173 bez = pb[2] - pe[2];
4174 cez = pc[2] - pe[2];
4175 dez = pd[2] - pe[2];
4177 ab = aex * bey - bex * aey;
4178 bc = bex * cey - cex * bey;
4179 cd = cex * dey - dex * cey;
4180 da = dex * aey - aex * dey;
4182 ac = aex * cey - cex * aey;
4183 bd = bex * dey - dex * bey;
4185 abc = aez * bc - bez * ac + cez * ab;
4186 bcd = bez * cd - cez * bd + dez * bc;
4187 cda = cez * da + dez * ac + aez * cd;
4188 dab = dez * ab + aez * bd + bez * da;
4190 alift = aex * aex + aey * aey + aez * aez;
4191 blift = bex * bex + bey * bey + bez * bez;
4192 clift = cex * cex + cey * cey + cez * cez;
4193 dlift = dex * dex + dey * dey + dez * dez;
4195 return (dlift * abc - clift * dab) + (blift * cda - alift * bcd);
4202 REAL aex, bex, cex, dex;
4203 REAL aey, bey, cey, dey;
4204 REAL aez, bez, cez, dez;
4205 REAL aexbey, bexaey, bexcey, cexbey, cexdey, dexcey, dexaey, aexdey;
4206 REAL aexcey, cexaey, bexdey, dexbey;
4207 REAL alift, blift, clift, dlift;
4208 REAL ab, bc, cd, da, ac, bd;
4209 REAL abc, bcd, cda, dab;
4210 REAL aezplus, bezplus, cezplus, dezplus;
4211 REAL aexbeyplus, bexaeyplus, bexceyplus, cexbeyplus;
4212 REAL cexdeyplus, dexceyplus, dexaeyplus, aexdeyplus;
4213 REAL aexceyplus, cexaeyplus, bexdeyplus, dexbeyplus;
4215 REAL permanent, errbound;
4217 aex = pa[0] - pe[0];
4218 bex = pb[0] - pe[0];
4219 cex = pc[0] - pe[0];
4220 dex = pd[0] - pe[0];
4221 aey = pa[1] - pe[1];
4222 bey = pb[1] - pe[1];
4223 cey = pc[1] - pe[1];
4224 dey = pd[1] - pe[1];
4225 aez = pa[2] - pe[2];
4226 bez = pb[2] - pe[2];
4227 cez = pc[2] - pe[2];
4228 dez = pd[2] - pe[2];
4232 ab = aexbey - bexaey;
4235 bc = bexcey - cexbey;
4238 cd = cexdey - dexcey;
4241 da = dexaey - aexdey;
4245 ac = aexcey - cexaey;
4248 bd = bexdey - dexbey;
4250 abc = aez * bc - bez * ac + cez * ab;
4251 bcd = bez * cd - cez * bd + dez * bc;
4252 cda = cez * da + dez * ac + aez * cd;
4253 dab = dez * ab + aez * bd + bez * da;
4255 alift = aex * aex + aey * aey + aez * aez;
4256 blift = bex * bex + bey * bey + bez * bez;
4257 clift = cex * cex + cey * cey + cez * cez;
4258 dlift = dex * dex + dey * dey + dez * dez;
4260 det = (dlift * abc - clift * dab) + (blift * cda - alift * bcd);
4282 permanent = ((cexdeyplus + dexceyplus) * bezplus
4283 + (dexbeyplus + bexdeyplus) * cezplus
4284 + (bexceyplus + cexbeyplus) * dezplus)
4286 + ((dexaeyplus + aexdeyplus) * cezplus
4287 + (aexceyplus + cexaeyplus) * dezplus
4288 + (cexdeyplus + dexceyplus) * aezplus)
4290 + ((aexbeyplus + bexaeyplus) * dezplus
4291 + (bexdeyplus + dexbeyplus) * aezplus
4292 + (dexaeyplus + aexdeyplus) * bezplus)
4294 + ((bexceyplus + cexbeyplus) * aezplus
4295 + (cexaeyplus + aexceyplus) * bezplus
4296 + (aexbeyplus + bexaeyplus) * cezplus)
4299 if ((det > errbound) || (-det > errbound)) {
4306 #endif // #ifdef INEXACT_GEOM_PRED
4338 REAL axby0, bxcy0, cxdy0, dxey0, exay0;
4339 REAL bxay0, cxby0, dxcy0, exdy0, axey0;
4340 REAL axcy0, bxdy0, cxey0, dxay0, exby0;
4341 REAL cxay0, dxby0, excy0, axdy0, bxey0;
4342 REAL ab[4], bc[4], cd[4], de[4], ea[4];
4343 REAL ac[4], bd[4], ce[4], da[4], eb[4];
4344 REAL temp8a[8], temp8b[8], temp16[16];
4345 int temp8alen, temp8blen, temp16len;
4346 REAL abc[24], bcd[24], cde[24], dea[24], eab[24];
4347 REAL abd[24], bce[24], cda[24], deb[24], eac[24];
4348 int abclen, bcdlen, cdelen, dealen, eablen;
4349 int abdlen, bcelen, cdalen, deblen, eaclen;
4350 REAL temp48a[48], temp48b[48];
4351 int temp48alen, temp48blen;
4352 REAL abcd[96], bcde[96], cdea[96], deab[96], eabc[96];
4353 int abcdlen, bcdelen, cdealen, deablen, eabclen;
4354 REAL adet[192], bdet[192], cdet[192], ddet[192], edet[192];
4355 int alen, blen, clen, dlen, elen;
4356 REAL abdet[384], cddet[384], cdedet[576];
4363 REAL avirt, bround, around;
4366 REAL ahi, alo, bhi, blo;
4367 REAL err1, err2, err3;
4373 Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]);
4377 Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]);
4381 Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]);
4385 Two_Two_Diff(dxey1, dxey0, exdy1, exdy0, de[3], de[2], de[1], de[0]);
4389 Two_Two_Diff(exay1, exay0, axey1, axey0, ea[3], ea[2], ea[1], ea[0]);
4393 Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]);
4397 Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]);
4401 Two_Two_Diff(cxey1, cxey0, excy1, excy0, ce[3], ce[2], ce[1], ce[0]);
4405 Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]);
4409 Two_Two_Diff(exby1, exby0, bxey1, bxey0, eb[3], eb[2], eb[1], eb[0]);
4493 for (i = 0; i < temp48blen; i++) {
4494 temp48b[i] = -temp48b[i];
4497 temp48blen, temp48b, bcde);
4502 for (i = 0; i < temp48blen; i++) {
4503 temp48b[i] = -temp48b[i];
4506 temp48blen, temp48b, cdea);
4511 for (i = 0; i < temp48blen; i++) {
4512 temp48b[i] = -temp48b[i];
4515 temp48blen, temp48b, deab);
4520 for (i = 0; i < temp48blen; i++) {
4521 temp48b[i] = -temp48b[i];
4524 temp48blen, temp48b, eabc);
4529 for (i = 0; i < temp48blen; i++) {
4530 temp48b[i] = -temp48b[i];
4533 temp48blen, temp48b, abcd);
4541 return deter[deterlen - 1];
4548 INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez;
4549 INEXACT REAL aeheight, beheight, ceheight, deheight;
4555 REAL aexbey0, bexaey0, bexcey0, cexbey0;
4556 REAL cexdey0, dexcey0, dexaey0, aexdey0;
4557 REAL aexcey0, cexaey0, bexdey0, dexbey0;
4558 REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4];
4560 REAL abeps, bceps, cdeps, daeps, aceps, bdeps;
4561 REAL temp8a[8], temp8b[8], temp8c[8], temp16[16], temp24[24];
4562 int temp8alen, temp8blen, temp8clen, temp16len, temp24len;
4563 REAL adet[48], bdet[48], cdet[48], ddet[48];
4564 int alen, blen, clen, dlen;
4565 REAL abdet[96], cddet[96];
4570 REAL aextail, bextail, cextail, dextail;
4571 REAL aeytail, beytail, ceytail, deytail;
4572 REAL aeztail, beztail, ceztail, deztail;
4573 REAL aeheighttail, beheighttail, ceheighttail, deheighttail;
4576 REAL avirt, bround, around;
4579 REAL ahi, alo, bhi, blo;
4580 REAL err1, err2, err3;
4584 aex = (
REAL) (pa[0] - pe[0]);
4585 bex = (
REAL) (pb[0] - pe[0]);
4586 cex = (
REAL) (pc[0] - pe[0]);
4587 dex = (
REAL) (pd[0] - pe[0]);
4588 aey = (
REAL) (pa[1] - pe[1]);
4589 bey = (
REAL) (pb[1] - pe[1]);
4590 cey = (
REAL) (pc[1] - pe[1]);
4591 dey = (
REAL) (pd[1] - pe[1]);
4592 aez = (
REAL) (pa[2] - pe[2]);
4593 bez = (
REAL) (pb[2] - pe[2]);
4594 cez = (
REAL) (pc[2] - pe[2]);
4595 dez = (
REAL) (pd[2] - pe[2]);
4596 aeheight = (
REAL) (aheight - eheight);
4597 beheight = (
REAL) (bheight - eheight);
4598 ceheight = (
REAL) (cheight - eheight);
4599 deheight = (
REAL) (dheight - eheight);
4603 Two_Two_Diff(aexbey1, aexbey0, bexaey1, bexaey0, ab3, ab[2], ab[1], ab[0]);
4608 Two_Two_Diff(bexcey1, bexcey0, cexbey1, cexbey0, bc3, bc[2], bc[1], bc[0]);
4613 Two_Two_Diff(cexdey1, cexdey0, dexcey1, dexcey0, cd3, cd[2], cd[1], cd[0]);
4618 Two_Two_Diff(dexaey1, dexaey0, aexdey1, aexdey0, da3, da[2], da[1], da[0]);
4623 Two_Two_Diff(aexcey1, aexcey0, cexaey1, cexaey0, ac3, ac[2], ac[1], ac[0]);
4628 Two_Two_Diff(bexdey1, bexdey0, dexbey1, dexbey0, bd3, bd[2], bd[1], bd[0]);
4635 temp8blen, temp8b, temp16);
4637 temp16len, temp16, temp24);
4644 temp8blen, temp8b, temp16);
4646 temp16len, temp16, temp24);
4653 temp8blen, temp8b, temp16);
4655 temp16len, temp16, temp24);
4662 temp8blen, temp8b, temp16);
4664 temp16len, temp16, temp24);
4673 if ((det >= errbound) || (-det >= errbound)) {
4693 if ((aextail == 0.0) && (aeytail == 0.0) && (aeztail == 0.0)
4694 && (bextail == 0.0) && (beytail == 0.0) && (beztail == 0.0)
4695 && (cextail == 0.0) && (ceytail == 0.0) && (ceztail == 0.0)
4696 && (dextail == 0.0) && (deytail == 0.0) && (deztail == 0.0)
4697 && (aeheighttail == 0.0) && (beheighttail == 0.0)
4698 && (ceheighttail == 0.0) && (deheighttail == 0.0)) {
4703 abeps = (aex * beytail + bey * aextail)
4704 - (aey * bextail + bex * aeytail);
4705 bceps = (bex * ceytail + cey * bextail)
4706 - (bey * cextail + cex * beytail);
4707 cdeps = (cex * deytail + dey * cextail)
4708 - (cey * dextail + dex * ceytail);
4709 daeps = (dex * aeytail + aey * dextail)
4710 - (dey * aextail + aex * deytail);
4711 aceps = (aex * ceytail + cey * aextail)
4712 - (aey * cextail + cex * aeytail);
4713 bdeps = (bex * deytail + dey * bextail)
4714 - (bey * dextail + dex * beytail);
4716 * ((cez * daeps + dez * aceps + aez * cdeps)
4717 + (ceztail * da3 + deztail * ac3 + aeztail * cd3))
4719 * ((aez * bceps - bez * aceps + cez * abeps)
4720 + (aeztail * bc3 - beztail * ac3 + ceztail * ab3)))
4722 * ((bez * cdeps - cez * bdeps + dez * bceps)
4723 + (beztail * cd3 - ceztail * bd3 + deztail * bc3))
4725 * ((dez * abeps + aez * bdeps + bez * daeps)
4726 + (deztail * ab3 + aeztail * bd3 + beztail * da3))))
4727 + ((beheighttail * (cez * da3 + dez * ac3 + aez * cd3)
4728 + deheighttail * (aez * bc3 - bez * ac3 + cez * ab3))
4729 - (aeheighttail * (bez * cd3 - cez * bd3 + dez * bc3)
4730 + ceheighttail * (dez * ab3 + aez * bd3 + bez * da3)));
4731 if ((det >= errbound) || (-det >= errbound)) {
4736 aheight, bheight, cheight, dheight, eheight);
4743 REAL aex, bex, cex, dex;
4744 REAL aey, bey, cey, dey;
4745 REAL aez, bez, cez, dez;
4746 REAL aexbey, bexaey, bexcey, cexbey, cexdey, dexcey, dexaey, aexdey;
4747 REAL aexcey, cexaey, bexdey, dexbey;
4748 REAL aeheight, beheight, ceheight, deheight;
4749 REAL ab, bc, cd, da, ac, bd;
4750 REAL abc, bcd, cda, dab;
4751 REAL aezplus, bezplus, cezplus, dezplus;
4752 REAL aexbeyplus, bexaeyplus, bexceyplus, cexbeyplus;
4753 REAL cexdeyplus, dexceyplus, dexaeyplus, aexdeyplus;
4754 REAL aexceyplus, cexaeyplus, bexdeyplus, dexbeyplus;
4756 REAL permanent, errbound;
4760 aex = pa[0] - pe[0];
4761 bex = pb[0] - pe[0];
4762 cex = pc[0] - pe[0];
4763 dex = pd[0] - pe[0];
4764 aey = pa[1] - pe[1];
4765 bey = pb[1] - pe[1];
4766 cey = pc[1] - pe[1];
4767 dey = pd[1] - pe[1];
4768 aez = pa[2] - pe[2];
4769 bez = pb[2] - pe[2];
4770 cez = pc[2] - pe[2];
4771 dez = pd[2] - pe[2];
4772 aeheight = aheight - eheight;
4773 beheight = bheight - eheight;
4774 ceheight = cheight - eheight;
4775 deheight = dheight - eheight;
4779 ab = aexbey - bexaey;
4782 bc = bexcey - cexbey;
4785 cd = cexdey - dexcey;
4788 da = dexaey - aexdey;
4792 ac = aexcey - cexaey;
4795 bd = bexdey - dexbey;
4797 abc = aez * bc - bez * ac + cez * ab;
4798 bcd = bez * cd - cez * bd + dez * bc;
4799 cda = cez * da + dez * ac + aez * cd;
4800 dab = dez * ab + aez * bd + bez * da;
4802 det = (deheight * abc - ceheight * dab) + (beheight * cda - aeheight * bcd);
4824 permanent = ((cexdeyplus + dexceyplus) * bezplus
4825 + (dexbeyplus + bexdeyplus) * cezplus
4826 + (bexceyplus + cexbeyplus) * dezplus)
4828 + ((dexaeyplus + aexdeyplus) * cezplus
4829 + (aexceyplus + cexaeyplus) * dezplus
4830 + (cexdeyplus + dexceyplus) * aezplus)
4832 + ((aexbeyplus + bexaeyplus) * dezplus
4833 + (bexdeyplus + dexbeyplus) * aezplus
4834 + (dexaeyplus + aexdeyplus) * bezplus)
4836 + ((bexceyplus + cexbeyplus) * aezplus
4837 + (cexaeyplus + aexceyplus) * bezplus
4838 + (aexbeyplus + bexaeyplus) * cezplus)
4841 if ((det > errbound) || (-det > errbound)) {
4846 aheight, bheight, cheight, dheight, eheight, permanent);