EFPBox.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13: package xeij;
14:
15: import java.lang.*;
16: import java.util.*;
17:
18: public class EFPBox {
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55: public static final boolean EPB_EXTRA_OPERATION = true;
56:
57:
58:
59: public static final int EPB_MODE_MC68881 = 1 << 1;
60: public static final int EPB_MODE_MC68882 = 1 << 2;
61: public static final int EPB_MODE_MC68060 = 1 << 6;
62: public static final int EPB_MODE_FULLSPEC = EPB_MODE_MC68881 | EPB_MODE_MC68882 | EPB_MODE_MC68060;
63: public static final int EPB_MODE_EXTENDED = 1 << 8;
64: public static final int EPB_MODE_TRIPLE = 1 << 9;
65: public static int epbMode;
66:
67:
68:
69: public static final int P = 0 << 31;
70: public static final int M = 1 << 31;
71: public static final int Z = 1 << 30;
72: public static final int I = 1 << 29;
73: public static final int N = 1 << 28;
74:
75:
76:
77:
78: public static final int EPB_FPCR_BS = 1 << 15;
79: public static final int EPB_FPCR_SN = 1 << 14;
80: public static final int EPB_FPCR_OE = 1 << 13;
81: public static final int EPB_FPCR_OF = 1 << 12;
82: public static final int EPB_FPCR_UF = 1 << 11;
83: public static final int EPB_FPCR_DZ = 1 << 10;
84: public static final int EPB_FPCR_X2 = 1 << 9;
85: public static final int EPB_FPCR_X1 = 1 << 8;
86:
87: public static final int EPB_FPCR_PX = 0 << 6;
88: public static final int EPB_FPCR_PS = 1 << 6;
89: public static final int EPB_FPCR_PD = 2 << 6;
90:
91:
92: public static final int EPB_FPCR_RN = 0 << 4;
93: public static final int EPB_FPCR_RZ = 1 << 4;
94: public static final int EPB_FPCR_RM = 2 << 4;
95: public static final int EPB_FPCR_RP = 3 << 4;
96: public static final int EPB_FPCR_ALL = 0x0000fff0;
97: public int epbFpcr;
98:
99:
100:
101:
102:
103:
104: public static final int EPB_FPSR_M = 1 << 27;
105: public static final int EPB_FPSR_Z = 1 << 26;
106: public static final int EPB_FPSR_I = 1 << 25;
107: public static final int EPB_FPSR_N = 1 << 24;
108:
109: public static final int EPB_FPSR_S = 1 << 23;
110: public static final int EPB_FPSR_Q = 127 << 16;
111:
112: public static final int EPB_FPSR_BS = 1 << 15;
113: public static final int EPB_FPSR_SN = 1 << 14;
114: public static final int EPB_FPSR_OE = 1 << 13;
115: public static final int EPB_FPSR_OF = 1 << 12;
116: public static final int EPB_FPSR_UF = 1 << 11;
117: public static final int EPB_FPSR_DZ = 1 << 10;
118: public static final int EPB_FPSR_X2 = 1 << 9;
119: public static final int EPB_FPSR_X1 = 1 << 8;
120:
121: public static final int EPB_FPSR_AV = 1 << 7;
122: public static final int EPB_FPSR_AO = 1 << 6;
123: public static final int EPB_FPSR_AU = 1 << 5;
124: public static final int EPB_FPSR_AZ = 1 << 4;
125: public static final int EPB_FPSR_AX = 1 << 3;
126: public static final int EPB_FPSR_ALL = 0x0ffffff8;
127: public int epbFpsr;
128:
129:
130:
131: public int epbFpiar;
132:
133:
134:
135: public int epbQuotient;
136:
137:
138:
139: public static final int EPB_PREC_EXD = 0;
140: public static final int EPB_PREC_SGL = 1;
141: public static final int EPB_PREC_DBL = 2;
142: public static final int EPB_PREC_DBL3 = 3;
143:
144: public static final int EPB_PREC_TPL = 4;
145: public static final int EPB_PREC_XSG = 5;
146: public static final int EPB_PREC_EFP = 6;
147: public int epbRoundingPrec;
148:
149:
150:
151: public static final int EPB_MODE_RN = 0;
152: public static final int EPB_MODE_RZ = 1;
153: public static final int EPB_MODE_RM = 2;
154: public static final int EPB_MODE_RP = 3;
155: public int epbRoundingMode;
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172: public int epbExceptionOperandExponent;
173: public long epbExceptionOperandMantissa;
174: public int epbExceptionStatusWord;
175:
176:
177:
178:
179:
180: public int epbRoundingDepth;
181: public int epbRoundingOuterPrec;
182: public int epbRoundingOuterMode;
183:
184:
185:
186: public static final int EPB_SRC_TMP = 8;
187: public static final int EPB_DST_TMP = 9;
188: public static final int EPB_CONST_START = 10;
189: public EFP[] epbFPn;
190:
191:
192:
193: public static final HashMap<String,Integer> epbConstLongMap = new HashMap<String,Integer> ();
194: static {
195:
196: for (int i = 0; i < Disassembler.DIS_IOCS_NAME.length; i++) {
197: String name = Disassembler.DIS_IOCS_NAME[i];
198: if (name.length () > 0) {
199: epbConstLongMap.put (name.toLowerCase (), i);
200: }
201: }
202:
203: for (int i = 0; i < Disassembler.DIS_SXCALL_NAME.length; i++) {
204: String name = Disassembler.DIS_SXCALL_NAME[i];
205: if (name.length () > 0) {
206: epbConstLongMap.put (name.toLowerCase (), 0xa000 + i);
207: }
208: }
209:
210: for (int i = 0; i < Disassembler.DIS_FPACK_NAME.length; i++) {
211: String name = Disassembler.DIS_FPACK_NAME[i];
212: if (name.length () > 0) {
213: epbConstLongMap.put (name.toLowerCase (), 0xfe00 + i);
214: }
215: }
216:
217: for (int i = 0; i < Disassembler.DIS_DOS_NAME.length; i++) {
218: String name = Disassembler.DIS_DOS_NAME[i];
219: if (name.length () > 0) {
220: epbConstLongMap.put (name.toLowerCase (), 0xff00 + i);
221: }
222: }
223: }
224:
225:
226:
227: public EFPBox () {
228:
229: epbMode = EPB_MODE_EXTENDED | EPB_MODE_MC68882;
230:
231:
232: epbRandSeed = System.currentTimeMillis () & (1L << 48) - 1L;
233:
234: epbFPn = new EFPBox.EFP[EPB_CONST_START + 128];
235: for (int i = 0; i < epbFPn.length; i++) {
236: epbFPn[i] = new EFP ();
237: }
238:
239:
240:
241:
242:
243: epbFPn[EPB_CONST_START + 0x00].sete (PI);
244: epbSetROMSub ();
245: epbFPn[EPB_CONST_START + 0x0b].sete (LOG10_2);
246: epbFPn[EPB_CONST_START + 0x0c].sete (E);
247: epbFPn[EPB_CONST_START + 0x0d].sete (LOG2_E);
248: epbFPn[EPB_CONST_START + 0x0e].sete (LOG10_E);
249: epbFPn[EPB_CONST_START + 0x0f].set0 ();
250: epbFPn[EPB_CONST_START + 0x30].sete (LOG_2);
251: epbFPn[EPB_CONST_START + 0x31].sete (LOG_10);
252: epbFPn[EPB_CONST_START + 0x32].set1 ();
253: epbFPn[EPB_CONST_START + 0x33].sete (TEN);
254: epbFPn[EPB_CONST_START + 0x34].sete (TENXP1);
255: epbFPn[EPB_CONST_START + 0x35].sete (TENXP2);
256: epbFPn[EPB_CONST_START + 0x36].sete (TENXP3);
257: epbFPn[EPB_CONST_START + 0x37].sete (TENXP4);
258: epbFPn[EPB_CONST_START + 0x38].sete (TENXP5);
259: epbFPn[EPB_CONST_START + 0x39].sete (TENXP6);
260: epbFPn[EPB_CONST_START + 0x3a].sete (TENXP7);
261: epbFPn[EPB_CONST_START + 0x3b].sete (TENXP8);
262: epbFPn[EPB_CONST_START + 0x3c].sete (TENXP9);
263: epbFPn[EPB_CONST_START + 0x3d].sete (TENXP10);
264: epbFPn[EPB_CONST_START + 0x3e].sete (TENXP11);
265: epbFPn[EPB_CONST_START + 0x3f].sete (TENXP12);
266:
267: epbReset ();
268:
269: cirInit ();
270: }
271:
272:
273:
274: public final void epbSetROMSub () {
275: if ((epbMode & EPB_MODE_MC68882) != 0) {
276: epbFPn[EPB_CONST_START + 0x01].setx012 (0x40010000, 0xfe00068200000000L);
277: epbFPn[EPB_CONST_START + 0x02].setx012 (0x40010000, 0xffc0050380000000L);
278:
279: epbFPn[EPB_CONST_START + 0x03].setnan ();
280: epbFPn[EPB_CONST_START + 0x04].setx012 (0x00000000, 0xffffffffffffffffL);
281: epbFPn[EPB_CONST_START + 0x05].setx012 (0x3c000000, 0xfffffffffffff800L);
282: epbFPn[EPB_CONST_START + 0x06].setx012 (0x3f800000, 0xffffff0000000000L);
283:
284: epbFPn[EPB_CONST_START + 0x07].setnan ();
285:
286: epbFPn[EPB_CONST_START + 0x08].setnan ();
287: epbFPn[EPB_CONST_START + 0x09].setx012 (0x43f30000, 0xe000000000000000L);
288: epbFPn[EPB_CONST_START + 0x0a].setx012 (0x40720000, 0xc000000000000000L);
289: } else {
290: for (int offset = 0x01; offset <= 0x0a; offset++) {
291: epbFPn[EPB_CONST_START + offset].set0 ();
292: }
293: }
294: }
295:
296:
297:
298:
299: public void epbFmovecr (EFP x, int offset) {
300:
301: switch (offset) {
302: case 0x01:
303: if ((epbMode & EPB_MODE_MC68882) != 0) {
304: if (epbRoundingPrec == EPB_PREC_SGL) {
305: if (epbRoundingMode == EPB_MODE_RN ||
306: epbRoundingMode == EPB_MODE_RZ ||
307: epbRoundingMode == EPB_MODE_RM) {
308:
309: x.flg = P;
310: x.epp = 0x4001 - 0x3fff;
311: x.dvl = 0xfe00068000000000L;
312: x.cvl = 0L;
313: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_X2;
314: return;
315: }
316: }
317: }
318: break;
319: case 0x02:
320: if ((epbMode & EPB_MODE_MC68882) != 0) {
321: if (epbRoundingPrec == EPB_PREC_SGL) {
322: if (epbRoundingMode == EPB_MODE_RP) {
323:
324: x.flg = P;
325: x.epp = 0x4001 - 0x3fff;
326: x.dvl = 0xffc0058000000000L;
327: x.cvl = 0L;
328: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_X2;
329: return;
330: }
331: }
332: }
333: break;
334: case 0x03:
335: if ((epbMode & EPB_MODE_MC68882) != 0) {
336: if (epbRoundingPrec == EPB_PREC_SGL) {
337: if (epbRoundingMode == EPB_MODE_RN ||
338: epbRoundingMode == EPB_MODE_RP) {
339:
340: x.flg = P;
341: x.epp = 0x2000 - 0x3fff;
342: x.dvl = 0x8000000000000000L;
343: x.cvl = 0L;
344: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_I | EPB_FPSR_X2;
345: } else {
346:
347: x.flg = P;
348: x.epp = 0x2000 - 0x3fff;
349: x.dvl = 0x7fffff0000000000L;
350: x.cvl = 0L;
351: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_N | EPB_FPSR_X2;
352: }
353: } else {
354:
355: x.flg = P;
356: x.epp = 0x2000 - 0x3fff;
357: x.dvl = 0x7fffffff00000000L;
358: x.cvl = 0L;
359: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_N;
360: }
361: return;
362: }
363: break;
364: case 0x07:
365: if ((epbMode & EPB_MODE_MC68882) != 0) {
366: if (epbRoundingPrec == EPB_PREC_SGL) {
367: if (epbRoundingMode == EPB_MODE_RN ||
368: epbRoundingMode == EPB_MODE_RZ ||
369: epbRoundingMode == EPB_MODE_RM) {
370:
371: x.flg = P;
372: x.epp = 0x0001 - 0x3fff;
373: x.dvl = 0xf65d8d8000000000L;
374: x.cvl = 0L;
375: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_N | EPB_FPSR_X2;
376: } else {
377:
378: x.flg = P;
379: x.epp = 0x0001 - 0x3fff;
380: x.dvl = 0xf65d8e0000000000L;
381: x.cvl = 0L;
382: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_N | EPB_FPSR_X2;
383: }
384: } else {
385:
386: x.flg = P;
387: x.epp = 0x0001 - 0x3fff;
388: x.dvl = 0xf65d8d9c00000000L;
389: x.cvl = 0L;
390: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_N;
391: }
392: return;
393: }
394: break;
395: case 0x08:
396: if ((epbMode & EPB_MODE_MC68882) != 0) {
397:
398: x.flg = N;
399: x.epp = 0;
400: x.dvl = 0L;
401: x.cvl = 0L;
402: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_N;
403: return;
404: }
405: break;
406: case 0x0b:
407: if (epbRoundingPrec == EPB_PREC_EXD) {
408: if (epbRoundingMode == EPB_MODE_RN) {
409:
410: x.flg = P;
411: x.epp = 0x3ffd - 0x3fff;
412: x.dvl = 0x9a209a84fbcff798L;
413: x.cvl = 0L;
414: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_X2;
415: return;
416: }
417: }
418: break;
419: case 0x0c:
420: if (epbRoundingPrec == EPB_PREC_EXD) {
421: if (epbRoundingMode == EPB_MODE_RN) {
422:
423: x.flg = P;
424: x.epp = 0x4000 - 0x3fff;
425: x.dvl = 0xadf85458a2bb4a9aL;
426: x.cvl = 0L;
427: epbFpsr = epbFpsr & 0x00ff00ff | EPB_FPSR_X2;
428: return;
429: }
430: }
431: break;
432: case 0x0e:
433: if (epbRoundingPrec == EPB_PREC_EXD) {
434:
435: x.flg = P;
436: x.epp = 0x3ffd - 0x3fff;
437: x.dvl = 0xde5bd8a937287195L;
438: x.cvl = 0L;
439: epbFpsr = epbFpsr & 0x00ff00ff;
440: return;
441: }
442: break;
443: }
444:
445: x.sete (epbFPn[EPB_CONST_START + offset]);
446:
447: epbFpsr = epbFpsr & 0x00ff00ff | x.flg >>> 4;
448:
449: if (epbRoundingPrec == EPB_PREC_EXD) {
450: x.roundmanx (epbRoundingMode);
451: } else if (epbRoundingPrec == EPB_PREC_SGL) {
452: x.roundmanf (epbRoundingMode);
453: } else if (epbRoundingPrec == EPB_PREC_DBL ||
454: epbRoundingPrec == EPB_PREC_DBL3) {
455: x.roundmand (epbRoundingMode);
456: } else if (epbRoundingPrec == EPB_PREC_TPL) {
457: x.roundmany (epbRoundingMode);
458: }
459: }
460:
461:
462:
463: public void epbSetMC68881 () {
464: epbMode = epbMode & ~(EPB_MODE_MC68882 | EPB_MODE_MC68060) | EPB_MODE_MC68881;
465: epbSetROMSub ();
466: }
467:
468:
469:
470: public void epbSetMC68882 () {
471: epbMode = epbMode & ~(EPB_MODE_MC68881 | EPB_MODE_MC68060) | EPB_MODE_MC68882;
472: epbSetROMSub ();
473: }
474:
475:
476:
477: public void epbSetMC68060 () {
478: epbMode = epbMode & ~(EPB_MODE_MC68881 | EPB_MODE_MC68882) | EPB_MODE_MC68060;
479: epbSetROMSub ();
480: }
481:
482:
483:
484: public void epbSetFullSpec () {
485: epbMode |= EPB_MODE_FULLSPEC;
486: epbSetROMSub ();
487: }
488:
489:
490:
491: public boolean epbIsFullSpec () {
492: return (epbMode & EPB_MODE_FULLSPEC) == EPB_MODE_FULLSPEC;
493: }
494:
495:
496:
497: public void epbSetExtended () {
498: epbMode = epbMode & ~EPB_MODE_TRIPLE | EPB_MODE_EXTENDED;
499: }
500:
501:
502:
503: public void epbSetTriple () {
504: epbMode = epbMode & ~EPB_MODE_EXTENDED | EPB_MODE_TRIPLE;
505: }
506:
507:
508:
509: public boolean epbIsTriple () {
510: return (epbMode & EPB_MODE_TRIPLE) != 0;
511: }
512:
513:
514:
515: public final void epbReset () {
516:
517: for (int n = 0; n < 8; n++) {
518: epbFPn[n].setnan ();
519: }
520:
521: epbFpcr = 0;
522: epbFpsr = 0;
523: epbFpiar = 0;
524: epbQuotient = 0;
525: epbRoundingPrec = EPB_PREC_EFP;
526: epbRoundingMode = EPB_MODE_RN;
527: epbRoundingDepth = 0;
528: epbRoundingOuterPrec = EPB_PREC_EFP;
529: epbRoundingOuterMode = EPB_MODE_RN;
530:
531: epbExceptionOperandExponent = 0;
532: epbExceptionOperandMantissa = 0x0000000000000000L;
533: epbExceptionStatusWord = 0;
534:
535: cirReset ();
536: }
537:
538:
539:
540:
541:
542: public void epbSetRoundingPrec (int prec) {
543: epbRoundingPrec = prec == EPB_PREC_EXD && (epbMode & EPB_MODE_TRIPLE) != 0 ? EPB_PREC_TPL : prec;
544: }
545:
546:
547:
548:
549: public void epbSetRoundingMode (int mode) {
550: epbRoundingMode = mode;
551: }
552:
553:
554:
555:
556: public long epbRandSeed;
557:
558:
559:
560: public void epbRandStart (long n) {
561: epbRandSeed = (n ^ 25214903917L) & (1L << 48) - 1L;
562: }
563:
564:
565:
566: public long epbRand48 () {
567: return epbRandSeed = epbRandSeed * 25214903917L + 11L & (1L << 48) - 1L;
568: }
569:
570:
571:
572: public int epbRandInt () {
573: return (int) (epbRand48 () >>> 16);
574: }
575:
576:
577:
578: public long epbRandLong () {
579: return epbRand48 () >>> 16 << 32 | epbRand48 () >>> 16;
580: }
581:
582:
583:
584:
585: public static void epbMakeCmpTable () {
586: int[] fa = new int[] {
587: P | Z,
588: M | Z,
589: P | I,
590: M | I,
591: N,
592: P,
593: M,
594: };
595: double[] da = new double[] {
596: +0.0,
597: -0.0,
598: Double.POSITIVE_INFINITY,
599: Double.NEGATIVE_INFINITY,
600: Double.NaN,
601: +1.0,
602: -1.0,
603: };
604: String[] na = { "CMP", "COMPARE", "EQ", "GE", "GT", "LE", "LT", "NE" };
605: int[][] ba = new int[na.length][];
606: for (int j = 0; j < na.length; j++) {
607: ba[j] = new int[16];
608: }
609: for (int xi = 0; xi < fa.length; xi++) {
610: int xk = fa[xi] >>> 28;
611: double x = da[xi];
612: for (int yi = 0; yi < fa.length; yi++) {
613: int yk = fa[yi] >>> 28 - 1;
614: double y = da[yi];
615: ba[0][xk] |= (Double.isNaN (x) || Double.isNaN (y) || x == y ? 0 : x < y ? -1 : 1) << 30 >>> yk;
616: ba[1][xk] |= Double.compare (x, y) << 30 >>> yk;
617: ba[2][xk] |= (x == y ? -1 : 0) << 30 >>> yk;
618: ba[3][xk] |= (x >= y ? -1 : 0) << 30 >>> yk;
619: ba[4][xk] |= (x > y ? -1 : 0) << 30 >>> yk;
620: ba[5][xk] |= (x <= y ? -1 : 0) << 30 >>> yk;
621: ba[6][xk] |= (x < y ? -1 : 0) << 30 >>> yk;
622: ba[7][xk] |= (x != y ? -1 : 0) << 30 >>> yk;
623: }
624: }
625: for (int ni = 0; ni < na.length; ni++) {
626: System.out.print (" protected static final int[] EFP_" + na[ni] + "_TABLE = { ");
627: for (int xk = 0; xk < 16; xk++) {
628: System.out.print (ba[ni][xk]);
629: if (xk < 16 - 1) {
630: System.out.print (", ");
631: }
632: }
633: System.out.println (" };");
634: }
635: }
636:
637:
638:
639: public static final int[] EFP_CMP_TABLE = { 205538368, 0, 1077953600, 0, -872397824, 0, 0, 0, -859831104, 0, -859782976, 0, -872397824, 0, 0, 0 };
640: public static final int[] EFP_COMPARE_TABLE = { 1010844736, 1145062464, 1883259968, 0, -67091392, 0, 0, 0, -54524736, 0, -54476608, 0, -54508544, 0, 0, 0 };
641: public static final int[] EFP_EQ_TABLE = { -1073741824, 0, 201326592, 0, 12583104, 0, 0, 0, 49152, 0, 3072, 0, 12583104, 0, 0, 0 };
642: public static final int[] EFP_GE_TABLE = { -1061106496, 0, -859779904, 0, 12635328, 0, 0, 0, 52224, 0, 3072, 0, 12635328, 0, 0, 0 };
643: public static final int[] EFP_GT_TABLE = { 12635328, 0, -1061106496, 0, 52224, 0, 0, 0, 3072, 0, 0, 0, 52224, 0, 0, 0 };
644: public static final int[] EFP_LE_TABLE = { -872415232, 0, 201326592, 0, -859832128, 0, 0, 0, -859782976, 0, -859779904, 0, -859832128, 0, 0, 0 };
645: public static final int[] EFP_LT_TABLE = { 201326592, 0, 0, 0, -872415232, 0, 0, 0, -859832128, 0, -859782976, 0, -872415232, 0, 0, 0 };
646: public static final int[] EFP_NE_TABLE = { 1019268288, -54473536, -255800128, 0, -67056640, 0, 0, 0, -54522688, 0, -54476608, 0, -67056640, 0, 0, 0 };
647:
648:
649:
650:
651:
652: public final EFP ZERO = new EFP (P | Z, 0, 0L, 0L);
653: public final EFP NEGZERO = new EFP (M | Z, 0, 0L, 0L);
654: public final EFP INF = new EFP (P | I, 0, 0L, 0L);
655: public final EFP NEGINF = new EFP (M | I, 0, 0L, 0L);
656: public final EFP NAN = new EFP ( N, 0, 0L, 0L);
657:
658:
659:
660:
661: public final EFP EXDNOMAX = new EFP (P, 16383, 0xffffffffffffffffL, 0x0000000L << 36);
662: public final EFP EXDDEMIN = new EFP (P, -16446, 0x8000000000000000L, 0x0000000L << 36);
663: public final EFP NEGEXDDEMIN = new EFP (M, -16446, 0x8000000000000000L, 0x0000000L << 36);
664: public final EFP NEGEXDNOMAX = new EFP (M, 16383, 0xffffffffffffffffL, 0x0000000L << 36);
665: public final EFP SGLNOMAX = new EFP (P, 127, 0xffffff0000000000L, 0x0000000L << 36);
666: public final EFP SGLDEMIN = new EFP (P, -149, 0x8000000000000000L, 0x0000000L << 36);
667: public final EFP NEGSGLDEMIN = new EFP (M, -149, 0x8000000000000000L, 0x0000000L << 36);
668: public final EFP NEGSGLNOMAX = new EFP (M, 127, 0xffffff0000000000L, 0x0000000L << 36);
669: public final EFP DBLNOMAX = new EFP (P, 1023, 0xfffffffffffff800L, 0x0000000L << 36);
670: public final EFP DBLDEMIN = new EFP (P, -1074, 0x8000000000000000L, 0x0000000L << 36);
671: public final EFP NEGDBLDEMIN = new EFP (M, -1074, 0x8000000000000000L, 0x0000000L << 36);
672: public final EFP NEGDBLNOMAX = new EFP (M, 1023, 0xfffffffffffff800L, 0x0000000L << 36);
673: public final EFP TPLNOMAX = new EFP (P, 16383, 0xffffffffffffffffL, 0xffff000L << 36);
674: public final EFP TPLDEMIN = new EFP (P, -16462, 0x8000000000000000L, 0x0000000L << 36);
675: public final EFP NEGTPLDEMIN = new EFP (M, -16462, 0x8000000000000000L, 0x0000000L << 36);
676: public final EFP NEGTPLNOMAX = new EFP (M, 16383, 0xffffffffffffffffL, 0xffff000L << 36);
677: public final EFP XSGNOMAX = new EFP (P, 16383, 0xffffff0000000000L, 0x0000000L << 36);
678: public final EFP XSGDEMIN = new EFP (P, -16406, 0x8000000000000000L, 0x0000000L << 36);
679: public final EFP NEGXSGDEMIN = new EFP (M, -16406, 0x8000000000000000L, 0x0000000L << 36);
680: public final EFP NEGXSGNOMAX = new EFP (M, 16383, 0xffffff0000000000L, 0x0000000L << 36);
681: public final EFP EFPNOMAX = new EFP (P, 32767, 0xffffffffffffffffL, 0xfffffffL << 36);
682: public final EFP EFPDEMIN = new EFP (P, -32768, 0x8000000000000000L, 0x0000000L << 36);
683: public final EFP NEGEFPDEMIN = new EFP (M, -32768, 0x8000000000000000L, 0x0000000L << 36);
684: public final EFP NEGEFPNOMAX = new EFP (M, 32767, 0xffffffffffffffffL, 0xfffffffL << 36);
685:
686:
687:
688:
689:
690:
691:
692:
693:
694: public final EFP[] OVFL_RESULTS = new EFP[] {
695: INF,
696: NEGINF,
697: EXDNOMAX,
698: NEGEXDNOMAX,
699: EXDNOMAX,
700: NEGINF,
701: INF,
702: NEGEXDNOMAX,
703:
704: INF,
705: NEGINF,
706: SGLNOMAX,
707: NEGSGLNOMAX,
708: SGLNOMAX,
709: NEGINF,
710: INF,
711: NEGSGLNOMAX,
712:
713: INF,
714: NEGINF,
715: DBLNOMAX,
716: NEGDBLNOMAX,
717: DBLNOMAX,
718: NEGINF,
719: INF,
720: NEGDBLNOMAX,
721:
722: INF,
723: NEGINF,
724: DBLNOMAX,
725: NEGDBLNOMAX,
726: DBLNOMAX,
727: NEGINF,
728: INF,
729: NEGDBLNOMAX,
730:
731: INF,
732: NEGINF,
733: TPLNOMAX,
734: NEGTPLNOMAX,
735: TPLNOMAX,
736: NEGINF,
737: INF,
738: NEGTPLNOMAX,
739:
740: INF,
741: NEGINF,
742: EXDNOMAX,
743: NEGEXDNOMAX,
744: EXDNOMAX,
745: NEGINF,
746: INF,
747: NEGEXDNOMAX,
748:
749: INF,
750: NEGINF,
751: EFPNOMAX,
752: NEGEFPNOMAX,
753: EFPNOMAX,
754: NEGINF,
755: INF,
756: NEGEFPNOMAX,
757: };
758:
759:
760:
761:
762:
763:
764:
765:
766:
767: public final EFP[] UNFL_RESULTS = new EFP[] {
768: ZERO,
769: NEGZERO,
770: ZERO,
771: NEGZERO,
772: ZERO,
773: NEGEXDDEMIN,
774: EXDDEMIN,
775: NEGZERO,
776:
777: ZERO,
778: NEGZERO,
779: ZERO,
780: NEGZERO,
781: ZERO,
782: NEGSGLDEMIN,
783: SGLDEMIN,
784: NEGZERO,
785:
786: ZERO,
787: NEGZERO,
788: ZERO,
789: NEGZERO,
790: ZERO,
791: NEGDBLDEMIN,
792: DBLDEMIN,
793: NEGZERO,
794:
795: ZERO,
796: NEGZERO,
797: ZERO,
798: NEGZERO,
799: ZERO,
800: NEGDBLDEMIN,
801: DBLDEMIN,
802: NEGZERO,
803:
804: ZERO,
805: NEGZERO,
806: ZERO,
807: NEGZERO,
808: ZERO,
809: NEGTPLDEMIN,
810: TPLDEMIN,
811: NEGZERO,
812:
813: ZERO,
814: NEGZERO,
815: ZERO,
816: NEGZERO,
817: ZERO,
818: NEGXSGDEMIN,
819: XSGDEMIN,
820: NEGZERO,
821:
822: ZERO,
823: NEGZERO,
824: ZERO,
825: NEGZERO,
826: ZERO,
827: NEGEFPDEMIN,
828: EFPDEMIN,
829: NEGZERO,
830: };
831:
832:
833:
834:
835:
836: public final EFP[] NEXTDOWN_MINUSONE = {
837:
838: new EFP (M, 0, 0x8000000000000001L, 0x0000000L << 36),
839: new EFP (M, 0, 0x8000010000000000L, 0x0000000L << 36),
840: new EFP (M, 0, 0x8000000000000800L, 0x0000000L << 36),
841: new EFP (M, 0, 0x8000000000000800L, 0x0000000L << 36),
842: new EFP (M, 0, 0x8000000000000000L, 0x0001000L << 36),
843: new EFP (M, 0, 0x8000010000000000L, 0x0000000L << 36),
844: new EFP (M, 0, 0x8000000000000000L, 0x0000001L << 36),
845: };
846: public final EFP[] NEXTUP_MINUSONE = {
847:
848: new EFP (M, -1, 0xffffffffffffffffL, 0x0000000L << 36),
849: new EFP (M, -1, 0xffffff0000000000L, 0x0000000L << 36),
850: new EFP (M, -1, 0xfffffffffffff800L, 0x0000000L << 36),
851: new EFP (M, -1, 0xfffffffffffff800L, 0x0000000L << 36),
852: new EFP (M, -1, 0xffffffffffffffffL, 0xffff000L << 36),
853: new EFP (M, -1, 0xffffff0000000000L, 0x0000000L << 36),
854: new EFP (M, -1, 0xffffffffffffffffL, 0xfffffffL << 36),
855: };
856: public final EFP[] NEXTDOWN_PLUSONE = {
857:
858: new EFP (P, -1, 0xffffffffffffffffL, 0x0000000L << 36),
859: new EFP (P, -1, 0xffffff0000000000L, 0x0000000L << 36),
860: new EFP (P, -1, 0xfffffffffffff800L, 0x0000000L << 36),
861: new EFP (P, -1, 0xfffffffffffff800L, 0x0000000L << 36),
862: new EFP (P, -1, 0xffffffffffffffffL, 0xffff000L << 36),
863: new EFP (P, -1, 0xffffff0000000000L, 0x0000000L << 36),
864: new EFP (P, -1, 0xffffffffffffffffL, 0xfffffffL << 36),
865: };
866: public final EFP[] NEXTUP_PLUSONE = {
867:
868: new EFP (P, 0, 0x8000000000000001L, 0x0000000L << 36),
869: new EFP (P, 0, 0x8000010000000000L, 0x0000000L << 36),
870: new EFP (P, 0, 0x8000000000000800L, 0x0000000L << 36),
871: new EFP (P, 0, 0x8000000000000800L, 0x0000000L << 36),
872: new EFP (P, 0, 0x8000000000000000L, 0x0001000L << 36),
873: new EFP (P, 0, 0x8000010000000000L, 0x0000000L << 36),
874: new EFP (P, 0, 0x8000000000000000L, 0x0000001L << 36),
875: };
876:
877:
878:
879:
880: public final EFP NEGONE = new EFP (M, 0, 0x8000000000000000L, 0x0000000L << 36);
881: public final EFP ONE = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
882: public final EFP TWO = new EFP (P, 1, 0x8000000000000000L, 0x0000000L << 36);
883: public final EFP THREE = new EFP (P, 1, 0xc000000000000000L, 0x0000000L << 36);
884: public final EFP FOUR = new EFP (P, 2, 0x8000000000000000L, 0x0000000L << 36);
885: public final EFP FIVE = new EFP (P, 2, 0xa000000000000000L, 0x0000000L << 36);
886: public final EFP SIX = new EFP (P, 2, 0xc000000000000000L, 0x0000000L << 36);
887: public final EFP SEVEN = new EFP (P, 2, 0xe000000000000000L, 0x0000000L << 36);
888: public final EFP EIGHT = new EFP (P, 3, 0x8000000000000000L, 0x0000000L << 36);
889: public final EFP NINE = new EFP (P, 3, 0x9000000000000000L, 0x0000000L << 36);
890: public final EFP TEN = new EFP (P, 3, 0xa000000000000000L, 0x0000000L << 36);
891: public final EFP ELEVEN = new EFP (P, 3, 0xb000000000000000L, 0x0000000L << 36);
892: public final EFP TWELVE = new EFP (P, 3, 0xc000000000000000L, 0x0000000L << 36);
893: public final EFP THIRTEEN = new EFP (P, 3, 0xd000000000000000L, 0x0000000L << 36);
894: public final EFP FOURTEEN = new EFP (P, 3, 0xe000000000000000L, 0x0000000L << 36);
895: public final EFP FIFTEEN = new EFP (P, 3, 0xf000000000000000L, 0x0000000L << 36);
896: public final EFP SIXTEEN = new EFP (P, 4, 0x8000000000000000L, 0x0000000L << 36);
897: public final EFP[] EFP_DIGIT = {
898: ZERO,
899: ONE,
900: TWO,
901: THREE,
902: FOUR,
903: FIVE,
904: SIX,
905: SEVEN,
906: EIGHT,
907: NINE,
908: TEN,
909: ELEVEN,
910: TWELVE,
911: THIRTEEN,
912: FOURTEEN,
913: FIFTEEN,
914: SIXTEEN,
915: };
916:
917: public final EFP ONE_2 = new EFP (P, -1, 0x8000000000000000L, 0x0000000L << 36);
918: public final EFP ONE_3 = new EFP (P, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaabL << 36);
919: public final EFP TWO_3 = new EFP (P, -1, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaabL << 36);
920: public final EFP ONE_4 = new EFP (P, -2, 0x8000000000000000L, 0x0000000L << 36);
921: public final EFP THREE_4 = new EFP (P, -1, 0xc000000000000000L, 0x0000000L << 36);
922: public final EFP ONE_5 = new EFP (P, -3, 0xccccccccccccccccL, 0xccccccdL << 36);
923: public final EFP TWO_5 = new EFP (P, -2, 0xccccccccccccccccL, 0xccccccdL << 36);
924: public final EFP THREE_5 = new EFP (P, -1, 0x9999999999999999L, 0x999999aL << 36);
925: public final EFP FOUR_5 = new EFP (P, -1, 0xccccccccccccccccL, 0xccccccdL << 36);
926: public final EFP ONE_6 = new EFP (P, -3, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaabL << 36);
927: public final EFP FIVE_6 = new EFP (P, -1, 0xd555555555555555L, 0x5555555L << 36);
928: public final EFP ONE_10 = new EFP (P, -4, 0xccccccccccccccccL, 0xccccccdL << 36);
929:
930: public final EFP SQRT2 = new EFP (P, 0, 0xb504f333f9de6484L, 0x597d89bL << 36);
931: public final EFP SQRT2A = new EFP (P, -94, 0xdd52afa7c75bd82eL, 0xa24eea1L << 36);
932: public final EFP SQRT2_2 = new EFP (P, -1, 0xb504f333f9de6484L, 0x597d89bL << 36);
933: public final EFP SQRT2_2A = new EFP (P, -95, 0xdd52afa7c75bd82eL, 0xa24eea1L << 36);
934: public final EFP DECSQRT2 = new EFP (P, -2, 0xd413cccfe7799211L, 0x65f626dL << 36);
935: public final EFP DECSQRT2A = new EFP (M, -96, 0x8ab54160e2909f45L, 0x76c457bL << 36);
936: public final EFP INCSQRT2 = new EFP (P, 1, 0x9a827999fcef3242L, 0x2cbec4eL << 36);
937: public final EFP INCSQRT2A = new EFP (M, -92, 0xc8ab54160e2909f4L, 0x576c458L << 36);
938:
939: public final EFP PI = new EFP (P, 1, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
940: public final EFP PIA = new EFP (M, -92, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
941: public final EFP NEGPI = new EFP (M, 1, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
942: public final EFP NEGPIA = new EFP (P, -92, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
943: public final EFP PI2 = new EFP (P, 2, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
944: public final EFP PI2A = new EFP (M, -91, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
945: public final EFP PI_2 = new EFP (P, 0, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
946: public final EFP PI_2A = new EFP (M, -93, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
947: public final EFP NEGPI_2 = new EFP (M, 0, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
948: public final EFP NEGPI_2A = new EFP (P, -93, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
949: public final EFP PI3_2 = new EFP (P, 2, 0x96cbe3f9990e91a7L, 0x9394c9fL << 36);
950: public final EFP PI3_2A = new EFP (M, -91, 0xebeb5d4c6427c8afL, 0x330644dL << 36);
951: public final EFP PI_4 = new EFP (P, -1, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
952: public final EFP PI_4A = new EFP (M, -94, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
953: public final EFP NEGPI_4 = new EFP (M, -1, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
954: public final EFP NEGPI_4A = new EFP (P, -94, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
955: public final EFP PI3_4 = new EFP (P, 1, 0x96cbe3f9990e91a7L, 0x9394c9fL << 36);
956: public final EFP PI3_4A = new EFP (M, -92, 0xebeb5d4c6427c8afL, 0x330644dL << 36);
957: public final EFP NEGPI3_4 = new EFP (M, 1, 0x96cbe3f9990e91a7L, 0x9394c9fL << 36);
958: public final EFP NEGPI3_4A = new EFP (P, -92, 0xebeb5d4c6427c8afL, 0x330644dL << 36);
959: public final EFP PI_6 = new EFP (P, -1, 0x860a91c16b9b2c23L, 0x2dd9970L << 36);
960: public final EFP PI_6A = new EFP (P, -94, 0xf567ad116e158680L, 0xb633511L << 36);
961: public final EFP PI_8 = new EFP (P, -2, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
962: public final EFP PI_8A = new EFP (M, -95, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
963: public final EFP TO_RAD = new EFP (P, -6, 0x8efa351294e9c8aeL, 0x0ec5f67L << 36);
964: public final EFP TO_RADA = new EFP (M, -101, 0xb5bd1d937fa42885L, 0x7f250caL << 36);
965:
966: public final EFP ONE_2PI = new EFP (P, -3, 0xa2f9836e4e441529L, 0xfc2757dL << 36);
967: public final EFP ONE_2PIA = new EFP (P, -98, 0xfa9a6ee06db14accL, 0x9e21c82L << 36);
968: public final EFP ONE_PI = new EFP (P, -2, 0xa2f9836e4e441529L, 0xfc2757dL << 36);
969: public final EFP ONE_PIA = new EFP (P, -97, 0xfa9a6ee06db14accL, 0x9e21c82L << 36);
970: public final EFP TWO_PI = new EFP (P, -1, 0xa2f9836e4e441529L, 0xfc2757dL << 36);
971: public final EFP TWO_PIA = new EFP (P, -96, 0xfa9a6ee06db14accL, 0x9e21c82L << 36);
972: public final EFP FOUR_PI = new EFP (P, 0, 0xa2f9836e4e441529L, 0xfc2757dL << 36);
973: public final EFP FOUR_PIA = new EFP (P, -95, 0xfa9a6ee06db14accL, 0x9e21c82L << 36);
974: public final EFP TO_DEG = new EFP (P, 5, 0xe52ee0d31e0fbdc3L, 0x0a97538L << 36);
975: public final EFP TO_DEGA = new EFP (M, -91, 0xbf2da828cb7d5da0L, 0x8340fd2L << 36);
976:
977: public final EFP E = new EFP (P, 1, 0xadf85458a2bb4a9aL, 0xafdc562L << 36);
978: public final EFP EA = new EFP (P, -97, 0x9cf4f3c762e7160fL, 0x38b4da5L << 36);
979:
980: public final EFP LOG_2 = new EFP (P, -1, 0xb17217f7d1cf79abL, 0xc9e3b3aL << 36);
981: public final EFP LOG_2A = new EFP (M, -94, 0xff81a12a17e1979bL, 0x31ace94L << 36);
982: public final EFP LOG_2_2 = new EFP (P, -2, 0xb17217f7d1cf79abL, 0xc9e3b3aL << 36);
983: public final EFP LOG_2_2A = new EFP (M, -95, 0xff81a12a17e1979bL, 0x31ace94L << 36);
984: public final EFP LOG_10 = new EFP (P, 1, 0x935d8dddaaa8ac16L, 0xea56d63L << 36);
985: public final EFP LOG_10A = new EFP (M, -92, 0x8fa59ebae3ae0260L, 0xc4b440eL << 36);
986: public final EFP LOG2_E = new EFP (P, 0, 0xb8aa3b295c17f0bbL, 0xbe87fedL << 36);
987: public final EFP LOG2_EA = new EFP (P, -97, 0xd23a7d11d6aef551L, 0xbad2b4bL << 36);
988: public final EFP LOG2_10 = new EFP (P, 1, 0xd49a784bcd1b8afeL, 0x492bf70L << 36);
989: public final EFP LOG2_10A = new EFP (M, -95, 0xb25024b32693aa01L, 0xc84c52bL << 36);
990: public final EFP LOG10_2 = new EFP (P, -2, 0x9a209a84fbcff798L, 0x8f8959bL << 36);
991: public final EFP LOG10_2A = new EFP (M, -96, 0xfd20dba1f654b3ceL, 0xaf0b833L << 36);
992: public final EFP LOG10_E = new EFP (P, -2, 0xde5bd8a937287195L, 0x355baabL << 36);
993: public final EFP LOG10_EA = new EFP (M, -99, 0xa598479b823973fbL, 0x746cbc0L << 36);
994:
995: public final EFP TENXP1 = new EFP (P, 6, 0xc800000000000000L, 0x0000000L << 36);
996: public final EFP TENXP2 = new EFP (P, 13, 0x9c40000000000000L, 0x0000000L << 36);
997: public final EFP TENXP3 = new EFP (P, 26, 0xbebc200000000000L, 0x0000000L << 36);
998: public final EFP TENXP4 = new EFP (P, 53, 0x8e1bc9bf04000000L, 0x0000000L << 36);
999: public final EFP TENXP5 = new EFP (P, 106, 0x9dc5ada82b70b59dL, 0xf020000L << 36);
1000: public final EFP TENXP6 = new EFP (P, 212, 0xc2781f49ffcfa6d5L, 0x3cbf6b7L << 36);
1001: public final EFP TENXP7 = new EFP (P, 425, 0x93ba47c980e98cdfL, 0xc66f337L << 36);
1002: public final EFP TENXP8 = new EFP (P, 850, 0xaa7eebfb9df9de8dL, 0xddbb902L << 36);
1003: public final EFP TENXP9 = new EFP (P, 1700, 0xe319a0aea60e91c6L, 0xcc655c5L << 36);
1004: public final EFP TENXP10 = new EFP (P, 3401, 0xc976758681750c17L, 0x650d3d3L << 36);
1005: public final EFP TENXP11 = new EFP (P, 6803, 0x9e8b3b5dc53d5de4L, 0xa74d28dL << 36);
1006: public final EFP TENXP12 = new EFP (P, 13606, 0xc46052028a20979aL, 0xc94c154L << 36);
1007: public final EFP TENXP13 = new EFP (P, 27213, 0x96a3a1d17faf211aL, 0x0c7c289L << 36);
1008: public final EFP TENXP14 = new EFP (P, 54426, 0xb1485471f16603b5L, 0x6226e11L << 36);
1009: public final EFP[] EFP_TEN_POWER_P = {
1010: TEN,
1011: TENXP1,
1012: TENXP2,
1013: TENXP3,
1014: TENXP4,
1015: TENXP5,
1016: TENXP6,
1017: TENXP7,
1018: TENXP8,
1019: TENXP9,
1020: TENXP10,
1021: TENXP11,
1022: TENXP12,
1023: TENXP13,
1024: TENXP14,
1025: INF,
1026: };
1027:
1028: public final EFP TENXM1 = new EFP (P, -7, 0xa3d70a3d70a3d70aL, 0x3d70a3dL << 36);
1029: public final EFP TENXM2 = new EFP (P, -14, 0xd1b71758e219652bL, 0xd3c3611L << 36);
1030: public final EFP TENXM3 = new EFP (P, -27, 0xabcc77118461cefcL, 0xfdc20d3L << 36);
1031: public final EFP TENXM4 = new EFP (P, -54, 0xe69594bec44de15bL, 0x4c2ebe7L << 36);
1032: public final EFP TENXM5 = new EFP (P, -107, 0xcfb11ead453994baL, 0x67de18fL << 36);
1033: public final EFP TENXM6 = new EFP (P, -213, 0xa87fea27a539e9a5L, 0x3f2398dL << 36);
1034: public final EFP TENXM7 = new EFP (P, -426, 0xddd0467c64bce4a0L, 0xac7cb3fL << 36);
1035: public final EFP TENXM8 = new EFP (P, -851, 0xc0314325637a1939L, 0xfa91115L << 36);
1036: public final EFP TENXM9 = new EFP (P, -1701, 0x9049ee32db23d21cL, 0x7132d33L << 36);
1037: public final EFP TENXM10 = new EFP (P, -3402, 0xa2a682a5da57c0bdL, 0x87a6016L << 36);
1038: public final EFP TENXM11 = new EFP (P, -6804, 0xceae534f34362de4L, 0x492512dL << 36);
1039: public final EFP TENXM12 = new EFP (P, -13607, 0xa6dd04c8d2ce9fdeL, 0x2de3812L << 36);
1040: public final EFP TENXM13 = new EFP (P, -27214, 0xd986c20b686da869L, 0x5d1d4feL << 36);
1041: public final EFP TENXM14 = new EFP (P, -54427, 0xb8d5bbe70e108517L, 0x456e9e1L << 36);
1042: public final EFP[] EFP_TEN_POWER_M = {
1043: ONE_10,
1044: TENXM1,
1045: TENXM2,
1046: TENXM3,
1047: TENXM4,
1048: TENXM5,
1049: TENXM6,
1050: TENXM7,
1051: TENXM8,
1052: TENXM9,
1053: TENXM10,
1054: TENXM11,
1055: TENXM12,
1056: TENXM13,
1057: TENXM14,
1058: ZERO,
1059: };
1060:
1061:
1062:
1063:
1064: public final EFP ASIN_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1065: public final EFP ASIN_C3 = new EFP (P, -3, 0xaaaaaaaaaaaaaaaaL, 0xaa9f5a6L << 36);
1066: public final EFP ASIN_C5 = new EFP (P, -4, 0x999999999999999bL, 0x27bc1b8L << 36);
1067: public final EFP ASIN_C7 = new EFP (P, -5, 0xb6db6db6db6d9dfbL, 0x62327e8L << 36);
1068: public final EFP ASIN_C9 = new EFP (P, -6, 0xf8e38e38e465b639L, 0x780782eL << 36);
1069: public final EFP ASIN_C11 = new EFP (P, -6, 0xb745d17238e942a1L, 0xe80f5beL << 36);
1070: public final EFP ASIN_C13 = new EFP (P, -6, 0x8e2765c0b9aaa792L, 0xa93870aL << 36);
1071: public final EFP ASIN_C15 = new EFP (P, -7, 0xe4c6ca7a5689895bL, 0x0fdd729L << 36);
1072: public final EFP ASIN_C17 = new EFP (P, -7, 0xc0428d0d9769d446L, 0x583b42dL << 36);
1073:
1074:
1075:
1076:
1077:
1078: public final EFP ASINH_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1079: public final EFP ASINH_C3 = new EFP (M, -3, 0xaaaaaaaaaaaaaaaaL, 0xaaaa73cL << 36);
1080: public final EFP ASINH_C5 = new EFP (P, -4, 0x9999999999999999L, 0x98eba3eL << 36);
1081: public final EFP ASINH_C7 = new EFP (M, -5, 0xb6db6db6db6db6daL, 0x693062cL << 36);
1082: public final EFP ASINH_C9 = new EFP (P, -6, 0xf8e38e38e38e3802L, 0x877ce5fL << 36);
1083: public final EFP ASINH_C11 = new EFP (M, -6, 0xb745d1745d17072fL, 0x8f119f4L << 36);
1084: public final EFP ASINH_C13 = new EFP (P, -6, 0x8e27627627566903L, 0xdf845ccL << 36);
1085: public final EFP ASINH_C15 = new EFP (M, -7, 0xe4ccccccc9700e9eL, 0xe0b4a69L << 36);
1086: public final EFP ASINH_C17 = new EFP (P, -7, 0xbd43c3c369baae2eL, 0x0efcbb2L << 36);
1087: public final EFP ASINH_C19 = new EFP (M, -7, 0x9fef28648d7f5526L, 0x95df2b5L << 36);
1088: public final EFP ASINH_C21 = new EFP (P, -7, 0x89779e056ca4e338L, 0xd00497cL << 36);
1089: public final EFP ASINH_C23 = new EFP (M, -8, 0xef9dde222ea1963bL, 0xe27b426L << 36);
1090: public final EFP ASINH_C25 = new EFP (P, -8, 0xd342a867c46a40d7L, 0x608fa17L << 36);
1091: public final EFP ASINH_C27 = new EFP (M, -8, 0xbc1323a7fe6984a7L, 0x201509dL << 36);
1092: public final EFP ASINH_C29 = new EFP (P, -8, 0xa8c41a9477d0f87aL, 0x533f07cL << 36);
1093: public final EFP ASINH_C31 = new EFP (M, -8, 0x982f5aab1d57a757L, 0x87f7027L << 36);
1094: public final EFP ASINH_C33 = new EFP (P, -8, 0x88c1b2170947d07cL, 0x03ff2fcL << 36);
1095: public final EFP ASINH_C35 = new EFP (M, -9, 0xef58f638c3ca7cffL, 0x77a770cL << 36);
1096: public final EFP ASINH_C37 = new EFP (P, -9, 0xc1c49585f23563ecL, 0x9a83aedL << 36);
1097: public final EFP ASINH_C39 = new EFP (M, -9, 0x844314a5dc2c3362L, 0x37b5811L << 36);
1098: public final EFP ASINH_C41 = new EFP (P, -10, 0x824564bc0126d26dL, 0x0c5dd9fL << 36);
1099: public final EFP ASINH_C43 = new EFP (M, -12, 0x85dfcbe40f7ac39fL, 0xb82e7c3L << 36);
1100:
1101:
1102:
1103:
1104:
1105: public final EFP ATAN_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1106: public final EFP ATAN_C3 = new EFP (M, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaa510L << 36);
1107: public final EFP ATAN_C5 = new EFP (P, -3, 0xccccccccccccccccL, 0xcb75e59L << 36);
1108: public final EFP ATAN_C7 = new EFP (M, -3, 0x9249249249249247L, 0xef2e1e8L << 36);
1109: public final EFP ATAN_C9 = new EFP (P, -4, 0xe38e38e38e38e24dL, 0x0fb9b9aL << 36);
1110: public final EFP ATAN_C11 = new EFP (M, -4, 0xba2e8ba2e8b9c37fL, 0xd40106dL << 36);
1111: public final EFP ATAN_C13 = new EFP (P, -4, 0x9d89d89d89c01044L, 0xee8e878L << 36);
1112: public final EFP ATAN_C15 = new EFP (M, -4, 0x888888888479743eL, 0xd1a4c1cL << 36);
1113: public final EFP ATAN_C17 = new EFP (P, -5, 0xf0f0f0eff12a86f3L, 0x34f4f78L << 36);
1114: public final EFP ATAN_C19 = new EFP (M, -5, 0xd79435cd132b46adL, 0x026fbddL << 36);
1115: public final EFP ATAN_C21 = new EFP (P, -5, 0xc30c2f05b9b60e24L, 0x4f7cf62L << 36);
1116: public final EFP ATAN_C23 = new EFP (M, -5, 0xb216298497a81754L, 0x9c69988L << 36);
1117: public final EFP ATAN_C25 = new EFP (P, -5, 0xa3d5e99dc5d0a87cL, 0x531842aL << 36);
1118: public final EFP ATAN_C27 = new EFP (M, -5, 0x97aa006d0e00c9c7L, 0x30d6815L << 36);
1119: public final EFP ATAN_C29 = new EFP (P, -5, 0x8cf60e9e64655ffeL, 0x38ac19cL << 36);
1120: public final EFP ATAN_C31 = new EFP (M, -5, 0x82959208f1c7a2afL, 0xdae8a29L << 36);
1121: public final EFP ATAN_C33 = new EFP (P, -6, 0xeb2210cae680d538L, 0x15fff4fL << 36);
1122: public final EFP ATAN_C35 = new EFP (M, -6, 0xc010e629b0e973a6L, 0xe64c5d3L << 36);
1123: public final EFP ATAN_C37 = new EFP (P, -7, 0xf4fd1335dff0ecefL, 0x1237cb3L << 36);
1124: public final EFP ATAN_C39 = new EFP (M, -8, 0xae06e746e01494ddL, 0xc1bb093L << 36);
1125:
1126:
1127:
1128:
1129:
1130: public final EFP ATANH_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1131: public final EFP ATANH_C3 = new EFP (P, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaab40L << 36);
1132: public final EFP ATANH_C5 = new EFP (P, -3, 0xccccccccccccccccL, 0xcb39274L << 36);
1133: public final EFP ATANH_C7 = new EFP (P, -3, 0x9249249249249258L, 0xc166b48L << 36);
1134: public final EFP ATANH_C9 = new EFP (P, -4, 0xe38e38e38e38399dL, 0xe3605a0L << 36);
1135: public final EFP ATANH_C11 = new EFP (P, -4, 0xba2e8ba2eae60f89L, 0xa98ab82L << 36);
1136: public final EFP ATANH_C13 = new EFP (P, -4, 0x9d89d8991665e749L, 0xd36e921L << 36);
1137: public final EFP ATANH_C15 = new EFP (P, -4, 0x88888e4ace4d77aaL, 0xa2aa416L << 36);
1138: public final EFP ATANH_C17 = new EFP (P, -5, 0xf0e7cfa2bdbf9821L, 0x93bcd2aL << 36);
1139: public final EFP ATANH_C19 = new EFP (P, -5, 0xdb9f4d0dedd2896fL, 0x4b48c7fL << 36);
1140:
1141: public final EFP[] ATH_T = {
1142:
1143: new EFP (P, -3, 0xafb0ccc06219b7baL, 0x682764dL << 36),
1144: new EFP (P, -2, 0xf486f8adc4df1a3fL, 0x3373579L << 36),
1145: new EFP (P, -1, 0xb31638273cf89250L, 0x55f0c13L << 36),
1146: new EFP (P, -1, 0xd66b9a67d12abc57L, 0x98d2421L << 36),
1147: new EFP (P, -1, 0xea548bdf707c71a8L, 0x48f4c93L << 36),
1148: new EFP (P, -1, 0xf4ee4e9693348047L, 0xc360937L << 36),
1149: new EFP (P, -1, 0xfa67aba3bd4ef753L, 0x97d0d24L << 36),
1150: new EFP (P, -1, 0xfd2fe692fd3e80eaL, 0xf06feacL << 36),
1151: new EFP (P, -1, 0xfe96f56512becc96L, 0x5d9833cL << 36),
1152: new EFP (P, -1, 0xff4b3af63364e808L, 0x18a7859L << 36),
1153: new EFP (P, -1, 0xffa58d83926f2d61L, 0x373e4afL << 36),
1154: new EFP (P, -1, 0xffd2c2c2d8870e17L, 0xed05d07L << 36),
1155: new EFP (P, -1, 0xffe960618e30f4faL, 0x87ef4d9L << 36),
1156: new EFP (P, -1, 0xfff4aff0cb566033L, 0x22866e9L << 36),
1157: new EFP (P, -1, 0xfffa57e86632f050L, 0x0d74b69L << 36),
1158: new EFP (P, -1, 0xfffd2bf0332a7066L, 0xd4437adL << 36),
1159: new EFP (P, -1, 0xfffe95f71997573eL, 0xc3c2f8aL << 36),
1160: new EFP (P, -1, 0xffff4afb4ccbef81L, 0x0515247L << 36),
1161: new EFP (P, -1, 0xffffa57d9666003cL, 0xba71034L << 36),
1162: new EFP (P, -1, 0xffffd2bec733012dL, 0xe46d4faL << 36),
1163: new EFP (P, -1, 0xffffe95f629980b8L, 0xe320c19L << 36),
1164: new EFP (P, -1, 0xfffff4afb10cc060L, 0xafaddc0L << 36),
1165: new EFP (P, -1, 0xfffffa57d8766030L, 0xdf9aa0eL << 36),
1166: new EFP (P, -1, 0xfffffd2bec373018L, 0x80c5c71L << 36),
1167: new EFP (P, -1, 0xfffffe95f61a980cL, 0x4281f26L << 36),
1168: new EFP (P, -1, 0xffffff4afb0d0c06L, 0x2184db1L << 36),
1169: new EFP (P, -1, 0xffffffa57d867603L, 0x10cae9cL << 36),
1170: new EFP (P, -1, 0xffffffd2bec33701L, 0x8866846L << 36),
1171: new EFP (P, -1, 0xffffffe95f619a80L, 0xc433642L << 36),
1172: new EFP (P, -1, 0xfffffff4afb0cd00L, 0x6219b65L << 36),
1173: new EFP (P, -1, 0xfffffffa57d86670L, 0x310cdbbL << 36),
1174: new EFP (P, -1, 0xfffffffd2bec3334L, 0x18866dfL << 36),
1175: new EFP (P, -1, 0xfffffffe95f61999L, 0x0c4336fL << 36),
1176: new EFP (P, -1, 0xffffffff4afb0cccL, 0x46219b8L << 36),
1177: new EFP (P, -1, 0xffffffffa57d8666L, 0x1310cdcL << 36),
1178: new EFP (P, -1, 0xffffffffd2bec333L, 0x058866eL << 36),
1179: new EFP (P, -1, 0xffffffffe95f6199L, 0x81c4337L << 36),
1180: new EFP (P, -1, 0xfffffffff4afb0ccL, 0xc0a219bL << 36),
1181: new EFP (P, -1, 0xfffffffffa57d866L, 0x60410ceL << 36),
1182: new EFP (P, -1, 0xfffffffffd2bec33L, 0x301c867L << 36),
1183: new EFP (P, -1, 0xfffffffffe95f619L, 0x980d433L << 36),
1184: new EFP (P, -1, 0xffffffffff4afb0cL, 0xcc0661aL << 36),
1185: new EFP (P, -1, 0xffffffffffa57d86L, 0x660320dL << 36),
1186: new EFP (P, -1, 0xffffffffffd2bec3L, 0x33018c6L << 36),
1187: new EFP (P, -1, 0xffffffffffe95f61L, 0x9980c53L << 36),
1188: new EFP (P, -1, 0xfffffffffff4afb0L, 0xccc0626L << 36),
1189: new EFP (P, -1, 0xfffffffffffa57d8L, 0x6660312L << 36),
1190: new EFP (P, -1, 0xfffffffffffd2becL, 0x3330189L << 36),
1191: new EFP (P, -1, 0xfffffffffffe95f6L, 0x19980c4L << 36),
1192: new EFP (P, -1, 0xffffffffffff4afbL, 0x0ccc062L << 36),
1193: new EFP (P, -1, 0xffffffffffffa57dL, 0x8666031L << 36),
1194: new EFP (P, -1, 0xffffffffffffd2beL, 0xc333019L << 36),
1195: new EFP (P, -1, 0xffffffffffffe95fL, 0x619980cL << 36),
1196: new EFP (P, -1, 0xfffffffffffff4afL, 0xb0ccc06L << 36),
1197: new EFP (P, -1, 0xfffffffffffffa57L, 0xd866603L << 36),
1198: new EFP (P, -1, 0xfffffffffffffd2bL, 0xec33302L << 36),
1199: new EFP (P, -1, 0xfffffffffffffe95L, 0xf619981L << 36),
1200: new EFP (P, -1, 0xffffffffffffff4aL, 0xfb0ccc0L << 36),
1201: new EFP (P, -1, 0xffffffffffffffa5L, 0x7d86660L << 36),
1202: new EFP (P, -1, 0xffffffffffffffd2L, 0xbec3330L << 36),
1203: new EFP (P, -1, 0xffffffffffffffe9L, 0x5f61998L << 36),
1204: new EFP (P, -1, 0xfffffffffffffff4L, 0xafb0cccL << 36),
1205: new EFP (P, -1, 0xfffffffffffffffaL, 0x57d8666L << 36),
1206: new EFP (P, -1, 0xfffffffffffffffdL, 0x2bec333L << 36),
1207: new EFP (P, -1, 0xfffffffffffffffeL, 0x95f619aL << 36),
1208: new EFP (P, -1, 0xffffffffffffffffL, 0x4afb0cdL << 36),
1209: new EFP (P, -1, 0xffffffffffffffffL, 0xa57d866L << 36),
1210: new EFP (P, -1, 0xffffffffffffffffL, 0xd2bec33L << 36),
1211: new EFP (P, -1, 0xffffffffffffffffL, 0xe95f61aL << 36),
1212: new EFP (P, -1, 0xffffffffffffffffL, 0xf4afb0dL << 36),
1213: new EFP (P, -1, 0xffffffffffffffffL, 0xfa57d86L << 36),
1214: new EFP (P, -1, 0xffffffffffffffffL, 0xfd2bec3L << 36),
1215: new EFP (P, -1, 0xffffffffffffffffL, 0xfe95f62L << 36),
1216: new EFP (P, -1, 0xffffffffffffffffL, 0xff4afb1L << 36),
1217: new EFP (P, -1, 0xffffffffffffffffL, 0xffa57d8L << 36),
1218: new EFP (P, -1, 0xffffffffffffffffL, 0xffd2becL << 36),
1219: new EFP (P, -1, 0xffffffffffffffffL, 0xffe95f6L << 36),
1220: new EFP (P, -1, 0xffffffffffffffffL, 0xfff4afbL << 36),
1221: new EFP (P, -1, 0xffffffffffffffffL, 0xfffa57eL << 36),
1222: new EFP (P, -1, 0xffffffffffffffffL, 0xfffd2bfL << 36),
1223: new EFP (P, -1, 0xffffffffffffffffL, 0xfffe95fL << 36),
1224: new EFP (P, -1, 0xffffffffffffffffL, 0xffff4b0L << 36),
1225: new EFP (P, -1, 0xffffffffffffffffL, 0xffffa58L << 36),
1226: new EFP (P, -1, 0xffffffffffffffffL, 0xffffd2cL << 36),
1227: new EFP (P, -1, 0xffffffffffffffffL, 0xffffe96L << 36),
1228: new EFP (P, -1, 0xffffffffffffffffL, 0xfffff4bL << 36),
1229: new EFP (P, -1, 0xffffffffffffffffL, 0xfffffa5L << 36),
1230: new EFP (P, -1, 0xffffffffffffffffL, 0xfffffd3L << 36),
1231: new EFP (P, -1, 0xffffffffffffffffL, 0xfffffe9L << 36),
1232: new EFP (P, -1, 0xffffffffffffffffL, 0xffffff5L << 36),
1233: new EFP (P, -1, 0xffffffffffffffffL, 0xffffffaL << 36),
1234: new EFP (P, -1, 0xffffffffffffffffL, 0xffffffdL << 36),
1235: new EFP (P, -1, 0xffffffffffffffffL, 0xfffffffL << 36),
1236: };
1237:
1238: public final EFP ATH_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1239: public final EFP ATH_C3 = new EFP (P, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaaafaL << 36);
1240: public final EFP ATH_C5 = new EFP (P, -3, 0xccccccccccccccccL, 0xcc9635cL << 36);
1241: public final EFP ATH_C7 = new EFP (P, -3, 0x9249249249249249L, 0xb11c709L << 36);
1242: public final EFP ATH_C9 = new EFP (P, -4, 0xe38e38e38e38e1f4L, 0xa08ab7fL << 36);
1243: public final EFP ATH_C11 = new EFP (P, -4, 0xba2e8ba2e8bba550L, 0x957b4b0L << 36);
1244: public final EFP ATH_C13 = new EFP (P, -4, 0x9d89d89d88f3a6b4L, 0xb83ee9bL << 36);
1245: public final EFP ATH_C15 = new EFP (P, -4, 0x88888888e97610a0L, 0x018bbc5L << 36);
1246: public final EFP ATH_C17 = new EFP (P, -5, 0xf0f0f0b6e98b6c2fL, 0x176ec78L << 36);
1247: public final EFP ATH_C19 = new EFP (P, -5, 0xd79442422528c14bL, 0xdacdc08L << 36);
1248: public final EFP ATH_C21 = new EFP (P, -5, 0xc30a54423d395d6dL, 0xa2f5188L << 36);
1249: public final EFP ATH_C23 = new EFP (P, -5, 0xb247b3a940a7a020L, 0x5cb7483L << 36);
1250: public final EFP ATH_C25 = new EFP (P, -5, 0xa07d6fb3e1085165L, 0x68590abL << 36);
1251: public final EFP ATH_C27 = new EFP (P, -5, 0xb976c8a2f3029b2dL, 0xa0b471bL << 36);
1252:
1253:
1254:
1255:
1256:
1257: public final EFP COS_C0 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1258: public final EFP COS_C2 = new EFP (M, -2, 0xffffffffffffffffL, 0xffffff8L << 36);
1259: public final EFP COS_C4 = new EFP (P, -5, 0xaaaaaaaaaaaaaaaaL, 0xaaa9a56L << 36);
1260: public final EFP COS_C6 = new EFP (M, -10, 0xb60b60b60b60b60bL, 0x5d7bff4L << 36);
1261: public final EFP COS_C8 = new EFP (P, -16, 0xd00d00d00d00d002L, 0x8a46e65L << 36);
1262: public final EFP COS_C10 = new EFP (M, -22, 0x93f27dbbc4facfccL, 0xd7af990L << 36);
1263: public final EFP COS_C12 = new EFP (P, -29, 0x8f76c77fc6961076L, 0x0290d00L << 36);
1264: public final EFP COS_C14 = new EFP (M, -37, 0xc9cba54576804449L, 0x648c611L << 36);
1265: public final EFP COS_C16 = new EFP (P, -45, 0xd73f9e26754ce09dL, 0xec906ebL << 36);
1266: public final EFP COS_C18 = new EFP (M, -53, 0xb412768e7c3c3046L, 0x846cd1fL << 36);
1267: public final EFP COS_C20 = new EFP (P, -62, 0xf0dad505af592189L, 0x064973cL << 36);
1268:
1269:
1270: public final EFP SIN_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1271: public final EFP SIN_C3 = new EFP (M, -3, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaa8L << 36);
1272: public final EFP SIN_C5 = new EFP (P, -7, 0x8888888888888888L, 0x88880d0L << 36);
1273: public final EFP SIN_C7 = new EFP (M, -13, 0xd00d00d00d00d00cL, 0xfe77205L << 36);
1274: public final EFP SIN_C9 = new EFP (P, -19, 0xb8ef1d2ab6399c76L, 0xfe4484aL << 36);
1275: public final EFP SIN_C11 = new EFP (M, -26, 0xd7322b3faa27078eL, 0x1700055L << 36);
1276: public final EFP SIN_C13 = new EFP (P, -33, 0xb092309d433be4baL, 0xeb15e86L << 36);
1277: public final EFP SIN_C15 = new EFP (M, -41, 0xd73f9f392253780eL, 0x670f3ecL << 36);
1278: public final EFP SIN_C17 = new EFP (P, -49, 0xca963aa1cfea3bf8L, 0x08cec0aL << 36);
1279: public final EFP SIN_C19 = new EFP (M, -57, 0x97a3db8f70e5ae02L, 0x8f1dd1fL << 36);
1280: public final EFP SIN_C21 = new EFP (P, -66, 0xb791d94ca9fd98fdL, 0x74f2261L << 36);
1281:
1282:
1283:
1284:
1285:
1286: public final EFP COSH_C0 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1287: public final EFP COSH_C2 = new EFP (P, -1, 0x8000000000000000L, 0x0000000L << 36);
1288: public final EFP COSH_C4 = new EFP (P, -5, 0xaaaaaaaaaaaaaaaaL, 0xaaa9902L << 36);
1289: public final EFP COSH_C6 = new EFP (P, -10, 0xb60b60b60b60b60bL, 0xa75a997L << 36);
1290: public final EFP COSH_C8 = new EFP (P, -16, 0xd00d00d00d00beb4L, 0xa29cfbaL << 36);
1291: public final EFP COSH_C10 = new EFP (P, -22, 0x93f27dbbc74aee4dL, 0x312895cL << 36);
1292: public final EFP COSH_C12 = new EFP (P, -29, 0x8f76c72851473b51L, 0xdc04f2cL << 36);
1293: public final EFP COSH_C14 = new EFP (P, -37, 0xc9d919ab996aa4aeL, 0x80c913fL << 36);
1294:
1295:
1296:
1297:
1298: public final EFP[] EXP_P_I = {
1299:
1300: new EFP (P, 1, 0xadf85458a2bb4a9aL, 0xafdc562L << 36),
1301: new EFP (P, 2, 0xec7325c6a6ed6e61L, 0x9d1dd10L << 36),
1302: new EFP (P, 5, 0xda64817139d2c33cL, 0x6b69dffL << 36),
1303: new EFP (P, 11, 0xba4f53ea38636f85L, 0xf007042L << 36),
1304: new EFP (P, 23, 0x87975e8540010249L, 0x11f8b84L << 36),
1305: new EFP (P, 46, 0x8fa1fe625b3163ecL, 0x23c4201L << 36),
1306: new EFP (P, 92, 0xa12cc167acbe6902L, 0xe71eadaL << 36),
1307: new EFP (P, 184, 0xcaf2a62eea10bbfaL, 0x9fa6a91L << 36),
1308: new EFP (P, 369, 0xa0e3d440a5f5d071L, 0x919807cL << 36),
1309: new EFP (P, 738, 0xca3b2825d4297360L, 0x4e42b3eL << 36),
1310: new EFP (P, 1477, 0x9fc169073a8d0d13L, 0x21c376bL << 36),
1311: new EFP (P, 2954, 0xc763a52d0570da4eL, 0xe13cad2L << 36),
1312: new EFP (P, 5909, 0x9b4c119529dab99dL, 0xde62927L << 36),
1313: new EFP (P, 11818, 0xbc6a67ca24e9ba38L, 0x5a44770L << 36),
1314: new EFP (P, 23637, 0x8aac74ab03b22463L, 0x55451adL << 36),
1315: };
1316: public final EFP[] EXP_M_I = {
1317:
1318: new EFP (P, -2, 0xbc5ab1b16779be35L, 0x75bd8f0L << 36),
1319: new EFP (P, -3, 0x8a95551dfc0e5cfeL, 0xdbb7571L << 36),
1320: new EFP (P, -6, 0x960aadc109e7a3bfL, 0x4578099L << 36),
1321: new EFP (P, -12, 0xafe10820813d65dfL, 0xe6a33c0L << 36),
1322: new EFP (P, -24, 0xf1aaddd7742e56d3L, 0x2fb9f99L << 36),
1323: new EFP (P, -47, 0xe42327bb0b2340f1L, 0x4cd0092L << 36),
1324: new EFP (P, -93, 0xcb4ea3990f265d5fL, 0x9694038L << 36),
1325: new EFP (P, -185, 0xa175cf9cd7d85844L, 0x76b75a8L << 36),
1326: new EFP (P, -370, 0xcbaacab56a74dfdcL, 0xe09d13dL << 36),
1327: new EFP (P, -739, 0xa2084f6d90498ad1L, 0xc4658daL << 36),
1328: new EFP (P, -1478, 0xcd1d09977435cc77L, 0x7a9a998L << 36),
1329: new EFP (P, -2955, 0xa45784a7bcca7d6dL, 0xc205c90L << 36),
1330: new EFP (P, -5910, 0xd3007fc4b14655ddL, 0x1be84e5L << 36),
1331: new EFP (P, -11819, 0xade9d29e7bfeb08eL, 0x33a8236L << 36),
1332: new EFP (P, -23638, 0xec4bb8768ab8ab91L, 0x718a7e7L << 36),
1333: };
1334:
1335: public final EFP EXP_C0 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1336: public final EFP EXP_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000001L << 36);
1337: public final EFP EXP_C2 = new EFP (P, -1, 0x8000000000000000L, 0x0000000L << 36);
1338: public final EFP EXP_C3 = new EFP (P, -3, 0xaaaaaaaaaaaaaaaaL, 0xaa4e330L << 36);
1339: public final EFP EXP_C4 = new EFP (P, -5, 0xaaaaaaaaaaaaaaaaL, 0xaa6fd2eL << 36);
1340: public final EFP EXP_C5 = new EFP (P, -7, 0x8888888888888a8eL, 0x59cdd2cL << 36);
1341: public final EFP EXP_C6 = new EFP (P, -10, 0xb60b60b60b60b801L, 0x80edd29L << 36);
1342: public final EFP EXP_C7 = new EFP (P, -13, 0xd00d00cffa827bd9L, 0xd1653b8L << 36);
1343: public final EFP EXP_C8 = new EFP (P, -16, 0xd00d00cffddf45a5L, 0xbdc8fc1L << 36);
1344: public final EFP EXP_C9 = new EFP (P, -19, 0xb8ef6724028aa32dL, 0x54addf6L << 36);
1345: public final EFP EXP_C10 = new EFP (P, -22, 0x93f2b38858c23b84L, 0xa93e7c6L << 36);
1346:
1347: public final EFP[] EXP_P_T = {
1348:
1349: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
1350: new EFP (P, 0, 0x8204055aaef1c8bdL, 0x5c3259fL << 36),
1351: new EFP (P, 0, 0x84102b00893f64c7L, 0x05e841dL << 36),
1352: new EFP (P, 0, 0x862491b414f45e14L, 0x967f31fL << 36),
1353: new EFP (P, 0, 0x88415abbe9a76beaL, 0xd8d00cfL << 36),
1354: new EFP (P, 0, 0x8a66a7e4c4e6b22aL, 0xaf50ce3L << 36),
1355: new EFP (P, 0, 0x8c949b83a7066b44L, 0x9e8c66eL << 36),
1356: new EFP (P, 0, 0x8ecb5877f873c9e8L, 0xac7a4d3L << 36),
1357: new EFP (P, 0, 0x910b022db7ae67ceL, 0x76b441cL << 36),
1358: new EFP (P, 0, 0x9353bc9fb00b215aL, 0xeb98600L << 36),
1359: new EFP (P, 0, 0x95a5ac59b963ca80L, 0x9bb3e06L << 36),
1360: new EFP (P, 0, 0x9800f67b00d7b805L, 0xeae44b2L << 36),
1361: new EFP (P, 0, 0x9a65c0b85ac1a96aL, 0x7062466L << 36),
1362: new EFP (P, 0, 0x9cd4315e9e0832fbL, 0xa34f398L << 36),
1363: new EFP (P, 0, 0x9f4c6f5508ee5d51L, 0xbbdee02L << 36),
1364: new EFP (P, 0, 0xa1cea21faf8ac771L, 0xd268bc6L << 36),
1365: new EFP (P, 0, 0xa45af1e1f40c333bL, 0x3de1db5L << 36),
1366: new EFP (P, 0, 0xa6f1876108f3009dL, 0xa911f65L << 36),
1367: new EFP (P, 0, 0xa9928c067d67bb65L, 0x16cc14dL << 36),
1368: new EFP (P, 0, 0xac3e29e2d3d7813bL, 0x0e93c01L << 36),
1369: new EFP (P, 0, 0xaef48bb022ffa9daL, 0x899232aL << 36),
1370: new EFP (P, 0, 0xb1b5dcd4c192c269L, 0x39863eeL << 36),
1371: new EFP (P, 0, 0xb4824965fca1967eL, 0xd7cc083L << 36),
1372: new EFP (P, 0, 0xb759fe2ad8f3ada4L, 0xeb266efL << 36),
1373: new EFP (P, 0, 0xba3d289edf7b5311L, 0xa3c5b2dL << 36),
1374: new EFP (P, 0, 0xbd2bf6f4f511ef19L, 0xfdaedb7L << 36),
1375: new EFP (P, 0, 0xc026981a3daa2e5dL, 0x65cddb9L << 36),
1376: new EFP (P, 0, 0xc32d3bb90b262a0aL, 0xee10dd1L << 36),
1377: new EFP (P, 0, 0xc640123bd8007ee1L, 0x26da077L << 36),
1378: new EFP (P, 0, 0xc95f4cd04df7fdb9L, 0x9bfe7cfL << 36),
1379: new EFP (P, 0, 0xcc8b1d6a58ee609bL, 0x8c7b82aL << 36),
1380: new EFP (P, 0, 0xcfc3b6c7462b3282L, 0xc0bf5ecL << 36),
1381: new EFP (P, 0, 0xd3094c70f034de4bL, 0x96ff7d6L << 36),
1382: new EFP (P, 0, 0xd65c12c0f772a298L, 0xdbec9f1L << 36),
1383: new EFP (P, 0, 0xd9bc3ee407caf517L, 0x6670eb8L << 36),
1384: new EFP (P, 0, 0xdd2a06dd2b72af4bL, 0x7809cf2L << 36),
1385: new EFP (P, 0, 0xe0a5a1892b223221L, 0x955289eL << 36),
1386: new EFP (P, 0, 0xe42f46a1fbe683ddL, 0x1461033L << 36),
1387: new EFP (P, 0, 0xe7c72ec23ac545bfL, 0x66c74a2L << 36),
1388: new EFP (P, 0, 0xeb6d9368b66b3bf1L, 0xc77fd15L << 36),
1389: new EFP (P, 0, 0xef22aefc071e02e5L, 0x44bd839L << 36),
1390: new EFP (P, 0, 0xf2e6bcce352a7191L, 0x2542fa9L << 36),
1391: new EFP (P, 0, 0xf6b9f9206e0a0fc3L, 0xabd8e27L << 36),
1392: new EFP (P, 0, 0xfa9ca126c87af32bL, 0xb68e7a5L << 36),
1393: new EFP (P, 0, 0xfe8ef30c17c644e9L, 0x61db684L << 36),
1394: new EFP (P, 1, 0x814896fae739522fL, 0xd207331L << 36),
1395: new EFP (P, 1, 0x8351c903f850495fL, 0xf940cd1L << 36),
1396: new EFP (P, 1, 0x856330348b2806b5L, 0x6ded10fL << 36),
1397: new EFP (P, 1, 0x877ceda33ee7bdeaL, 0x61ab772L << 36),
1398: new EFP (P, 1, 0x899f22ec174a8c1aL, 0x3d1e65aL << 36),
1399: new EFP (P, 1, 0x8bc9f23296628075L, 0x3fa07acL << 36),
1400: new EFP (P, 1, 0x8dfd7e23ded395adL, 0xcd8bb99L << 36),
1401: new EFP (P, 1, 0x9039e9f8dea8bffcL, 0x88e9e18L << 36),
1402: new EFP (P, 1, 0x927f597882e5bd3aL, 0x5153fb8L << 36),
1403: new EFP (P, 1, 0x94cdf0f9f3f8e05cL, 0x238b7d8L << 36),
1404: new EFP (P, 1, 0x9725d566db309f9dL, 0x44caba1L << 36),
1405: new EFP (P, 1, 0x99872c3db1593ce1L, 0x10ffabeL << 36),
1406: new EFP (P, 1, 0x9bf21b9416a77258L, 0x29f648fL << 36),
1407: new EFP (P, 1, 0x9e66ca193415a245L, 0xd019082L << 36),
1408: new EFP (P, 1, 0xa0e55f1826599febL, 0x28fc34fL << 36),
1409: new EFP (P, 1, 0xa36e027a7299c128L, 0x96ff655L << 36),
1410: new EFP (P, 1, 0xa600dcca8508845aL, 0xa0a2a0dL << 36),
1411: new EFP (P, 1, 0xa89e1736398eb461L, 0xfd1d370L << 36),
1412: new EFP (P, 1, 0xab45db916eac95afL, 0x15018e6L << 36),
1413: };
1414: public final EFP[] EXP_M_T = {
1415:
1416: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
1417: new EFP (P, -1, 0xfc07f55ff77d2493L, 0xe885eebL << 36),
1418: new EFP (P, -1, 0xf81fab5445aebc8aL, 0x58055fdL << 36),
1419: new EFP (P, -1, 0xf446e357f67dfd8eL, 0x33bd6c8L << 36),
1420: new EFP (P, -1, 0xf07d5fde38151e72L, 0xf18ff03L << 36),
1421: new EFP (P, -1, 0xecc2e44e820d18c3L, 0xcc6f18aL << 36),
1422: new EFP (P, -1, 0xe9173500cbe0159aL, 0xa3084a2L << 36),
1423: new EFP (P, -1, 0xe57a1739d263ec94L, 0x8222e86L << 36),
1424: new EFP (P, -1, 0xe1eb51276c110c3cL, 0x3eb126aL << 36),
1425: new EFP (P, -1, 0xde6aa9dcebdb100bL, 0x56a61aaL << 36),
1426: new EFP (P, -1, 0xdaf7e94f9261313dL, 0x5fd7d71L << 36),
1427: new EFP (P, -1, 0xd792d8530d3da531L, 0x2b5abcbL << 36),
1428: new EFP (P, -1, 0xd43b4096043bde02L, 0xc9dd905L << 36),
1429: new EFP (P, -1, 0xd0f0ec9eb43e8078L, 0xe9af6bbL << 36),
1430: new EFP (P, -1, 0xcdb3a7c7979ebd5cL, 0x80489dbL << 36),
1431: new EFP (P, -1, 0xca833e3c1bcf93e9L, 0x0747d1aL << 36),
1432: new EFP (P, -1, 0xc75f7cf564105743L, 0x415cbcaL << 36),
1433: new EFP (P, -1, 0xc44831b718faa1d9L, 0xc29d8daL << 36),
1434: new EFP (P, -1, 0xc13d2b0c44b8af4aL, 0x68aa4e8L << 36),
1435: new EFP (P, -1, 0xbe3e38443bb1dfefL, 0x65597dbL << 36),
1436: new EFP (P, -1, 0xbb4b296f917bf09aL, 0x22fbaa2L << 36),
1437: new EFP (P, -1, 0xb863cf5d19e0354eL, 0x91dbb17L << 36),
1438: new EFP (P, -1, 0xb587fb96f5c4e712L, 0xa053452L << 36),
1439: new EFP (P, -1, 0xb2b7805fabcb5327L, 0xcdbad0eL << 36),
1440: new EFP (P, -1, 0xaff230af4c747553L, 0xd8db805L << 36),
1441: new EFP (P, -1, 0xad37e030a19e3f45L, 0x315a9f6L << 36),
1442: new EFP (P, -1, 0xaa88633e692c84abL, 0x9760affL << 36),
1443: new EFP (P, -1, 0xa7e38ee09ab13658L, 0x8e4fa89L << 36),
1444: new EFP (P, -1, 0xa54938c9b7e846b1L, 0x22756d1L << 36),
1445: new EFP (P, -1, 0xa2b9375427dc3ef5L, 0xfdb6013L << 36),
1446: new EFP (P, -1, 0xa033617f9c893772L, 0xb7f2709L << 36),
1447: new EFP (P, -1, 0x9db78eee82d48c8cL, 0x5e432e4L << 36),
1448: new EFP (P, -1, 0x9b4597e37cb04ff3L, 0xd675a35L << 36),
1449: new EFP (P, -1, 0x98dd553ee54217fdL, 0x5f7533bL << 36),
1450: new EFP (P, -1, 0x967ea07c5ee56f55L, 0x27376f0L << 36),
1451: new EFP (P, -1, 0x942953b06ae2c503L, 0xc6e249aL << 36),
1452: new EFP (P, -1, 0x91dd49860ab457feL, 0x49ecbc0L << 36),
1453: new EFP (P, -1, 0x8f9a5d3c6ab3325dL, 0xe98839bL << 36),
1454: new EFP (P, -1, 0x8d606aa49606deddL, 0x68c91a3L << 36),
1455: new EFP (P, -1, 0x8b2f4e1f33b31766L, 0x67ee085L << 36),
1456: new EFP (P, -1, 0x8906e49a4c9f3d59L, 0x58a5d18L << 36),
1457: new EFP (P, -1, 0x86e70b8f1a73fbd8L, 0x1858e19L << 36),
1458: new EFP (P, -1, 0x84cfa0ffdf2c01beL, 0x9229f8cL << 36),
1459: new EFP (P, -1, 0x82c08375c5354c26L, 0xfed9d9bL << 36),
1460: new EFP (P, -1, 0x80b991fec8010361L, 0x182aa18L << 36),
1461: new EFP (P, -2, 0xfd75585749c0e65aL, 0xe0e13c7L << 36),
1462: new EFP (P, -2, 0xf987641ba81c57c1L, 0x08b166eL << 36),
1463: new EFP (P, -2, 0xf5a9086b1385b9a8L, 0xb38238dL << 36),
1464: new EFP (P, -2, 0xf1da075f7e6bf297L, 0x7e1e9a0L << 36),
1465: new EFP (P, -2, 0xee1a240886d56f4fL, 0x1d073e3L << 36),
1466: new EFP (P, -2, 0xea692267a754ef29L, 0x4911dc3L << 36),
1467: new EFP (P, -2, 0xe6c6c76c771c2d60L, 0x96a4be2L << 36),
1468: new EFP (P, -2, 0xe332d8f0f8f06820L, 0xcd7f8e6L << 36),
1469: new EFP (P, -2, 0xdfad1db5f8c5b458L, 0x70f8209L << 36),
1470: new EFP (P, -2, 0xdc355d5f77c6f7b3L, 0x2d36b03L << 36),
1471: new EFP (P, -2, 0xd8cb6071269148f0L, 0x7444892L << 36),
1472: new EFP (P, -2, 0xd56ef04aed6a5a01L, 0x2a76dd4L << 36),
1473: new EFP (P, -2, 0xd21fd725823a6f09L, 0x0871f0bL << 36),
1474: new EFP (P, -2, 0xcedde00f0c13419aL, 0x4cddcf7L << 36),
1475: new EFP (P, -2, 0xcba8d6e7d40e0852L, 0x3c9f035L << 36),
1476: new EFP (P, -2, 0xc880885f034bb070L, 0x530b9f4L << 36),
1477: new EFP (P, -2, 0xc564c1ef6de32926L, 0x3b6f5ecL << 36),
1478: new EFP (P, -2, 0xc25551dc6a8a6f40L, 0xdc958f1L << 36),
1479: new EFP (P, -2, 0xbf52072eb6c7d377L, 0xd431325L << 36),
1480: };
1481:
1482:
1483:
1484: public final EFP[] EXP10_P_I = {
1485:
1486: new EFP (P, 3, 0xa000000000000000L, 0x0000000L << 36),
1487: new EFP (P, 6, 0xc800000000000000L, 0x0000000L << 36),
1488: new EFP (P, 13, 0x9c40000000000000L, 0x0000000L << 36),
1489: new EFP (P, 26, 0xbebc200000000000L, 0x0000000L << 36),
1490: new EFP (P, 53, 0x8e1bc9bf04000000L, 0x0000000L << 36),
1491: new EFP (P, 106, 0x9dc5ada82b70b59dL, 0xf020000L << 36),
1492: new EFP (P, 212, 0xc2781f49ffcfa6d5L, 0x3cbf6b7L << 36),
1493: new EFP (P, 425, 0x93ba47c980e98cdfL, 0xc66f337L << 36),
1494: new EFP (P, 850, 0xaa7eebfb9df9de8dL, 0xddbb902L << 36),
1495: new EFP (P, 1700, 0xe319a0aea60e91c6L, 0xcc655c5L << 36),
1496: new EFP (P, 3401, 0xc976758681750c17L, 0x650d3d3L << 36),
1497: new EFP (P, 6803, 0x9e8b3b5dc53d5de4L, 0xa74d28dL << 36),
1498: new EFP (P, 13606, 0xc46052028a20979aL, 0xc94c154L << 36),
1499: new EFP (P, 27213, 0x96a3a1d17faf211aL, 0x0c7c289L << 36),
1500: };
1501: public final EFP[] EXP10_M_I = {
1502:
1503: new EFP (P, -4, 0xccccccccccccccccL, 0xccccccdL << 36),
1504: new EFP (P, -7, 0xa3d70a3d70a3d70aL, 0x3d70a3dL << 36),
1505: new EFP (P, -14, 0xd1b71758e219652bL, 0xd3c3611L << 36),
1506: new EFP (P, -27, 0xabcc77118461cefcL, 0xfdc20d3L << 36),
1507: new EFP (P, -54, 0xe69594bec44de15bL, 0x4c2ebe7L << 36),
1508: new EFP (P, -107, 0xcfb11ead453994baL, 0x67de18fL << 36),
1509: new EFP (P, -213, 0xa87fea27a539e9a5L, 0x3f2398dL << 36),
1510: new EFP (P, -426, 0xddd0467c64bce4a0L, 0xac7cb3fL << 36),
1511: new EFP (P, -851, 0xc0314325637a1939L, 0xfa91115L << 36),
1512: new EFP (P, -1701, 0x9049ee32db23d21cL, 0x7132d33L << 36),
1513: new EFP (P, -3402, 0xa2a682a5da57c0bdL, 0x87a6016L << 36),
1514: new EFP (P, -6804, 0xceae534f34362de4L, 0x492512dL << 36),
1515: new EFP (P, -13607, 0xa6dd04c8d2ce9fdeL, 0x2de3812L << 36),
1516: new EFP (P, -27214, 0xd986c20b686da869L, 0x5d1d4feL << 36),
1517: };
1518:
1519: public final EFP EXP10_C0 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1520: public final EFP EXP10_C1 = new EFP (P, 1, 0x935d8dddaaa8ac16L, 0xea56d63L << 36);
1521: public final EFP EXP10_C2 = new EFP (P, 1, 0xa9a92639e753443aL, 0x80aa0a5L << 36);
1522: public final EFP EXP10_C3 = new EFP (P, 1, 0x82382c8ef1652304L, 0x6a4fce8L << 36);
1523: public final EFP EXP10_C4 = new EFP (P, 0, 0x95ebb04fecc62263L, 0x3516d57L << 36);
1524: public final EFP EXP10_C5 = new EFP (P, -1, 0x8a14ffe8ea6bb111L, 0x0f9d433L << 36);
1525: public final EFP EXP10_C6 = new EFP (P, -3, 0xd3f6b8423e47031dL, 0xb2e8d4cL << 36);
1526: public final EFP EXP10_C7 = new EFP (P, -4, 0x8b726fe199d4dd8aL, 0x0319896L << 36);
1527: public final EFP EXP10_C8 = new EFP (P, -6, 0xa08b582ea51b0457L, 0xa2bc993L << 36);
1528: public final EFP EXP10_C9 = new EFP (P, -8, 0xa44be22db201cf47L, 0x94dcaeaL << 36);
1529: public final EFP EXP10_C10 = new EFP (P, -10, 0x9753b9561c0a683fL, 0x0135acdL << 36);
1530: public final EFP EXP10_C11 = new EFP (P, -13, 0xfd69aac60b9f8924L, 0x6d6c8b2L << 36);
1531:
1532: public final EFP[] EXP10_P_T = {
1533:
1534: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
1535: new EFP (P, 0, 0x84b06346cc5e15f9L, 0x701148dL << 36),
1536: new EFP (P, 0, 0x898cbfd35533bb59L, 0x3c49e31L << 36),
1537: new EFP (P, 0, 0x8e96b208a3664881L, 0x0ec125aL << 36),
1538: new EFP (P, 0, 0x93cfe56520272d66L, 0x5aa4cf9L << 36),
1539: new EFP (P, 0, 0x993a151041524281L, 0xa5bb585L << 36),
1540: new EFP (P, 0, 0x9ed70c6d6669efa1L, 0xfe3df3cL << 36),
1541: new EFP (P, 0, 0xa4a8a7b416dcf6d2L, 0xcb3598fL << 36),
1542: new EFP (P, 0, 0xaab0d48dd40a21eeL, 0xe3993e6L << 36),
1543: new EFP (P, 0, 0xb0f192b9b34f3a68L, 0x955eb28L << 36),
1544: new EFP (P, 0, 0xb76cf4b5f65b3109L, 0xa96afc1L << 36),
1545: new EFP (P, 0, 0xbe25206fd9f7d185L, 0xaebfd1dL << 36),
1546: new EFP (P, 0, 0xc51c4ff9d58e742dL, 0x8b26b72L << 36),
1547: new EFP (P, 0, 0xcc54d24887cd8593L, 0x587bd74L << 36),
1548: new EFP (P, 0, 0xd3d10bf68f0b258cL, 0xf7a8720L << 36),
1549: new EFP (P, 0, 0xdb93780f8e4c4878L, 0xa97bdbaL << 36),
1550: new EFP (P, 0, 0xe39ea8e2a2387187L, 0xf37c989L << 36),
1551: new EFP (P, 0, 0xebf548dc8bb914d9L, 0x7f50e38L << 36),
1552: new EFP (P, 0, 0xf49a1b69d891c56dL, 0x960a16fL << 36),
1553: new EFP (P, 0, 0xfd8ffde154e45e46L, 0x6d275e3L << 36),
1554: new EFP (P, 1, 0x836cf43b89a99c01L, 0x4fdf0c0L << 36),
1555: new EFP (P, 1, 0x883d779c2e260ef2L, 0x8fcb8a1L << 36),
1556: new EFP (P, 1, 0x8d3b21886bfd0401L, 0xb2e86d9L << 36),
1557: new EFP (P, 1, 0x9267996ca4b54f44L, 0xfac62acL << 36),
1558: new EFP (P, 1, 0x97c496381a501b96L, 0x8f187f6L << 36),
1559: new EFP (P, 1, 0x9d53deee66493377L, 0x48d07c3L << 36),
1560: new EFP (P, 1, 0xa3174b3e44c3bf1cL, 0x5882b85L << 36),
1561: new EFP (P, 1, 0xa910c41de5dcba7fL, 0x26e2683L << 36),
1562: new EFP (P, 1, 0xaf42446cf8f10ddbL, 0xdeffc99L << 36),
1563: new EFP (P, 1, 0xb5add99ca78b05aeL, 0xb531acaL << 36),
1564: new EFP (P, 1, 0xbc55a45db7a285f3L, 0x2c86e23L << 36),
1565: new EFP (P, 1, 0xc33bd9550ee56612L, 0x36b705cL << 36),
1566: new EFP (P, 1, 0xca62c1d6d2da9490L, 0x2515e42L << 36),
1567: new EFP (P, 1, 0xd1ccbca863e3a684L, 0x9dcd927L << 36),
1568: new EFP (P, 1, 0xd97c3ec973660921L, 0xc624e27L << 36),
1569: new EFP (P, 1, 0xe173d44477bfebc8L, 0xc9e83d6L << 36),
1570: new EFP (P, 1, 0xe9b62106c31def2cL, 0x8c4b218L << 36),
1571: new EFP (P, 1, 0xf245e1c084ce80edL, 0x038ee92L << 36),
1572: new EFP (P, 1, 0xfb25ecccff4f619aL, 0x3e59575L << 36),
1573: new EFP (P, 2, 0x822c9991a00501dfL, 0x459ef69L << 36),
1574: new EFP (P, 2, 0x86f160a7d4429212L, 0x10e2195L << 36),
1575: new EFP (P, 2, 0x8be2e03b4ddf0e98L, 0x12bb325L << 36),
1576: new EFP (P, 2, 0x9102bbb052b20069L, 0x01f46c1L << 36),
1577: new EFP (P, 2, 0x9652a5c839e93b97L, 0xa26a9f7L << 36),
1578: new EFP (P, 2, 0x9bd461318075e327L, 0xba8d5a6L << 36),
1579: new EFP (P, 2, 0xa189c11d24a8aa65L, 0x85c7857L << 36),
1580: new EFP (P, 2, 0xa774a9d97a7cc699L, 0x267ff04L << 36),
1581: new EFP (P, 2, 0xad971172abe13529L, 0x4e7987eL << 36),
1582: new EFP (P, 2, 0xb3f300591a312caeL, 0x82ddc80L << 36),
1583: new EFP (P, 2, 0xba8a920dd7ff6294L, 0x8fdbe3cL << 36),
1584: new EFP (P, 2, 0xc15ff5d5745ce801L, 0xf9cbdb1L << 36),
1585: new EFP (P, 2, 0xc8756f7152dc6b33L, 0xd916f2aL << 36),
1586: new EFP (P, 2, 0xcfcd57dfcdbe57f5L, 0x06243dfL << 36),
1587: new EFP (P, 2, 0xd76a1e2361f25a79L, 0x376f47eL << 36),
1588: new EFP (P, 2, 0xdf4e481126efea96L, 0x226ac46L << 36),
1589: new EFP (P, 2, 0xe77c7326d6d287faL, 0x80d6746L << 36),
1590: new EFP (P, 2, 0xeff75568ada7ffc1L, 0x9a2a3e9L << 36),
1591: new EFP (P, 2, 0xf8c1be4769784541L, 0xfbc290fL << 36),
1592: new EFP (P, 3, 0x80ef4bc75b9ffbd5L, 0x0910ec4L << 36),
1593: new EFP (P, 3, 0x85a8732e2df0c035L, 0xb3cb958L << 36),
1594: new EFP (P, 3, 0x8a8de610357adc41L, 0x4850544L << 36),
1595: new EFP (P, 3, 0x8fa143d3703294f4L, 0x841b5f8L << 36),
1596: new EFP (P, 3, 0x94e43b157a67a6c0L, 0x97fe98cL << 36),
1597: new EFP (P, 3, 0x9a588a3a43ff4e3cL, 0x381b0ceL << 36),
1598: };
1599: public final EFP[] EXP10_M_T = {
1600:
1601: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
1602: new EFP (P, -1, 0xf6f4105d39987d2dL, 0x2691ae4L << 36),
1603: new EFP (P, -1, 0xee39f8225d72a467L, 0x59975acL << 36),
1604: new EFP (P, -1, 0xe5ced2ebe6b754baL, 0x6cf898cL << 36),
1605: new EFP (P, -1, 0xddafd68055916068L, 0x73b3b9fL << 36),
1606: new EFP (P, -1, 0xd5da51e37cb466bcL, 0x52df55aL << 36),
1607: new EFP (P, -1, 0xce4bac722c332c88L, 0x0e8179fL << 36),
1608: new EFP (P, -1, 0xc7016505edf9d101L, 0x963540cL << 36),
1609: new EFP (P, -1, 0xbff911208aeccc9aL, 0xe1bb654L << 36),
1610: new EFP (P, -1, 0xb9305c1f12420662L, 0x00ab904L << 36),
1611: new EFP (P, -1, 0xb2a506741f265544L, 0xe85569fL << 36),
1612: new EFP (P, -1, 0xac54e4e91b284860L, 0xf925d32L << 36),
1613: new EFP (P, -1, 0xa63ddfe63e31dff7L, 0x381cfe5L << 36),
1614: new EFP (P, -1, 0xa05df2c10f16bc29L, 0x7a78c22L << 36),
1615: new EFP (P, -1, 0x9ab32b1129e3ecceL, 0x616fe27L << 36),
1616: new EFP (P, -1, 0x953ba80b1332b543L, 0xa649830L << 36),
1617: new EFP (P, -1, 0x8ff599e0e1c0f08bL, 0x9be4a00L << 36),
1618: new EFP (P, -1, 0x8adf41288980f754L, 0x3ec79ffL << 36),
1619: new EFP (P, -1, 0x85f6ee4795309ee0L, 0xeb998d0L << 36),
1620: new EFP (P, -1, 0x813b00e41d53bb84L, 0x6b06046L << 36),
1621: new EFP (P, -2, 0xf953ceb59a56383fL, 0x90e22a4L << 36),
1622: new EFP (P, -2, 0xf0843c738fdb928cL, 0x3710ff2L << 36),
1623: new EFP (P, -2, 0xe8045f80845000a8L, 0x0320aceL << 36),
1624: new EFP (P, -2, 0xdfd166c54964e426L, 0x845eb6eL << 36),
1625: new EFP (P, -2, 0xd7e89aa6206a8350L, 0x1b035bbL << 36),
1626: new EFP (P, -2, 0xd0475c1c333b3632L, 0x08fe574L << 36),
1627: new EFP (P, -2, 0xc8eb23d732a5e7aeL, 0x9847791L << 36),
1628: new EFP (P, -2, 0xc1d18166d0a533f0L, 0xcfa5875L << 36),
1629: new EFP (P, -2, 0xbaf81a6bcf4b25bdL, 0x3d08e7aL << 36),
1630: new EFP (P, -2, 0xb45ca9d05fccbca0L, 0xa186978L << 36),
1631: new EFP (P, -2, 0xadfcff078f84d41bL, 0x04ea4ecL << 36),
1632: new EFP (P, -2, 0xa7d6fd53831c8536L, 0xe4a4753L << 36),
1633: new EFP (P, -2, 0xa1e89b12424876d9L, 0xb744b68L << 36),
1634: new EFP (P, -2, 0x9c2fe110d8b784dbL, 0x5ef8d17L << 36),
1635: new EFP (P, -2, 0x96aae9e492e86b28L, 0xf06be83L << 36),
1636: new EFP (P, -2, 0x9157e14a1fa26af2L, 0x2a8e23bL << 36),
1637: new EFP (P, -2, 0x8c35038a60c0d7e3L, 0x18cca14L << 36),
1638: new EFP (P, -2, 0x87409ce4b7e3c865L, 0xb8b5203L << 36),
1639: new EFP (P, -2, 0x827908fe9d6965b0L, 0x46cef9dL << 36),
1640: new EFP (P, -3, 0xfbb964b0a3a85258L, 0x7480c6bL << 36),
1641: new EFP (P, -3, 0xf2d4238cf6e6928aL, 0x7e8d989L << 36),
1642: new EFP (P, -3, 0xea3f5be107887ed4L, 0xc470446L << 36),
1643: new EFP (P, -3, 0xe1f835a7132e6ccfL, 0x84a715cL << 36),
1644: new EFP (P, -3, 0xd9fbf2937d09b184L, 0x1945a9bL << 36),
1645: new EFP (P, -3, 0xd247ed2c0f75c668L, 0x7fcb466L << 36),
1646: new EFP (P, -3, 0xcad997e7771d1838L, 0x5752b1cL << 36),
1647: new EFP (P, -3, 0xc3ae7c54ad416abeL, 0x11a1abfL << 36),
1648: new EFP (P, -3, 0xbcc43a4a0960dd7aL, 0xcc40b60L << 36),
1649: new EFP (P, -3, 0xb618871bb4f9f46cL, 0xc2ca13aL << 36),
1650: new EFP (P, -3, 0xafa92cd93ea36d2dL, 0x5463162L << 36),
1651: new EFP (P, -3, 0xa97409920c08ead7L, 0x2c86c19L << 36),
1652: new EFP (P, -3, 0xa3770ea06ca46adcL, 0x46c9790L << 36),
1653: new EFP (P, -3, 0x9db03ffb113ec357L, 0xa2855f5L << 36),
1654: new EFP (P, -3, 0x981db38cae5fdad1L, 0x589974aL << 36),
1655: new EFP (P, -3, 0x92bd909191e28da1L, 0x5455967L << 36),
1656: new EFP (P, -3, 0x8d8e0efaf5d8fb86L, 0xdde55baL << 36),
1657: new EFP (P, -3, 0x888d76d7dcd4e7f2L, 0x4fadcb8L << 36),
1658: new EFP (P, -3, 0x83ba1fc3457d9242L, 0x3c2ae0cL << 36),
1659: new EFP (P, -4, 0xfe24e0af0a431903L, 0x30631faL << 36),
1660: new EFP (P, -4, 0xf529bb4d35506a69L, 0x092bc07L << 36),
1661: new EFP (P, -4, 0xec7fd56e99d848a3L, 0xc43ae5bL << 36),
1662: new EFP (P, -4, 0xe424500dd23d40ceL, 0x7e01d5dL << 36),
1663: new EFP (P, -4, 0xdc14661eeeb92bc1L, 0xfa0fd1cL << 36),
1664: new EFP (P, -4, 0xd44d6ba47a302328L, 0xb34edaeL << 36),
1665: };
1666:
1667:
1668:
1669:
1670: public final EFP EXP2P_C0 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1671: public final EFP EXP2P_C1 = new EFP (P, -1, 0xb17217f7d1cf79abL, 0xc9e3289L << 36);
1672: public final EFP EXP2P_C2 = new EFP (P, -3, 0xf5fdeffc162c7543L, 0x87306ceL << 36);
1673: public final EFP EXP2P_C3 = new EFP (P, -5, 0xe35846b82505fbc4L, 0xf77c6dfL << 36);
1674: public final EFP EXP2P_C4 = new EFP (P, -7, 0x9d955b7dd276b5acL, 0xbf41024L << 36);
1675: public final EFP EXP2P_C5 = new EFP (P, -10, 0xaec3ff3c41fa05ceL, 0xd0dbae7L << 36);
1676: public final EFP EXP2P_C6 = new EFP (P, -13, 0xa18489b6bbee153cL, 0x79516f1L << 36);
1677: public final EFP EXP2P_C7 = new EFP (P, -17, 0xffe516c43da39259L, 0x7cbaceaL << 36);
1678: public final EFP EXP2P_C8 = new EFP (P, -20, 0xb256aa5495805ceeL, 0xb4df34eL << 36);
1679:
1680:
1681: public final EFP EXP2M_C0 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1682: public final EFP EXP2M_C1 = new EFP (P, -1, 0xb17217f7d1cf79abL, 0xc9e32a0L << 36);
1683: public final EFP EXP2M_C2 = new EFP (P, -3, 0xf5fdeffc162c7543L, 0x6a5f7f6L << 36);
1684: public final EFP EXP2M_C3 = new EFP (P, -5, 0xe35846b82505fbc6L, 0x6a8d50cL << 36);
1685: public final EFP EXP2M_C4 = new EFP (P, -7, 0x9d955b7dd270c42fL, 0x60d628cL << 36);
1686: public final EFP EXP2M_C5 = new EFP (P, -10, 0xaec3ff3c422238b3L, 0x26278f5L << 36);
1687: public final EFP EXP2M_C6 = new EFP (P, -13, 0xa184894230721e7bL, 0x5e05decL << 36);
1688: public final EFP EXP2M_C7 = new EFP (P, -17, 0xffe518860467684dL, 0x1c0262cL << 36);
1689: public final EFP EXP2M_C8 = new EFP (P, -20, 0xb06adfb7eea07e61L, 0xba36904L << 36);
1690:
1691: public final EFP[] EXP2P_T = {
1692:
1693: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
1694: new EFP (P, 0, 0x8164d1f3bc030773L, 0x7be5652L << 36),
1695: new EFP (P, 0, 0x82cd8698ac2ba1d7L, 0x3e2a476L << 36),
1696: new EFP (P, 0, 0x843a28c3acde4046L, 0x1af92edL << 36),
1697: new EFP (P, 0, 0x85aac367cc487b14L, 0xc5c95b9L << 36),
1698: new EFP (P, 0, 0x871f61969e8d1010L, 0x3a1727cL << 36),
1699: new EFP (P, 0, 0x88980e8092da8527L, 0x5df8d77L << 36),
1700: new EFP (P, 0, 0x8a14d575496efd9aL, 0x080ca1eL << 36),
1701: new EFP (P, 0, 0x8b95c1e3ea8bd6e6L, 0xfbe4628L << 36),
1702: new EFP (P, 0, 0x8d1adf5b7e5ba9e5L, 0xb4c7b49L << 36),
1703: new EFP (P, 0, 0x8ea4398b45cd53c0L, 0x2dc0145L << 36),
1704: new EFP (P, 0, 0x9031dc431466b1dcL, 0x775814bL << 36),
1705: new EFP (P, 0, 0x91c3d373ab11c336L, 0x0fd6d8eL << 36),
1706: new EFP (P, 0, 0x935a2b2f13e6e92bL, 0xd339941L << 36),
1707: new EFP (P, 0, 0x94f4efa8fef70961L, 0x2e8afadL << 36),
1708: new EFP (P, 0, 0x96942d3720185a00L, 0x48ea9b7L << 36),
1709: new EFP (P, 0, 0x9837f0518db8a96fL, 0x46ad232L << 36),
1710: new EFP (P, 0, 0x99e0459320b7fa64L, 0xe43086dL << 36),
1711: new EFP (P, 0, 0x9b8d39b9d54e5538L, 0xa2a817aL << 36),
1712: new EFP (P, 0, 0x9d3ed9a72cffb750L, 0xde494cfL << 36),
1713: new EFP (P, 0, 0x9ef5326091a111adL, 0xa0911f1L << 36),
1714: new EFP (P, 0, 0xa0b0510fb9714fc2L, 0x192dc7aL << 36),
1715: new EFP (P, 0, 0xa27043030c496818L, 0x9b7a04fL << 36),
1716: new EFP (P, 0, 0xa43515ae09e6809eL, 0x0d1db48L << 36),
1717: new EFP (P, 0, 0xa5fed6a9b15138eaL, 0x1cbd7f6L << 36),
1718: new EFP (P, 0, 0xa7cd93b4e9653569L, 0x9ec5b4dL << 36),
1719: new EFP (P, 0, 0xa9a15ab4ea7c0ef8L, 0x541e24fL << 36),
1720: new EFP (P, 0, 0xab7a39b5a93ed337L, 0x658023bL << 36),
1721: new EFP (P, 0, 0xad583eea42a14ac6L, 0x4980a8dL << 36),
1722: new EFP (P, 0, 0xaf3b78ad690a4374L, 0xdf26102L << 36),
1723: new EFP (P, 0, 0xb123f581d2ac258fL, 0x87d037fL << 36),
1724: new EFP (P, 0, 0xb311c412a9112489L, 0x3ecf14eL << 36),
1725: new EFP (P, 0, 0xb504f333f9de6484L, 0x597d89bL << 36),
1726: new EFP (P, 0, 0xb6fd91e328d17791L, 0x07165f1L << 36),
1727: new EFP (P, 0, 0xb8fbaf4762fb9ee9L, 0x1b87978L << 36),
1728: new EFP (P, 0, 0xbaff5ab2133e45fbL, 0x74d519dL << 36),
1729: new EFP (P, 0, 0xbd08a39f580c36beL, 0xa8811fbL << 36),
1730: new EFP (P, 0, 0xbf1799b67a731082L, 0xe815d0bL << 36),
1731: new EFP (P, 0, 0xc12c4cca66709456L, 0x7c457d6L << 36),
1732: new EFP (P, 0, 0xc346ccda24976407L, 0x20ec856L << 36),
1733: new EFP (P, 0, 0xc5672a115506daddL, 0x3e2ad0dL << 36),
1734: new EFP (P, 0, 0xc78d74c8abb9b15cL, 0xc13a2e4L << 36),
1735: new EFP (P, 0, 0xc9b9bd866e2f27a2L, 0x80e1f93L << 36),
1736: new EFP (P, 0, 0xcbec14fef2727c5cL, 0xf4907c9L << 36),
1737: new EFP (P, 0, 0xce248c151f8480e3L, 0xe235839L << 36),
1738: new EFP (P, 0, 0xd06333daef2b2594L, 0xd6d45c6L << 36),
1739: new EFP (P, 0, 0xd2a81d91f12ae45aL, 0x12248e5L << 36),
1740: new EFP (P, 0, 0xd4f35aabcfedfa1fL, 0x5921df0L << 36),
1741: new EFP (P, 0, 0xd744fccad69d6af4L, 0x39a68bcL << 36),
1742: new EFP (P, 0, 0xd99d15c278afd7b5L, 0xfe873dfL << 36),
1743: new EFP (P, 0, 0xdbfbb797daf23755L, 0x3d840d6L << 36),
1744: new EFP (P, 0, 0xde60f4825e0e9123L, 0xdd07a2eL << 36),
1745: new EFP (P, 0, 0xe0ccdeec2a94e111L, 0x0658950L << 36),
1746: new EFP (P, 0, 0xe33f8972be8a5a51L, 0x09bfe90L << 36),
1747: new EFP (P, 0, 0xe5b906e77c8348a8L, 0x1e5e8f5L << 36),
1748: new EFP (P, 0, 0xe8396a503c4bdc68L, 0x791790dL << 36),
1749: new EFP (P, 0, 0xeac0c6e7dd24392eL, 0xd02d75bL << 36),
1750: new EFP (P, 0, 0xed4f301ed9942b84L, 0x600d2dbL << 36),
1751: new EFP (P, 0, 0xefe4b99bdcdaf5cbL, 0x46561cfL << 36),
1752: new EFP (P, 0, 0xf281773c59ffb139L, 0xe8980aaL << 36),
1753: new EFP (P, 0, 0xf5257d152486cc2cL, 0x7b9d0c8L << 36),
1754: new EFP (P, 0, 0xf7d0df730ad13bb8L, 0xfe90d49L << 36),
1755: new EFP (P, 0, 0xfa83b2db722a033aL, 0x7c25bb1L << 36),
1756: new EFP (P, 0, 0xfd3e0c0cf486c174L, 0x853f3a6L << 36),
1757: };
1758: public final EFP[] EXP2M_T = {
1759:
1760: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
1761: new EFP (P, -1, 0xfd3e0c0cf486c174L, 0x853f3a6L << 36),
1762: new EFP (P, -1, 0xfa83b2db722a033aL, 0x7c25bb1L << 36),
1763: new EFP (P, -1, 0xf7d0df730ad13bb8L, 0xfe90d49L << 36),
1764: new EFP (P, -1, 0xf5257d152486cc2cL, 0x7b9d0c8L << 36),
1765: new EFP (P, -1, 0xf281773c59ffb139L, 0xe8980aaL << 36),
1766: new EFP (P, -1, 0xefe4b99bdcdaf5cbL, 0x46561cfL << 36),
1767: new EFP (P, -1, 0xed4f301ed9942b84L, 0x600d2dbL << 36),
1768: new EFP (P, -1, 0xeac0c6e7dd24392eL, 0xd02d75bL << 36),
1769: new EFP (P, -1, 0xe8396a503c4bdc68L, 0x791790dL << 36),
1770: new EFP (P, -1, 0xe5b906e77c8348a8L, 0x1e5e8f5L << 36),
1771: new EFP (P, -1, 0xe33f8972be8a5a51L, 0x09bfe90L << 36),
1772: new EFP (P, -1, 0xe0ccdeec2a94e111L, 0x0658950L << 36),
1773: new EFP (P, -1, 0xde60f4825e0e9123L, 0xdd07a2eL << 36),
1774: new EFP (P, -1, 0xdbfbb797daf23755L, 0x3d840d6L << 36),
1775: new EFP (P, -1, 0xd99d15c278afd7b5L, 0xfe873dfL << 36),
1776: new EFP (P, -1, 0xd744fccad69d6af4L, 0x39a68bcL << 36),
1777: new EFP (P, -1, 0xd4f35aabcfedfa1fL, 0x5921df0L << 36),
1778: new EFP (P, -1, 0xd2a81d91f12ae45aL, 0x12248e5L << 36),
1779: new EFP (P, -1, 0xd06333daef2b2594L, 0xd6d45c6L << 36),
1780: new EFP (P, -1, 0xce248c151f8480e3L, 0xe235839L << 36),
1781: new EFP (P, -1, 0xcbec14fef2727c5cL, 0xf4907c9L << 36),
1782: new EFP (P, -1, 0xc9b9bd866e2f27a2L, 0x80e1f93L << 36),
1783: new EFP (P, -1, 0xc78d74c8abb9b15cL, 0xc13a2e4L << 36),
1784: new EFP (P, -1, 0xc5672a115506daddL, 0x3e2ad0dL << 36),
1785: new EFP (P, -1, 0xc346ccda24976407L, 0x20ec856L << 36),
1786: new EFP (P, -1, 0xc12c4cca66709456L, 0x7c457d6L << 36),
1787: new EFP (P, -1, 0xbf1799b67a731082L, 0xe815d0bL << 36),
1788: new EFP (P, -1, 0xbd08a39f580c36beL, 0xa8811fbL << 36),
1789: new EFP (P, -1, 0xbaff5ab2133e45fbL, 0x74d519dL << 36),
1790: new EFP (P, -1, 0xb8fbaf4762fb9ee9L, 0x1b87978L << 36),
1791: new EFP (P, -1, 0xb6fd91e328d17791L, 0x07165f1L << 36),
1792: new EFP (P, -1, 0xb504f333f9de6484L, 0x597d89bL << 36),
1793: new EFP (P, -1, 0xb311c412a9112489L, 0x3ecf14eL << 36),
1794: new EFP (P, -1, 0xb123f581d2ac258fL, 0x87d037fL << 36),
1795: new EFP (P, -1, 0xaf3b78ad690a4374L, 0xdf26102L << 36),
1796: new EFP (P, -1, 0xad583eea42a14ac6L, 0x4980a8dL << 36),
1797: new EFP (P, -1, 0xab7a39b5a93ed337L, 0x658023bL << 36),
1798: new EFP (P, -1, 0xa9a15ab4ea7c0ef8L, 0x541e24fL << 36),
1799: new EFP (P, -1, 0xa7cd93b4e9653569L, 0x9ec5b4dL << 36),
1800: new EFP (P, -1, 0xa5fed6a9b15138eaL, 0x1cbd7f6L << 36),
1801: new EFP (P, -1, 0xa43515ae09e6809eL, 0x0d1db48L << 36),
1802: new EFP (P, -1, 0xa27043030c496818L, 0x9b7a04fL << 36),
1803: new EFP (P, -1, 0xa0b0510fb9714fc2L, 0x192dc7aL << 36),
1804: new EFP (P, -1, 0x9ef5326091a111adL, 0xa0911f1L << 36),
1805: new EFP (P, -1, 0x9d3ed9a72cffb750L, 0xde494cfL << 36),
1806: new EFP (P, -1, 0x9b8d39b9d54e5538L, 0xa2a817aL << 36),
1807: new EFP (P, -1, 0x99e0459320b7fa64L, 0xe43086dL << 36),
1808: new EFP (P, -1, 0x9837f0518db8a96fL, 0x46ad232L << 36),
1809: new EFP (P, -1, 0x96942d3720185a00L, 0x48ea9b7L << 36),
1810: new EFP (P, -1, 0x94f4efa8fef70961L, 0x2e8afadL << 36),
1811: new EFP (P, -1, 0x935a2b2f13e6e92bL, 0xd339941L << 36),
1812: new EFP (P, -1, 0x91c3d373ab11c336L, 0x0fd6d8eL << 36),
1813: new EFP (P, -1, 0x9031dc431466b1dcL, 0x775814bL << 36),
1814: new EFP (P, -1, 0x8ea4398b45cd53c0L, 0x2dc0145L << 36),
1815: new EFP (P, -1, 0x8d1adf5b7e5ba9e5L, 0xb4c7b49L << 36),
1816: new EFP (P, -1, 0x8b95c1e3ea8bd6e6L, 0xfbe4628L << 36),
1817: new EFP (P, -1, 0x8a14d575496efd9aL, 0x080ca1eL << 36),
1818: new EFP (P, -1, 0x88980e8092da8527L, 0x5df8d77L << 36),
1819: new EFP (P, -1, 0x871f61969e8d1010L, 0x3a1727cL << 36),
1820: new EFP (P, -1, 0x85aac367cc487b14L, 0xc5c95b9L << 36),
1821: new EFP (P, -1, 0x843a28c3acde4046L, 0x1af92edL << 36),
1822: new EFP (P, -1, 0x82cd8698ac2ba1d7L, 0x3e2a476L << 36),
1823: new EFP (P, -1, 0x8164d1f3bc030773L, 0x7be5652L << 36),
1824: };
1825:
1826:
1827:
1828:
1829: public final EFP EXP2M1_C1 = new EFP (P, -1, 0xb17217f7d1cf79abL, 0xc9e3b3aL << 36);
1830: public final EFP EXP2M1_C2 = new EFP (P, -3, 0xf5fdeffc162c7543L, 0x78b5837L << 36);
1831: public final EFP EXP2M1_C3 = new EFP (P, -5, 0xe35846b82505fc59L, 0x9d3b15eL << 36);
1832: public final EFP EXP2M1_C4 = new EFP (P, -7, 0x9d955b7dd273b94eL, 0x65df05bL << 36);
1833: public final EFP EXP2M1_C5 = new EFP (P, -10, 0xaec3ff3c53398883L, 0x8bfb4d3L << 36);
1834: public final EFP EXP2M1_C6 = new EFP (P, -13, 0xa184897c363c3b7aL, 0x58544c3L << 36);
1835: public final EFP EXP2M1_C7 = new EFP (P, -17, 0xffe5fe2c45863435L, 0x8a8e644L << 36);
1836: public final EFP EXP2M1_C8 = new EFP (P, -20, 0xb160111d2e411fecL, 0x7ff3037L << 36);
1837: public final EFP EXP2M1_C9 = new EFP (P, -24, 0xda929e9caf3e1ed2L, 0x53872d2L << 36);
1838: public final EFP EXP2M1_C10 = new EFP (P, -28, 0xf267a8ac5c764fb7L, 0xed0eca9L << 36);
1839: public final EFP EXP2M1_C11 = new EFP (P, -32, 0xf465639a8dd92607L, 0xabccaf2L << 36);
1840: public final EFP EXP2M1_C12 = new EFP (P, -36, 0xe1deb287e14c2f15L, 0xab43f0cL << 36);
1841: public final EFP EXP2M1_C13 = new EFP (P, -40, 0xc0b0c98b3687cb14L, 0x0d61808L << 36);
1842: public final EFP EXP2M1_C14 = new EFP (P, -44, 0x98a4b26ac3c54b9fL, 0x8a1b12bL << 36);
1843: public final EFP EXP2M1_C15 = new EFP (P, -49, 0xe1b7421d82010f33L, 0xd8abf8dL << 36);
1844: public final EFP EXP2M1_C16 = new EFP (P, -53, 0x9c744d73cfc59c91L, 0xc7f2765L << 36);
1845: public final EFP EXP2M1_C17 = new EFP (P, -58, 0xcc2225a0e12d3eabL, 0x0ec4008L << 36);
1846:
1847:
1848:
1849:
1850:
1851: public final EFP EXPM1_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
1852: public final EFP EXPM1_C2 = new EFP (P, -1, 0x8000000000000000L, 0x0000000L << 36);
1853: public final EFP EXPM1_C3 = new EFP (P, -3, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaabL << 36);
1854: public final EFP EXPM1_C4 = new EFP (P, -5, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaabL << 36);
1855: public final EFP EXPM1_C5 = new EFP (P, -7, 0x8888888888888888L, 0x8888889L << 36);
1856: public final EFP EXPM1_C6 = new EFP (P, -10, 0xb60b60b60b60b60bL, 0x60b60b6L << 36);
1857: public final EFP EXPM1_C7 = new EFP (P, -13, 0xd00d00d00d00d00dL, 0x00d00d0L << 36);
1858: public final EFP EXPM1_C8 = new EFP (P, -16, 0xd00d00d00d00d00dL, 0x00d00d0L << 36);
1859: public final EFP EXPM1_C9 = new EFP (P, -19, 0xb8ef1d2ab6399c7dL, 0x560e447L << 36);
1860: public final EFP EXPM1_C10 = new EFP (P, -22, 0x93f27dbbc4fae397L, 0x780b69fL << 36);
1861: public final EFP EXPM1_C11 = new EFP (P, -26, 0xd7322b3faa271c7fL, 0x3a3f25cL << 36);
1862: public final EFP EXPM1_C12 = new EFP (P, -29, 0x8f76c77fc6c4bdaaL, 0x26d4c3dL << 36);
1863: public final EFP EXPM1_C13 = new EFP (P, -33, 0xb092309d43684be5L, 0x1c198e9L << 36);
1864: public final EFP EXPM1_C14 = new EFP (P, -37, 0xc9cba54603e4e905L, 0xd6f8a2fL << 36);
1865: public final EFP EXPM1_C15 = new EFP (P, -41, 0xd73f9f399dc0f88eL, 0xc32b587L << 36);
1866: public final EFP EXPM1_C16 = new EFP (P, -45, 0xd73f9f399dc0f88eL, 0xc32b587L << 36);
1867: public final EFP EXPM1_C17 = new EFP (P, -49, 0xca963b81856a5359L, 0x3028cbcL << 36);
1868: public final EFP EXPM1_C18 = new EFP (P, -53, 0xb413c31dcbecbbddL, 0x8024435L << 36);
1869:
1870:
1871:
1872:
1873: public static final int[] TWO_PI_ARRAY = {
1874:
1875: 0x00000000, 0x00000000, 0x00000000, 0x517cc1b7, 0x1391054a, 0x3f84eafa, 0x1f534ddc, 0x06db14ac, 0x64f10e41, 0x03fca2c7,
1876: 0x2bdebbc5, 0x30db9237, 0x0e909374, 0x5c00c925, 0x6ea09d19, 0x10e7f0ef, 0x2c72c4a6, 0x4e7dd104, 0x35f52ebb, 0x224274ce,
1877: 0x1c09ad17, 0x6fc82732, 0x1d639835, 0x19cfa4e4, 0x117e2ef7, 0x7250763f, 0x7897ffde, 0x02cc07f7, 0x4bc462d6, 0x414da3ed,
1878: 0x5367ecf2, 0x3e584dba, 0x3d18fd9a, 0x3cbfd45a, 0x7527bac7, 0x75f2f8bd, 0x4f41ce7d, 0x714a525d, 0x26bfb5fb, 0x08fc6ae8,
1879: 0x21580cc1, 0x0df8f6d7, 0x2bf0cfbc, 0x104d7a1b, 0x076a78e4, 0x2c2bdcc3, 0x30865998, 0x2af8a503, 0x210237ff, 0x31009ae6,
1880: 0x27310606, 0x0aab6539, 0x6a325838, 0x4f78118d, 0x347c419c, 0x1b3e6ee7, 0x2024aa0d, 0x3388ed17, 0x161ca6dd, 0x57a268ab,
1881: 0x46414fa9, 0x3fe0e0a7, 0x77e33e83, 0x1616f27c, 0x60c9f6ef, 0x067a4dde, 0x6b1e5ef8, 0x4f9d0f9a, 0x72bc9fc7, 0x30fe2432,
1882: 0x07c7c246, 0x57d376ab, 0x5cb4c10c, 0x762b8c29, 0x359d19c3, 0x616256a0, 0x534b1740, 0x0188cfb0, 0x62d71e39, 0x5634d803,
1883: 0x08cdf34a, 0x692f4f69, 0x555537f6, 0x1f6b8c08, 0x28ff1d93, 0x2553ac95, 0x3d770f87, 0x631abd83, 0x6b9c545d, 0x2c9381b3,
1884: 0x563b3884, 0x53e59192, 0x1de2b588, 0x6a8b5723, 0x7001b0af, 0x0efe70cf, 0x7cc67da8, 0x3cccc2af, 0x1947fbac, 0x6c3fbf5b,
1885: 0x5948a27a, 0x064c17fc, 0x6cdc4ef0, 0x49b366a1, 0x7d775f78, 0x2dbc76b1, 0x129bde28, 0x11697443, 0x0a135638, 0x465958c2,
1886: 0x6e308cb7, 0x6f028600, 0x5e9c77cd, 0x37c03068, 0x132e6212, 0x4180a441, 0x56e3bd5f, 0x7615be5d, 0x11e434a4, 0x469b3886,
1887: 0x6376a909, 0x3f5d9cc2, 0x6aa4280a, 0x5a4ce9f9, 0x29819fdd, 0x6b907854, 0x3883c617, 0x439c52d4, 0x32bef75d, 0x5ec74c5b,
1888: 0x4bbff4ef, 0x40c6b3e0, 0x49917295, 0x26db395a, 0x2a8288d6, 0x0e13be48, 0x48509812, 0x368c2588, 0x59c444c5, 0x6448d926,
1889: 0x7cc5c02b, 0x287a9ca9, 0x12910d5f, 0x6fe5f006, 0x32507bbb, 0x1ce1ea7c, 0x1380f1ec, 0x61f3d994, 0x3e31e501, 0x3267ce38,
1890: 0x1b3092ef, 0x1a285ce0, 0x4a21ec82, 0x573f6a5d, 0x4292472f, 0x193db6aa, 0x432429dc, 0x43fced72, 0x6cb314a1, 0x33cf13ca,
1891: 0x06277fd2, 0x2f29d109, 0x66e29731, 0x4cb5f6c4, 0x0d97d7c3, 0x5fb77693, 0x2486ca46, 0x3a139389, 0x497636e0, 0x2b3e13cb,
1892: 0x3c25318d, 0x1cba7b8e, 0x014c0043, 0x01ad0109, 0x358ee2c9, 0x05523817, 0x1dd0935a, 0x7b4cfbee, 0x72486eef, 0x0b4fd34a,
1893: 0x23bda46d, 0x0a2a7a3e, 0x20acf339, 0x4103f25f, 0x55a18ec9, 0x3e7dba06, 0x5d407f89, 0x4294a92a, 0x70190dc4, 0x1b0da649,
1894: 0x032754c5, 0x5ea38a73, 0x39511704, 0x1216d3ea, 0x2ad56614, 0x4e8393a8, 0x011776ce, 0x7698aedd, 0x217f9877, 0x6b5a4dd1,
1895: 0x1c74a5a6, 0x2d59998c, 0x5414ad6a, 0x714844ec, 0x62141c8b, 0x17d48092, 0x40777703, 0x07993fe0, 0x02a1c7a9, 0x1384cc7b,
1896: 0x606483dd, 0x4bcb9fd1, 0x7f6510e3, 0x10c1bbc8, 0x1319d399, 0x146386ef, 0x1edc5cef, 0x3e10566e, 0x15a0805c, 0x49c02d49,
1897: 0x0444363a, 0x01f5f00d, 0x44bffdb0, 0x7c81c3b0, 0x61645695, 0x457796c3, 0x3989c7bd, 0x20080279, 0x3489dd52, 0x3ed6dd77,
1898: 0x322dbaa1, 0x20517934, 0x25da0d90, 0x66761235, 0x140eaa3a, 0x28e1518e, 0x6bbb6bc4, 0x44cb89b8, 0x26d9c7a2, 0x6cbab604,
1899: 0x0cfc0fdb, 0x60131880, 0x2b99316d, 0x03da1c8a, 0x480316f0, 0x7b18925e, 0x54badc6a, 0x2e527669, 0x5e9cdaa7, 0x4d292556,
1900: 0x6842ddde, 0x318cf7c6, 0x1d94a2da, 0x06fb7f95, 0x3a1ae311, 0x2efd0d70, 0x036bec31, 0x4c9ac96e, 0x05ed3065, 0x14dfab2b,
1901: 0x4ebfd1ee, 0x3f2d5e77, 0x675df932, 0x4184055f, 0x5a319857, 0x16080c45, 0x7a1de4d9, 0x52599ec7, 0x46d5c273, 0x26dd2849,
1902: 0x6a4be13b, 0x291998d5, 0x2bc2a195, 0x1f4b83a4, 0x0f3f0bcd, 0x3c2dbb7c, 0x48c122de, 0x6e42f12a, 0x3a6c6e26, 0x7378075f,
1903: 0x3d612a6e, 0x6fb58974, 0x66aacfcf, 0x3b0e8168, 0x4b7c6c70, 0x33318ef5, 0x5c3da488, 0x3502efbf, 0x520318bf, 0x615935d9,
1904: 0x5dbc5c3f, 0x36ef680f, 0x71e42db6, 0x654744b4, 0x39aaf009, 0x1a9d6822, 0x5edad0b4, 0x52fd0097, 0x2707da0e, 0x553b50ac,
1905: 0x5eca8485, 0x45b6fb9f, 0x5e5fafed, 0x5c4fedf4, 0x25b1db93, 0x79520ce1, 0x003e156e, 0x42ffc3fe, 0x41cf8a0c, 0x6cec30c3,
1906: 0x02aeabd4, 0x6d7f3d9b, 0x39b63ce5, 0x4f2ab77e, 0x3148d784, 0x0b6f9821, 0x4b71cd58, 0x24b9ce19, 0x1b8cb30f, 0x6b65fd10,
1907: 0x029391b0, 0x0b41bab4, 0x476f21d2, 0x0931422e, 0x2e52585c, 0x1c0acd60, 0x15299375, 0x2a85bea8, 0x7b13c4cd, 0x3edc27c8,
1908: 0x305da92e, 0x42e1d90e, 0x4d8ca869, 0x16e11a96, 0x1ea21f71, 0x37234c7b, 0x5ffc9e00, 0x06185a81, 0x0da0cd4f, 0x4cd29069,
1909: 0x68acc297, 0x25e85f36, 0x4cbda11d, 0x05f3ee0e, 0x6e6ef45e, 0x57034594, 0x5c6a0817, 0x2a972a80, 0x09fc051f, 0x70c0fc2c,
1910: 0x40b148d4, 0x0cb6f5f4, 0x1cabf76a, 0x6c4ad669, 0x097bfef3, 0x02cf5fdc, 0x53da9a2a, 0x05494b58, 0x44fbcf82, 0x6cc2d6bc,
1911: 0x571fd235, 0x1a1b4c74, 0x205f57a4, 0x589f8a4a, 0x4e200048, 0x1990dbae, 0x1b6dec9f, 0x2b05f88b, 0x1535ac1c, 0x03596119,
1912: 0x50c0b248, 0x2aa8877d, 0x47b0dca5, 0x2760d466, 0x540c07bd, 0x6036622f, 0x03e8a53b, 0x1195ac83, 0x73e8de64, 0x3e6c324d,
1913: 0x4c6fb670, 0x72f49a8b, 0x077c5e36, 0x489ed781, 0x70eae918, 0x308cbeea, 0x55f5bdd2, 0x6349372e, 0x4bab3b51, 0x01c847c3,
1914: 0x487c461e, 0x4fe94f9e, 0x5b9f29f0, 0x446b22df, 0x45e0088d, 0x6bfff135, 0x1bb1bf6c, 0x1821126e, 0x45d7cb2a, 0x6b5ceb76,
1915: 0x35edc8f9, 0x54238d53, 0x4ff7df73, 0x14dd64da, 0x54402dc3, 0x365c4497, 0x274607de, 0x2c56c3a1, 0x30543430, 0x310328cc,
1916: 0x7e162901, 0x3b3d4fdf, 0x3f7f7bd1, 0x2ac6cfdb, 0x113d9ecb, 0x4dd45fe4, 0x5f109ea0, 0x6386dde2, 0x36c59456, 0x546c5ad4,
1917: 0x2d03b333, 0x65b12246, 0x4576f895, 0x31671e74, 0x66e4835a, 0x54bcd738, 0x2a3ecc5f, 0x08a505fe, 0x7efd385b, 0x2771c590,
1918: 0x6e284d4e, 0x4d4da7e6, 0x47bbbf24, 0x6a5cc272, 0x2f442138, 0x646c8d85, 0x3f205a92, 0x5f7b0385, 0x784b4538, 0x64ca7661,
1919: 0x09537154, 0x55ad8d81, 0x16190bb8, 0x380d324a, 0x5a581689, 0x5dca47e1, 0x7117f11b, 0x2fa7ae5f, 0x70b6f0d3, 0x5d786998,
1920: 0x5de8605e, 0x6ecdc733, 0x7bcce4ae, 0x02f9336b, 0x061bc57e, 0x0e341a88, 0x40fb6121, 0x63bbba38, 0x2da118af, 0x231610eb,
1921: 0x7cd6661e, 0x5b380a93, 0x6fa864ff, 0x6032b573, 0x6794d88a, 0x12455a71, 0x5c9367aa, 0x742a9c13, 0x20a6f9f2, 0x5481aa36,
1922: 0x133990ed, 0x3d4a402b, 0x27c2c996, 0x4f10ff2e, 0x4c8836d1, 0x7cd9c910, 0x52a09ec8, 0x39f31b93, 0x7405547d, 0x61d3a70a,
1923: 0x0bad9f7e, 0x3bfcbfa8, 0x5ea4677b, 0x3d565d51, 0x3d9548e2, 0x056ab748, 0x1086e598, 0x31510c1a, 0x1ce79b8e, 0x13a93dca,
1924: 0x40fb49e9, 0x2b7fe507, 0x47229671, 0x257f5298, 0x5c1d3cfc, 0x287d72d6, 0x6e1b151d, 0x44870a77, 0x06219479, 0x1643b088,
1925: 0x1ed30a86, 0x45900257, 0x74390268, 0x4449e3c7, 0x1312a1ef, 0x37cb8475, 0x44eaf426, 0x4533fbdf, 0x64834ae8, 0x6cb63267,
1926: 0x50b7cbdd, 0x628d231e, 0x749f7785, 0x52332935, 0x1529a828, 0x67345a76, 0x424827d1, 0x195309cc, 0x38270237, 0x63f195c8,
1927: 0x3e3bd69f, 0x4eac2811, 0x71212a9d, 0x5aa6bf37, 0x5446696a, 0x7f36badb, 0x78261dd9, 0x3011b0b4, 0x7ceb1286, 0x4506dbda,
1928: 0x727a8d39, 0x54dc412e, 0x0c9ad6c9, 0x68dda680, 0x07700d25, 0x2fa7e26a, 0x640601c7, 0x41c27f13, 0x3295f364, 0x5478d753,
1929: 0x52ce3f13, 0x1d565768, 0x7270babc, 0x1d39a5d3, 0x014b74d3, 0x70ac75d6, 0x7e8a31bb, 0x1b2c4adb, 0x51fdea65, 0x18755a72,
1930: 0x2251e7f3, 0x76c4ba75, 0x6ea53f62, 0x5c03ccc3, 0x34393d8e, 0x5291d519, 0x41a3858c, 0x76a77631, 0x01d3a9d4, 0x009e8660,
1931: 0x6f97e18b, 0x4e77e51e, 0x39b5bf0b, 0x611a913a, 0x1fa891f0, 0x1aa5a3e3, 0x1add3909, 0x26fc988e, 0x42d0ac95, 0x12db65c4,
1932: 0x64b25ef1, 0x1a9de352, 0x0692b42a, 0x5925cc9d, 0x08657309, 0x0cc167d9, 0x446c6821, 0x65177b9d, 0x6160e142, 0x75b20ee8,
1933: 0x2ee8f956, 0x3a8b2f71, 0x42a4483f, 0x1995d7c2, 0x219cb234, 0x365f5360, 0x50f3ddf9, 0x7ab9edb0, 0x6d3f88cf, 0x4d8834dd,
1934: 0x6a318775, 0x5135e2f2, 0x733a9c22, 0x29b8afc4, 0x0196f1e8, 0x1cdf2428, 0x574b4bd3, 0x52aabb2d, 0x6c2e7d75, 0x2b182706,
1935: 0x00b83bf1, 0x014177f3, 0x337125a7, 0x1116fdfb, 0x067620e3, 0x038cc33c, 0x6b20d55b, 0x5a89bbcf, 0x2026be45, 0x121ae7bc,
1936: 0x0b0da5ce, 0x3fac560c, 0x4d1c9199, 0x6f434273, 0x626bc455, 0x2f3ac2e5, 0x55c47451, 0x10d32290, 0x0d6056ad, 0x55eb17b2,
1937: 0x25bb8308, 0x25fe6bad, 0x588a6768, 0x24ab28f5, 0x2e782937, 0x3dfcae20, 0x10836a39, 0x7c7518cf, 0x0e077ab2, 0x1639592d,
1938: 0x337f21ed, 0x282f4cc2, 0x1d0e7f15, 0x5806636e, 0x3b8bf886, 0x72b546e1, 0x50d88c39, 0x7279faad, 0x28f2d733, 0x0028d781,
1939: 0x06827f2d, 0x682b43aa, 0x6b236ff7, 0x1297a5e3, 0x6e29645f, 0x758b2b8a, 0x5de212c3, 0x458994b2, 0x73fd40d9, 0x44c5f4f6,
1940: 0x16f4d9a6, 0x1567f3f8, 0x1d00f535, 0x408dfb22, 0x631b1bfc, 0x5da282de, 0x5f203386, 0x28d7ac86, 0x4fd91cdf, 0x22a1af9a,
1941: 0x14f8ad6a, 0x5935d902, 0x31485f9d, 0x15fdd6dc, 0x79dbd6e6, 0x5e2b9f94, 0x318214b5, 0x36f4ff26, 0x543f0d7d, 0x35dab45a,
1942: 0x0c1c9605, 0x38c975b7, 0x2476481f, 0x22895d47, 0x46343566, 0x136ada18, 0x58788dfc, 0x344413df, 0x7958e234, 0x49bcc1af,
1943: 0x52992f70, 0x05857c27, 0x3e80a00b, 0x395188ae, 0x17c786f4, 0x21b69a70, 0x69e85969, 0x3b595648, 0x7e289b08, 0x60e1e008,
1944: 0x1412fc9f, 0x52fb951c, 0x271a1e38, 0x554eca19, 0x7e155927, 0x249a71c0, 0x2a4bdd54, 0x67e14c7b, 0x34399971, 0x715baad4,
1945: 0x629f0023, 0x63358a9a, 0x22ea0b4f, 0x2f9f0306, 0x2127ff49, 0x535ca59c, 0x7a5fdde9, 0x67037d85, 0x3a294333, 0x5d53a7c6,
1946: 0x766ddb83, 0x27a86d04, 0x4211be21, 0x15c7aa13, 0x1a032eae, 0x16fe5a05, 0x3ee6ccf8, 0x503ba362, 0x6bad8c0a, 0x7ecb5cbd,
1947: 0x54b72670, 0x4efeb2a3, 0x5521ccd6, 0x5b24b5ac, 0x1158acee, 0x5e5434b8, 0x47ca2cfa, 0x4dc9ebdb, 0x6e2520f4, 0x712d6079,
1948: 0x479cb1d0, 0x412ec476, 0x6df4e0ce, 0x218dccdd, 0x112dc112, 0x01a06f3c, 0x0a83fb99, 0x4cf103b8, 0x0ae80abf, 0x669460db,
1949: 0x6b378631, 0x1f046ecc, 0x6b9959db, 0x21603fd5, 0x2f580e29, 0x2ae0ad5d, 0x6bf5b0bd, 0x4af4a5f0, 0x02e7ace9, 0x43c47e49,
1950: 0x2d62c9ac, 0x278d6bae, 0x104be4ed, 0x5c16985d, 0x546c0ed2, 0x72af0b2a, 0x61e1a03e, 0x7eced683, 0x6698ec3a, 0x7142ea4b,
1951: 0x5f24a858, 0x6e9c3272, 0x06f911c9, 0x0d5513a3, 0x1fc36964, 0x67ed3ad4, 0x2578ec29, 0x7cfd545a, 0x2b766f3e, 0x76b83a17,
1952: 0x688dd533, 0x7f6f1b7b, 0x7bd82cc2, 0x16398030, 0x29ebb591, 0x28bd8e64, 0x5adfbbc3, 0x1bc4cf94, 0x73d1a019, 0x21dc51ba,
1953: 0x258a3a9a, 0x46e4c4c5, 0x6928185e, 0x530afef7, 0x2d875f8b, 0x1f4f5d6f, 0x148d28b4, 0x463d8e26, 0x00bc57e7, 0x30a17145,
1954: 0x5b016cdd, 0x2b1c719f, 0x52ced170, 0x525ea256, 0x04b90d6f, 0x6c1ccaef, 0x2b714760, 0x4c558061, 0x1a2a9160, 0x12d57856,
1955: 0x4f909d7d, 0x32160cfc, 0x774b63e8, 0x5580957f, 0x3f205106, 0x6cf7f633, 0x76d4d795, 0x2bffd269, 0x6c2ca700, 0x4c9bac8e,
1956: 0x34a1ad86, 0x19f38439, 0x16f7e283, 0x77df8d0a, 0x251e13b6, 0x32e8b8c3, 0x46a1068a, 0x1e9c5c29, 0x5b2fa425, 0x02e01623,
1957: 0x51ce180d, 0x66090a25, 0x5df2cab5, 0x552ac91c, 0x2e89ef09, 0x0c000db6, 0x6951b1e0, 0x789a0cbc, 0x6ae6f080, 0x197c594d,
1958: 0x10fa6934, 0x798f992f, 0x4bfbe442, 0x665adf98, 0x0215d378, 0x367fd774, 0x574985bf, 0x447087e5, 0x4828acdf, 0x26924cf7,
1959: 0x0f3ac27c, 0x0df67285, 0x60d6c4e2, 0x260b1d34, 0x22381ff4, 0x019645ba, 0x531bc9b6, 0x1e29e4a7, 0x2cb63fe8, 0x3c34ff74,
1960: 0x45e57b7c, 0x131273c5, 0x24ab0a65, 0x4683a26a, 0x2f7d5a42, 0x0c8e8918, 0x68b0e425, 0x2ede222c, 0x1fffc690, 0x1951ff6c,
1961: 0x390fa5f7, 0x72db49bf, 0x1a472a23, 0x3edb35f5, 0x2c822c06, 0x7b751e95, 0x20b4c1e8, 0x7201c30a, 0x1a568076, 0x3a3229c0,
1962: 0x0e8de742, 0x11c7a6ac, 0x0108583f, 0x61b495f1, 0x20f7527e, 0x2f65cc0e, 0x412fb7e9, 0x0f43e808, 0x5dc68477, 0x7a9463f7,
1963: 0x5fc162d6, 0x6949775c, 0x0a355126, 0x3f132edb, 0x7166ef0a, 0x4d1d3a6f, 0x61ad61d1, 0x4fdab592, 0x71a3b69c, 0x35df937d,
1964: 0x137af459, 0x4a907aed, 0x3ac1d542, 0x18e3e8d7, 0x5e8fac78, 0x14a4ae49, 0x6aabefb6, 0x77e37c4c, 0x3e4f0dde, 0x7ed7dccf,
1965: 0x3bac1d8a, 0x758937b9, 0x773b8d06, 0x44928857, 0x36123085, 0x6cfe74b3, 0x542cde0f, 0x75489536, 0x0bed8292, 0x2413fd2b,
1966: 0x5a2b596b, 0x5802b312, 0x1466722c, 0x5fd5e188, 0x2cfc3e6c, 0x457efa07, 0x7ca7008b, 0x30042951, 0x4d63ead1, 0x1dd4a4df,
1967: 0x3fb0dc1e, 0x49a31414, 0x4325445a, 0x5d3b0f83, 0x33285b53, 0x22a6d56b, 0x60ce333d, 0x261489f9, 0x206fdd19, 0x0473cf16,
1968: 0x12aff801, 0x3afc227c, 0x60cb396d, 0x71adb49d, 0x24f0aed6, 0x60dec1f8, 0x74bbf1d8, 0x6317b251, 0x7ddc3bf1, 0x39715e5c,
1969: 0x5dd12bf8, 0x0b70339b, 0x1751f725, 0x25cf2702, 0x66ad9d94, 0x5c36fbf7, 0x2cd904e7, 0x1705954c, 0x6522c5ae, 0x34701d5f,
1970: 0x1d1f3539, 0x4e5ac6f3, 0x58b21a8d, 0x5604296f, 0x59f20834, 0x71553e1c, 0x645dcd7a, 0x75f00a6f, 0x2dd36c8a, 0x2b16683e,
1971: 0x5217a178, 0x14afab5a, 0x78298160, 0x1561f22d, 0x44c17ce8, 0x7de4db61, 0x50910214, 0x513bc866, 0x478f0860, 0x5bea3878,
1972: 0x2001c11d, 0x1c94c363, 0x4f10f050, 0x4c8e924f, 0x4e6ce03d, 0x5d1db956, 0x796b4a2b, 0x76bbf110, 0x6f4060ad, 0x209f4870,
1973: 0x020eed54, 0x0003cfb4, 0x01b409a1, 0x1cd56a51, 0x5e1a1f1b, 0x0ad47bed, 0x0cc38b4a, 0x5bd71ce4, 0x76b45f98, 0x2f10a374,
1974: 0x345d3ab0, 0x6d3f6a7c, 0x7d00e32a, 0x5790fb34, 0x6a007a58, 0x2631f0a8, 0x53537781, 0x47e6d0a0, 0x1ef295fa, 0x12cb2e53,
1975: 0x1cc6f20c, 0x1f08d6aa, 0x4e0bd445, 0x0107ab02, 0x7692436d, 0x3c67f4e8, 0x04a2717c, 0x270b82ce, 0x284fedd0, 0x5856f438,
1976: 0x2dd7e754, 0x54aa2e82, 0x009d1952, 0x433b5bf8, 0x79923e89, 0x6e4a9f6e, 0x4173ab12, 0x06c14fa3, 0x1a1800a9, 0x04e69bb2,
1977: 0x56165d57, 0x432db958, 0x7e07141f, 0x15435c6f, 0x52777a77, 0x33496069, 0x3c48a10c, 0x0cd25a95, 0x0a91f166, 0x265bc1be,
1978: 0x67f67d7a, 0x719c9e48, 0x3e44fddd, 0x292e3d83, 0x46297725, 0x55068553, 0x3e829c3a, 0x02de9ef9, 0x2f4cf771, 0x0f7af4b0,
1979: 0x2a4a6256, 0x2c1f745d, 0x1b3c5c63, 0x415065a9, 0x144eec3f, 0x10adfef5, 0x7a8dd087, 0x5ba28ec9, 0x1e715b24, 0x2e781501,
1980: 0x196aafdb, 0x6ddc0ff5, 0x6a7db0b8, 0x2922c055, 0x1769411c, 0x7434d29c, 0x557218d4, 0x4d8688d7, 0x1fbe0ab7, 0x4e7d4e64,
1981: 0x2d3d2515, 0x7780f9d5, 0x701dfb6b, 0x4d9b6fed, 0x010dfebe, 0x7fecdbf5, 0x4882d11f, 0x276ba7ec, 0x7bb0cd6c, 0x259938b0,
1982: };
1983:
1984:
1985:
1986:
1987: public final EFP LOG_C1 = new EFP (P, 1, 0x8000000000000000L, 0x0000000L << 36);
1988: public final EFP LOG_C3 = new EFP (P, -1, 0xaaaaaaaaaaaaaaaaL, 0xaaaaafaL << 36);
1989: public final EFP LOG_C5 = new EFP (P, -2, 0xccccccccccccccccL, 0xcc9635cL << 36);
1990: public final EFP LOG_C7 = new EFP (P, -2, 0x9249249249249249L, 0xb11c709L << 36);
1991: public final EFP LOG_C9 = new EFP (P, -3, 0xe38e38e38e38e1f4L, 0xa08ab7fL << 36);
1992: public final EFP LOG_C11 = new EFP (P, -3, 0xba2e8ba2e8bba550L, 0x957b4b0L << 36);
1993: public final EFP LOG_C13 = new EFP (P, -3, 0x9d89d89d88f3a6b4L, 0xb83ee9bL << 36);
1994: public final EFP LOG_C15 = new EFP (P, -3, 0x88888888e97610a0L, 0x018bbc5L << 36);
1995: public final EFP LOG_C17 = new EFP (P, -4, 0xf0f0f0b6e98b6c2fL, 0x176ec78L << 36);
1996: public final EFP LOG_C19 = new EFP (P, -4, 0xd79442422528c14bL, 0xdacdc08L << 36);
1997: public final EFP LOG_C21 = new EFP (P, -4, 0xc30a54423d395d6dL, 0xa2f5188L << 36);
1998: public final EFP LOG_C23 = new EFP (P, -4, 0xb247b3a940a7a020L, 0x5cb7483L << 36);
1999: public final EFP LOG_C25 = new EFP (P, -4, 0xa07d6fb3e1085165L, 0x68590abL << 36);
2000: public final EFP LOG_C27 = new EFP (P, -4, 0xb976c8a2f3029b2dL, 0xa0b471bL << 36);
2001:
2002:
2003:
2004:
2005:
2006: public final EFP LOG10_C1 = new EFP (P, -1, 0xde5bd8a937287195L, 0x355baabL << 36);
2007: public final EFP LOG10_C3 = new EFP (P, -2, 0x943d3b1b7a1af663L, 0x78e7cb7L << 36);
2008: public final EFP LOG10_C5 = new EFP (P, -3, 0xb1e313ba9286c144L, 0x2a80513L << 36);
2009: public final EFP LOG10_C7 = new EFP (P, -4, 0xfe1fd30a882e38abL, 0x7a44130L << 36);
2010: public final EFP LOG10_C9 = new EFP (P, -4, 0xc5a6f979f823f1cbL, 0x86cedb8L << 36);
2011: public final EFP LOG10_C11 = new EFP (P, -4, 0xa1b729353f6480daL, 0x7d9f583L << 36);
2012: public final EFP LOG10_C13 = new EFP (P, -4, 0x88d60f2d0d7965b3L, 0x533de4bL << 36);
2013: public final EFP LOG10_C15 = new EFP (P, -5, 0xed2ec4f96bbfdbfdL, 0xfddb370L << 36);
2014: public final EFP LOG10_C17 = new EFP (P, -5, 0xd147624ebd9efe71L, 0xccd7fdfL << 36);
2015: public final EFP LOG10_C19 = new EFP (P, -5, 0xbb3fe99c80f7032eL, 0x107f05cL << 36);
2016: public final EFP LOG10_C21 = new EFP (P, -5, 0xa968eecf07930e0cL, 0xbd58cd0L << 36);
2017: public final EFP LOG10_C23 = new EFP (P, -5, 0x9ada242bfa9153a2L, 0x1833fc8L << 36);
2018: public final EFP LOG10_C25 = new EFP (P, -5, 0x8b665b489db905f7L, 0x74ec677L << 36);
2019: public final EFP LOG10_C27 = new EFP (P, -5, 0xa1178c2d7152670fL, 0x3d41c7cL << 36);
2020:
2021: public final EFP[] ACCURATE_LOG10_BASE = {
2022:
2023: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2024: null,
2025: null,
2026: new EFP (P, 3, 0xa000000000000000L, 0x0000000L << 36),
2027: null,
2028: null,
2029: new EFP (P, 6, 0xc800000000000000L, 0x0000000L << 36),
2030: null,
2031: null,
2032: new EFP (P, 9, 0xfa00000000000000L, 0x0000000L << 36),
2033: null,
2034: null,
2035: null,
2036: new EFP (P, 13, 0x9c40000000000000L, 0x0000000L << 36),
2037: null,
2038: null,
2039: new EFP (P, 16, 0xc350000000000000L, 0x0000000L << 36),
2040: null,
2041: null,
2042: new EFP (P, 19, 0xf424000000000000L, 0x0000000L << 36),
2043: null,
2044: null,
2045: null,
2046: new EFP (P, 23, 0x9896800000000000L, 0x0000000L << 36),
2047: null,
2048: null,
2049: new EFP (P, 26, 0xbebc200000000000L, 0x0000000L << 36),
2050: null,
2051: null,
2052: new EFP (P, 29, 0xee6b280000000000L, 0x0000000L << 36),
2053: null,
2054: null,
2055: null,
2056: new EFP (P, 33, 0x9502f90000000000L, 0x0000000L << 36),
2057: null,
2058: null,
2059: new EFP (P, 36, 0xba43b74000000000L, 0x0000000L << 36),
2060: null,
2061: null,
2062: new EFP (P, 39, 0xe8d4a51000000000L, 0x0000000L << 36),
2063: null,
2064: null,
2065: null,
2066: new EFP (P, 43, 0x9184e72a00000000L, 0x0000000L << 36),
2067: null,
2068: null,
2069: new EFP (P, 46, 0xb5e620f480000000L, 0x0000000L << 36),
2070: null,
2071: null,
2072: new EFP (P, 49, 0xe35fa931a0000000L, 0x0000000L << 36),
2073: null,
2074: null,
2075: null,
2076: new EFP (P, 53, 0x8e1bc9bf04000000L, 0x0000000L << 36),
2077: null,
2078: null,
2079: new EFP (P, 56, 0xb1a2bc2ec5000000L, 0x0000000L << 36),
2080: null,
2081: null,
2082: new EFP (P, 59, 0xde0b6b3a76400000L, 0x0000000L << 36),
2083: null,
2084: null,
2085: null,
2086: new EFP (P, 63, 0x8ac7230489e80000L, 0x0000000L << 36),
2087: null,
2088: null,
2089: new EFP (P, 66, 0xad78ebc5ac620000L, 0x0000000L << 36),
2090: null,
2091: null,
2092: new EFP (P, 69, 0xd8d726b7177a8000L, 0x0000000L << 36),
2093: null,
2094: null,
2095: null,
2096: new EFP (P, 73, 0x878678326eac9000L, 0x0000000L << 36),
2097: null,
2098: null,
2099: new EFP (P, 76, 0xa968163f0a57b400L, 0x0000000L << 36),
2100: null,
2101: null,
2102: new EFP (P, 79, 0xd3c21bcecceda100L, 0x0000000L << 36),
2103: null,
2104: null,
2105: null,
2106: new EFP (P, 83, 0x84595161401484a0L, 0x0000000L << 36),
2107: null,
2108: null,
2109: new EFP (P, 86, 0xa56fa5b99019a5c8L, 0x0000000L << 36),
2110: null,
2111: null,
2112: new EFP (P, 89, 0xcecb8f27f4200f3aL, 0x0000000L << 36),
2113: null,
2114: null,
2115: null,
2116: new EFP (P, 93, 0x813f3978f8940984L, 0x4000000L << 36),
2117: null,
2118: null,
2119: new EFP (P, 96, 0xa18f07d736b90be5L, 0x5000000L << 36),
2120: null,
2121: null,
2122: new EFP (P, 99, 0xc9f2c9cd04674edeL, 0xa400000L << 36),
2123: null,
2124: null,
2125: new EFP (P, 102, 0xfc6f7c4045812296L, 0x4d00000L << 36),
2126: null,
2127: null,
2128: null,
2129: new EFP (P, 106, 0x9dc5ada82b70b59dL, 0xf020000L << 36),
2130: null,
2131: null,
2132: new EFP (P, 109, 0xc5371912364ce305L, 0x6c28000L << 36),
2133: null,
2134: null,
2135: new EFP (P, 112, 0xf684df56c3e01bc6L, 0xc732000L << 36),
2136: null,
2137: null,
2138: null,
2139: new EFP (P, 116, 0x9a130b963a6c115cL, 0x3c7f400L << 36),
2140: null,
2141: null,
2142: new EFP (P, 119, 0xc097ce7bc90715b3L, 0x4b9f100L << 36),
2143: null,
2144: null,
2145: new EFP (P, 122, 0xf0bdc21abb48db20L, 0x1e86d40L << 36),
2146: null,
2147: null,
2148: null,
2149: new EFP (P, 126, 0x96769950b50d88f4L, 0x1314448L << 36),
2150: null,
2151: null,
2152: new EFP (P, 129, 0xbc143fa4e250eb31L, 0x17d955aL << 36),
2153: };
2154:
2155:
2156:
2157:
2158: public final EFP LOG1P_A = new EFP (M, -2, 0x95f619980c4336f7L, 0x4d04ecaL << 36);
2159: public final EFP LOG1P_B = new EFP (P, -2, 0xd413cccfe7799211L, 0x65f626dL << 36);
2160:
2161:
2162:
2163:
2164: public final EFP LOG2_C1 = new EFP (P, 1, 0xb8aa3b295c17f0bbL, 0xbe87fedL << 36);
2165: public final EFP LOG2_C3 = new EFP (P, -1, 0xf6384ee1d01feba4L, 0xfe0ab04L << 36);
2166: public final EFP LOG2_C5 = new EFP (P, -1, 0x93bb62877cdff3c9L, 0x651237dL << 36);
2167: public final EFP LOG2_C7 = new EFP (P, -2, 0xd30bb153d6f6c9fbL, 0xeda6121L << 36);
2168: public final EFP LOG2_C9 = new EFP (P, -2, 0xa42589ebe015469bL, 0xde296e2L << 36);
2169: public final EFP LOG2_C11 = new EFP (P, -2, 0x864d424ca0127799L, 0x7cdb742L << 36);
2170: public final EFP LOG2_C13 = new EFP (P, -3, 0xe347ab469770ad93L, 0x0c89676L << 36);
2171: public final EFP LOG2_C15 = new EFP (P, -3, 0xc4f9d8b532564b9eL, 0x7d50b7aL << 36);
2172: public final EFP LOG2_C17 = new EFP (P, -3, 0xadcd64b1c6112030L, 0x2abb956L << 36);
2173: public final EFP LOG2_C19 = new EFP (P, -3, 0x9b81e9e58a334402L, 0x0adf93dL << 36);
2174: public final EFP LOG2_C21 = new EFP (P, -3, 0x8cb11e7e743a9994L, 0xf74da62L << 36);
2175: public final EFP LOG2_C23 = new EFP (P, -3, 0x809a15f248e3a311L, 0x83d14aaL << 36);
2176: public final EFP LOG2_C25 = new EFP (P, -4, 0xe789c1589b85b20fL, 0xbe84fc9L << 36);
2177: public final EFP LOG2_C27 = new EFP (P, -3, 0x85c8b3f2b1daf78cL, 0x52db8eeL << 36);
2178:
2179:
2180:
2181:
2182:
2183: public final EFP LGAMMA_C1 = new EFP (P, -4, 0xaaaaaaaaaaaaaaaaL, 0xaaaaaabL << 36);
2184: public final EFP LGAMMA_C2 = new EFP (M, -9, 0xb60b60b60b60b60bL, 0x60b60b6L << 36);
2185: public final EFP LGAMMA_C3 = new EFP (P, -11, 0xd00d00d00d00d00dL, 0x00d00d0L << 36);
2186: public final EFP LGAMMA_C4 = new EFP (M, -11, 0x9c09c09c09c09c09L, 0xc09c09cL << 36);
2187: public final EFP LGAMMA_C5 = new EFP (P, -11, 0xdca8f158c7f91ab8L, 0x7539c03L << 36);
2188: public final EFP LGAMMA_C6 = new EFP (M, -10, 0xfb5586ccc9e3e40fL, 0xb5586cdL << 36);
2189: public final EFP LGAMMA_C7 = new EFP (P, -8, 0xd20d20d20d20d20dL, 0x20d20d2L << 36);
2190: public final EFP LGAMMA_C8 = new EFP (M, -6, 0xf21436587a9cbee1L, 0x0325477L << 36);
2191: public final EFP LGAMMA_C9 = new EFP (P, -3, 0xb7f4b1c0f033ffd0L, 0xc3b7f4bL << 36);
2192: public final EFP LGAMMA_C10 = new EFP (M, 0, 0xb23b3808c0f9cf6dL, 0xedce731L << 36);
2193: public final EFP LGAMMA_C11 = new EFP (P, 3, 0xd672219167002d3aL, 0x7a9c886L << 36);
2194: public final EFP LGAMMA_C12 = new EFP (M, 7, 0x9cd9292e6660d55bL, 0x3f712ecL << 36);
2195: public final EFP LGAMMA_C13 = new EFP (P, 11, 0x8911a740da740da7L, 0x40da741L << 36);
2196: public final EFP LGAMMA_C14 = new EFP (M, 15, 0x8d0cc570e255bf59L, 0xff6eec2L << 36);
2197:
2198:
2199: public final EFP LOGTWOPI_2 = new EFP (P, -1, 0xeb3f8e4325f5a534L, 0x94bc900L << 36);
2200:
2201:
2202:
2203: public final EFP[] ROUNDED_APERY = {
2204:
2205: new EFP (P, 0, 0x99dd0027803109c1L, 0xb8b8ae3L << 36),
2206: new EFP (P, 0, 0x99dd0027803109c1L, 0xb8b8ae2L << 36),
2207: new EFP (P, 0, 0x99dd0027803109c1L, 0xb8b8ae2L << 36),
2208: new EFP (P, 0, 0x99dd0027803109c1L, 0xb8b8ae3L << 36),
2209: };
2210:
2211:
2212:
2213: public final EFP[] ROUNDED_CATALAN = {
2214:
2215: new EFP (P, -1, 0xea7cb89f409ae845L, 0x215822eL << 36),
2216: new EFP (P, -1, 0xea7cb89f409ae845L, 0x215822eL << 36),
2217: new EFP (P, -1, 0xea7cb89f409ae845L, 0x215822eL << 36),
2218: new EFP (P, -1, 0xea7cb89f409ae845L, 0x215822fL << 36),
2219: };
2220:
2221:
2222:
2223: public final EFP[] ROUNDED_EULER = {
2224:
2225: new EFP (P, -1, 0x93c467e37db0c7a4L, 0xd1be3f8L << 36),
2226: new EFP (P, -1, 0x93c467e37db0c7a4L, 0xd1be3f8L << 36),
2227: new EFP (P, -1, 0x93c467e37db0c7a4L, 0xd1be3f8L << 36),
2228: new EFP (P, -1, 0x93c467e37db0c7a4L, 0xd1be3f9L << 36),
2229: };
2230:
2231:
2232:
2233: public final EFP[] ROUNDED_NAPIER = {
2234:
2235: new EFP (P, 1, 0xadf85458a2bb4a9aL, 0xafdc562L << 36),
2236: new EFP (P, 1, 0xadf85458a2bb4a9aL, 0xafdc562L << 36),
2237: new EFP (P, 1, 0xadf85458a2bb4a9aL, 0xafdc562L << 36),
2238: new EFP (P, 1, 0xadf85458a2bb4a9aL, 0xafdc563L << 36),
2239: };
2240:
2241:
2242:
2243: public final EFP[] ROUNDED_PI = {
2244:
2245: new EFP (P, 1, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2246: new EFP (P, 1, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2247: new EFP (P, 1, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2248: new EFP (P, 1, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2249: };
2250: public final EFP[] ROUNDED_NEGPI = {
2251:
2252: new EFP (M, 1, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2253: new EFP (M, 1, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2254: new EFP (M, 1, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2255: new EFP (M, 1, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2256: };
2257: public final EFP[] ROUNDED_PI_2 = {
2258:
2259: new EFP (P, 0, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2260: new EFP (P, 0, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2261: new EFP (P, 0, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2262: new EFP (P, 0, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2263: };
2264: public final EFP[] ROUNDED_NEGPI_2 = {
2265:
2266: new EFP (M, 0, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2267: new EFP (M, 0, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2268: new EFP (M, 0, 0xc90fdaa22168c234L, 0xc4c6629L << 36),
2269: new EFP (M, 0, 0xc90fdaa22168c234L, 0xc4c6628L << 36),
2270: };
2271:
2272:
2273:
2274:
2275: public final EFP SINH_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
2276: public final EFP SINH_C3 = new EFP (P, -3, 0xaaaaaaaaaaaaaaaaL, 0xaaa8d3bL << 36);
2277: public final EFP SINH_C5 = new EFP (P, -7, 0x8888888888888888L, 0xd801ef0L << 36);
2278: public final EFP SINH_C7 = new EFP (P, -13, 0xd00d00d00d00b865L, 0xe08a011L << 36);
2279: public final EFP SINH_C9 = new EFP (P, -19, 0xb8ef1d2ab9d6b01dL, 0x54d1cf9L << 36);
2280: public final EFP SINH_C11 = new EFP (P, -26, 0xd7322aa84ab102a5L, 0xf1b3e2aL << 36);
2281: public final EFP SINH_C13 = new EFP (P, -33, 0xb09ecdc339d62e71L, 0x8115862L << 36);
2282:
2283:
2284:
2285:
2286:
2287: public final EFP SQRT1PM1_C1 = new EFP (P, -1, 0x8000000000000000L, 0x0000000L << 36);
2288: public final EFP SQRT1PM1_C2 = new EFP (M, -3, 0x8000000000000000L, 0x0000000L << 36);
2289: public final EFP SQRT1PM1_C3 = new EFP (P, -4, 0x8000000000000000L, 0x0000000L << 36);
2290: public final EFP SQRT1PM1_C4 = new EFP (M, -5, 0xa000000000000000L, 0x0000000L << 36);
2291: public final EFP SQRT1PM1_C5 = new EFP (P, -6, 0xe000000000000000L, 0x0000000L << 36);
2292: public final EFP SQRT1PM1_C6 = new EFP (M, -6, 0xa800000000000000L, 0x0000000L << 36);
2293: public final EFP SQRT1PM1_C7 = new EFP (P, -6, 0x8400000000000000L, 0x0000000L << 36);
2294: public final EFP SQRT1PM1_C8 = new EFP (M, -7, 0xd680000000000000L, 0x0000000L << 36);
2295: public final EFP SQRT1PM1_C9 = new EFP (P, -7, 0xb2c0000000000000L, 0x0000000L << 36);
2296: public final EFP SQRT1PM1_C10 = new EFP (M, -7, 0x97f0000000000000L, 0x0000000L << 36);
2297: public final EFP SQRT1PM1_C11 = new EFP (P, -7, 0x8338000000000000L, 0x0000000L << 36);
2298:
2299:
2300:
2301:
2302:
2303: public final EFP TAN_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
2304: public final EFP TAN_C3 = new EFP (P, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaaa29L << 36);
2305: public final EFP TAN_C5 = new EFP (P, -3, 0x8888888888888888L, 0x88a184aL << 36);
2306: public final EFP TAN_C7 = new EFP (P, -5, 0xdd0dd0dd0dd0dd0dL, 0x88b7614L << 36);
2307: public final EFP TAN_C9 = new EFP (P, -6, 0xb327a4416087cfd4L, 0xf296a40L << 36);
2308: public final EFP TAN_C11 = new EFP (P, -7, 0x91371aaf3611c538L, 0x2426582L << 36);
2309: public final EFP TAN_C13 = new EFP (P, -9, 0xeb69e870ac055209L, 0xe907d72L << 36);
2310: public final EFP TAN_C15 = new EFP (P, -10, 0xbed1b229560565dcL, 0x00f1ae8L << 36);
2311: public final EFP TAN_C17 = new EFP (P, -11, 0x9aac124127c7ff13L, 0xd521318L << 36);
2312: public final EFP TAN_C19 = new EFP (P, -13, 0xfabebb506d37becdL, 0x7712cf3L << 36);
2313: public final EFP TAN_C21 = new EFP (P, -14, 0xcb3f13fd9e491aeeL, 0xb4ecd04L << 36);
2314: public final EFP TAN_C23 = new EFP (P, -15, 0xa4be2f633cfa3709L, 0x2c90e93L << 36);
2315: public final EFP TAN_C25 = new EFP (P, -16, 0x859266daac37850cL, 0xcb7028bL << 36);
2316: public final EFP TAN_C27 = new EFP (P, -18, 0xd7bbef57337218a7L, 0x4e73cafL << 36);
2317: public final EFP TAN_C29 = new EFP (P, -19, 0xb53ca49c91cc2ce0L, 0x289f9c2L << 36);
2318: public final EFP TAN_C31 = new EFP (P, -21, 0xe1a12ebdc4e0aba8L, 0x6c3a02cL << 36);
2319: public final EFP TAN_C33 = new EFP (P, -21, 0xc9eb997dffc9ad78L, 0x01e7a8fL << 36);
2320:
2321:
2322: public final EFP TAN7_C1 = new EFP (P, -1, 0xffffffffffffffffL, 0xfffffffL << 36);
2323: public final EFP TAN7_C3 = new EFP (P, -2, 0xaaaaaaaaaaaaaaaaL, 0xaae677dL << 36);
2324: public final EFP TAN7_C5 = new EFP (P, -3, 0x8888888888888827L, 0x9679788L << 36);
2325: public final EFP TAN7_C7 = new EFP (P, -5, 0xdd0dd0dd0e579281L, 0x2b6ed88L << 36);
2326: public final EFP TAN7_C9 = new EFP (P, -6, 0xb327a413e1bf5c5dL, 0x5ebd854L << 36);
2327: public final EFP TAN7_C11 = new EFP (P, -7, 0x913e7ab6529ea4edL, 0x6ea7f3bL << 36);
2328:
2329: public final EFP[] TAN7_T = {
2330:
2331: new EFP (),
2332: new EFP (P, -6, 0xc91a3123d48f7fddL, 0x894dd4bL << 36),
2333: new EFP (P, -5, 0xc9393c51d88b101aL, 0xda13cefL << 36),
2334: new EFP (P, -4, 0x9711ce67f9c18b0fL, 0x459611fL << 36),
2335: new EFP (P, -4, 0xc9b5dc62d96d130fL, 0xa0a9ed1L << 36),
2336: new EFP (P, -4, 0xfc98c1d46dcf46edL, 0xdf92d54L << 36),
2337: new EFP (P, -3, 0x97e5639d3032012cL, 0xfb5a747L << 36),
2338: new EFP (P, -3, 0xb1ae4c867069ae62L, 0x1454a67L << 36),
2339: new EFP (P, -3, 0xcbafaf02a98ac03dL, 0xeba6ce9L << 36),
2340: new EFP (P, -3, 0xe5f2675a5a679294L, 0xb7c658cL << 36),
2341: new EFP (P, -2, 0x803fd3ac3135715aL, 0x6d6c3c9L << 36),
2342: new EFP (P, -2, 0x8db081e9acbf49cbL, 0xda4f636L << 36),
2343: new EFP (P, -2, 0x9b5041aae31ede28L, 0xfb2e402L << 36),
2344: new EFP (P, -2, 0xa924570b80d8bb7dL, 0x2ec70f1L << 36),
2345: new EFP (P, -2, 0xb7324fbebc324978L, 0xe945dc4L << 36),
2346: new EFP (P, -2, 0xc5800cb59e810e8cL, 0xd859b1fL << 36),
2347: new EFP (P, -2, 0xd413cccfe7799211L, 0x65f626dL << 36),
2348: new EFP (P, -2, 0xe2f438c2f33db07fL, 0xd5fe854L << 36),
2349: new EFP (P, -2, 0xf228706939f3d282L, 0xa45e2bdL << 36),
2350: new EFP (P, -1, 0x80dc0cdad3e7ba17L, 0xf9dd77dL << 36),
2351: new EFP (P, -1, 0x88d5b8c841a75c35L, 0x36865c3L << 36),
2352: new EFP (P, -1, 0x9105af7823c1286bL, 0xb5bee4cL << 36),
2353: new EFP (P, -1, 0x9970c44823ffe5deL, 0x977bc33L << 36),
2354: new EFP (P, -1, 0xa21c36dce72ed4b0L, 0x5750623L << 36),
2355: new EFP (P, -1, 0xab0dc155bfcc82f5L, 0x18a42e5L << 36),
2356: new EFP (P, -1, 0xb44ba8a3a8edb143L, 0x9bc2d44L << 36),
2357: new EFP (P, -1, 0xbddccf694c8674abL, 0x158e376L << 36),
2358: new EFP (P, -1, 0xc7c8cbdfc2f75687L, 0x408e56bL << 36),
2359: new EFP (P, -1, 0xd218015721427e59L, 0x247f018L << 36),
2360: new EFP (P, -1, 0xdcd3be0c60d7916fL, 0xc7e578dL << 36),
2361: new EFP (P, -1, 0xe8065e39c269718dL, 0xcad85e6L << 36),
2362: new EFP (P, -1, 0xf3bb757e48b83322L, 0xbd576feL << 36),
2363: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2364: new EFP (P, 0, 0x86714e8441e4ca93L, 0x0c4cf4eL << 36),
2365: new EFP (P, 0, 0x8d39eaa93c625b28L, 0xd9816cdL << 36),
2366: new EFP (P, 0, 0x946337ed7c784903L, 0x22c9598L << 36),
2367: new EFP (P, 0, 0x9bf7ec6c3b03ef3cL, 0x0d29346L << 36),
2368: new EFP (P, 0, 0xa4044fc5fa1663f0L, 0xd6fd49aL << 36),
2369: new EFP (P, 0, 0xac96888a17d2a96aL, 0x085e3bcL << 36),
2370: new EFP (P, 0, 0xb5befc31328ffd5eL, 0x4284584L << 36),
2371: new EFP (P, 0, 0xbf90c712d3a30a83L, 0x3f4d2a9L << 36),
2372: new EFP (P, 0, 0xca2253a310915399L, 0x7dd7470L << 36),
2373: new EFP (P, 0, 0xd58e1aec53a74f24L, 0x82443ddL << 36),
2374: new EFP (P, 0, 0xe1f39c0435e07a14L, 0x725b359L << 36),
2375: new EFP (P, 0, 0xef789db9e0a0310fL, 0xb3e75c7L << 36),
2376: new EFP (P, 0, 0xfe4ad5d6b67a51b7L, 0x127cf35L << 36),
2377: new EFP (P, 1, 0x87510eb8b7dfb97cL, 0xe6cb464L << 36),
2378: new EFP (P, 1, 0x9061b6353f9c6ed6L, 0xe02bffdL << 36),
2379: new EFP (P, 1, 0x9a827999fcef3242L, 0x2cbec4eL << 36),
2380: new EFP (P, 1, 0xa5e9ec3ff0327cfaL, 0x748ca31L << 36),
2381: new EFP (P, 1, 0xb2de3664128a386bL, 0x2a51effL << 36),
2382: new EFP (P, 1, 0xc1bb136b87edc0d9L, 0xae371daL << 36),
2383: new EFP (P, 1, 0xd2facf483006e648L, 0x5eb2f29L << 36),
2384: new EFP (P, 1, 0xe7442b29893f385dL, 0xfd8e2a3L << 36),
2385: new EFP (P, 1, 0xff80982f66c6df3bL, 0x0194e40L << 36),
2386: new EFP (P, 2, 0x8e80a1f38ab2f611L, 0x8c89790L << 36),
2387: new EFP (P, 2, 0xa0dff712123b8844L, 0x1c1bfb5L << 36),
2388: new EFP (P, 2, 0xb86ba8c8460d85deL, 0x3af4952L << 36),
2389: new EFP (P, 2, 0xd7b9fa6519887651L, 0xc68dc64L << 36),
2390: new EFP (P, 3, 0x81b97d9b5c3f0e2bL, 0x5c8997bL << 36),
2391: new EFP (P, 3, 0xa27362cad7ee626aL, 0x3b5d4f3L << 36),
2392: new EFP (P, 3, 0xd8e81e01e97bf967L, 0xe518f26L << 36),
2393: new EFP (P, 4, 0xa2d7ff6900daa7f2L, 0x48ca591L << 36),
2394: new EFP (P, 5, 0xa2f122af255539e2L, 0x447b82dL << 36),
2395: };
2396:
2397: public final EFP TAN7_X = new EFP (P, -7, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
2398: public final EFP TAN7_Y = new EFP (P, 5, 0xa2f9836e4e441529L, 0xfc2757dL << 36);
2399:
2400: public final EFP TAN7_Z = new EFP (P, -6, 0xc90fdaa22168c234L, 0xc4c6629L << 36);
2401: public final EFP TAN7_ZA = new EFP (M, -99, 0x8fe47c65dadfb63eL, 0xeeb3067L << 36);
2402:
2403: public final EFP TAN8_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
2404: public final EFP TAN8_C3 = new EFP (P, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaaa02L << 36);
2405: public final EFP TAN8_C5 = new EFP (P, -3, 0x8888888888888888L, 0x8911d7aL << 36);
2406: public final EFP TAN8_C7 = new EFP (P, -5, 0xdd0dd0dd0dd0dd07L, 0x61e9558L << 36);
2407: public final EFP TAN8_C9 = new EFP (P, -6, 0xb327a4416087e508L, 0x1c05687L << 36);
2408: public final EFP TAN8_C11 = new EFP (P, -7, 0x91371aaf35e647d2L, 0x9bd741cL << 36);
2409: public final EFP TAN8_C13 = new EFP (P, -9, 0xeb69e8711de22b89L, 0x087ca38L << 36);
2410: public final EFP TAN8_C15 = new EFP (P, -10, 0xbed1b1c7d2310830L, 0x871a5a7L << 36);
2411: public final EFP TAN8_C17 = new EFP (P, -11, 0x9aac48a4e5208639L, 0x1e07899L << 36);
2412: public final EFP TAN8_C19 = new EFP (P, -13, 0xfa98b158590773f4L, 0xfa72a4eL << 36);
2413: public final EFP TAN8_C21 = new EFP (P, -14, 0xd2cd5a371c03b30eL, 0x42cac1cL << 36);
2414:
2415:
2416:
2417:
2418:
2419: public final EFP TANH_C1 = new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36);
2420: public final EFP TANH_C3 = new EFP (M, -2, 0xaaaaaaaaaaaaaaaaL, 0xaaaaa63L << 36);
2421: public final EFP TANH_C5 = new EFP (P, -3, 0x8888888888888888L, 0x88710efL << 36);
2422: public final EFP TANH_C7 = new EFP (M, -5, 0xdd0dd0dd0dd0dd0dL, 0x5eb1c0fL << 36);
2423: public final EFP TANH_C9 = new EFP (P, -6, 0xb327a4416087cefcL, 0x3226807L << 36);
2424: public final EFP TANH_C11 = new EFP (M, -7, 0x91371aaf36115c72L, 0x1057753L << 36);
2425: public final EFP TANH_C13 = new EFP (P, -9, 0xeb69e870ab51ac87L, 0xbc93275L << 36);
2426: public final EFP TANH_C15 = new EFP (M, -10, 0xbed1b2291c9448e3L, 0x025162cL << 36);
2427: public final EFP TANH_C17 = new EFP (P, -11, 0x9aac122e2d563679L, 0x7f53bd9L << 36);
2428: public final EFP TANH_C19 = new EFP (M, -13, 0xfabeb45554b7f61dL, 0xed9a4e5L << 36);
2429: public final EFP TANH_C21 = new EFP (P, -14, 0xcb3e00a83f1f1703L, 0x594e12fL << 36);
2430: public final EFP TANH_C23 = new EFP (M, -15, 0xa4a40e3c50e76340L, 0x922c2ccL << 36);
2431: public final EFP TANH_C25 = new EFP (P, -16, 0x83c53e40035eb57fL, 0x80a5513L << 36);
2432: public final EFP TANH_C27 = new EFP (M, -18, 0xb47b24ce1d988d76L, 0xa0271b7L << 36);
2433:
2434:
2435:
2436:
2437: public final EFP[] EFP_TEN_P16QR = {
2438:
2439: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2440: new EFP (P, 3, 0xa000000000000000L, 0x0000000L << 36),
2441: new EFP (P, 6, 0xc800000000000000L, 0x0000000L << 36),
2442: new EFP (P, 9, 0xfa00000000000000L, 0x0000000L << 36),
2443: new EFP (P, 13, 0x9c40000000000000L, 0x0000000L << 36),
2444: new EFP (P, 16, 0xc350000000000000L, 0x0000000L << 36),
2445: new EFP (P, 19, 0xf424000000000000L, 0x0000000L << 36),
2446: new EFP (P, 23, 0x9896800000000000L, 0x0000000L << 36),
2447: new EFP (P, 26, 0xbebc200000000000L, 0x0000000L << 36),
2448: new EFP (P, 29, 0xee6b280000000000L, 0x0000000L << 36),
2449: new EFP (P, 33, 0x9502f90000000000L, 0x0000000L << 36),
2450: new EFP (P, 36, 0xba43b74000000000L, 0x0000000L << 36),
2451: new EFP (P, 39, 0xe8d4a51000000000L, 0x0000000L << 36),
2452: new EFP (P, 43, 0x9184e72a00000000L, 0x0000000L << 36),
2453: new EFP (P, 46, 0xb5e620f480000000L, 0x0000000L << 36),
2454: new EFP (P, 49, 0xe35fa931a0000000L, 0x0000000L << 36),
2455: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2456: new EFP (P, 53, 0x8e1bc9bf04000000L, 0x0000000L << 36),
2457: new EFP (P, 106, 0x9dc5ada82b70b59dL, 0xf020000L << 36),
2458: new EFP (P, 159, 0xaf298d050e4395d6L, 0x9670b13L << 36),
2459: new EFP (P, 212, 0xc2781f49ffcfa6d5L, 0x3cbf6b7L << 36),
2460: new EFP (P, 265, 0xd7e77a8f87daf7fbL, 0xdc33746L << 36),
2461: new EFP (P, 318, 0xefb3ab16c59b14a2L, 0xc5cfe95L << 36),
2462: new EFP (P, 372, 0x850fadc09923329eL, 0x03e2cf7L << 36),
2463: new EFP (P, 425, 0x93ba47c980e98cdfL, 0xc66f337L << 36),
2464: new EFP (P, 478, 0xa402b9c5a8d3a6e7L, 0x5f16207L << 36),
2465: new EFP (P, 531, 0xb616a12b7fe617aaL, 0x577b987L << 36),
2466: new EFP (P, 584, 0xca28a291859bbf93L, 0x7d7b8f7L << 36),
2467: new EFP (P, 637, 0xe070f78d3927556aL, 0x85bbe25L << 36),
2468: new EFP (P, 690, 0xf92e0c3537826145L, 0xa7709a5L << 36),
2469: new EFP (P, 744, 0x8a5296ffe33cc92fL, 0x82bd6b7L << 36),
2470: new EFP (P, 797, 0x9991a6f3d6bf1765L, 0xacca6daL << 36),
2471: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2472: new EFP (P, 850, 0xaa7eebfb9df9de8dL, 0xddbb902L << 36),
2473: new EFP (P, 1700, 0xe319a0aea60e91c6L, 0xcc655c5L << 36),
2474: new EFP (P, 2551, 0x973f9ca8cd00a68cL, 0x6c8d3fdL << 36),
2475: new EFP (P, 3401, 0xc976758681750c17L, 0x650d3d3L << 36),
2476: new EFP (P, 4252, 0x862c8c0eeb856ecbL, 0x085bccdL << 36),
2477: new EFP (P, 5102, 0xb2b8353b3993a7e4L, 0x4257ac4L << 36),
2478: new EFP (P, 5952, 0xee0ddd84924ab88cL, 0x2d4070fL << 36),
2479: new EFP (P, 6803, 0x9e8b3b5dc53d5de4L, 0xa74d28dL << 36),
2480: new EFP (P, 7653, 0xd32e203241f4806fL, 0x3f50c80L << 36),
2481: new EFP (P, 8504, 0x8ca554c020a1f0a6L, 0x5dfed0aL << 36),
2482: new EFP (P, 9354, 0xbb570a9a9bd977ccL, 0x4c80875L << 36),
2483: new EFP (P, 10204, 0xf9895d25d88b5a8aL, 0xfdd08c5L << 36),
2484: new EFP (P, 11055, 0xa630ef7d5699fe45L, 0x50e3660L << 36),
2485: new EFP (P, 11905, 0xdd5dc8a2bf27f3f7L, 0x95aa119L << 36),
2486: new EFP (P, 12756, 0x936e07737dc64f6dL, 0x8c474bbL << 36),
2487: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2488: new EFP (P, 13606, 0xc46052028a20979aL, 0xc94c154L << 36),
2489: new EFP (P, 27213, 0x96a3a1d17faf211aL, 0x0c7c289L << 36),
2490: };
2491: public final EFP[] EFP_TEN_M16QR = {
2492:
2493: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2494: new EFP (P, -4, 0xccccccccccccccccL, 0xccccccdL << 36),
2495: new EFP (P, -7, 0xa3d70a3d70a3d70aL, 0x3d70a3dL << 36),
2496: new EFP (P, -10, 0x83126e978d4fdf3bL, 0x645a1cbL << 36),
2497: new EFP (P, -14, 0xd1b71758e219652bL, 0xd3c3611L << 36),
2498: new EFP (P, -17, 0xa7c5ac471b478423L, 0x0fcf80eL << 36),
2499: new EFP (P, -20, 0x8637bd05af6c69b5L, 0xa63f9a5L << 36),
2500: new EFP (P, -24, 0xd6bf94d5e57a42bcL, 0x3d32907L << 36),
2501: new EFP (P, -27, 0xabcc77118461cefcL, 0xfdc20d3L << 36),
2502: new EFP (P, -30, 0x89705f4136b4a597L, 0x31680a9L << 36),
2503: new EFP (P, -34, 0xdbe6fecebdedd5beL, 0xb573441L << 36),
2504: new EFP (P, -37, 0xafebff0bcb24aafeL, 0xf78f69aL << 36),
2505: new EFP (P, -40, 0x8cbccc096f5088cbL, 0xf93f87bL << 36),
2506: new EFP (P, -44, 0xe12e13424bb40e13L, 0x2865a5fL << 36),
2507: new EFP (P, -47, 0xb424dc35095cd80fL, 0x538484cL << 36),
2508: new EFP (P, -50, 0x901d7cf73ab0acd9L, 0x0f9d370L << 36),
2509: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2510: new EFP (P, -54, 0xe69594bec44de15bL, 0x4c2ebe7L << 36),
2511: new EFP (P, -107, 0xcfb11ead453994baL, 0x67de18fL << 36),
2512: new EFP (P, -160, 0xbb127c53b17ec159L, 0x5560c02L << 36),
2513: new EFP (P, -213, 0xa87fea27a539e9a5L, 0x3f2398dL << 36),
2514: new EFP (P, -266, 0x97c560ba6b0919a5L, 0xdccd87aL << 36),
2515: new EFP (P, -319, 0x88b402f7fd75539bL, 0x11dbcb0L << 36),
2516: new EFP (P, -373, 0xf64335bcf065d37dL, 0x4d4617bL << 36),
2517: new EFP (P, -426, 0xddd0467c64bce4a0L, 0xac7cb3fL << 36),
2518: new EFP (P, -479, 0xc7caba6e7c5382c8L, 0xfe64a53L << 36),
2519: new EFP (P, -532, 0xb3f4e093db73a093L, 0x59ed216L << 36),
2520: new EFP (P, -585, 0xa21727db38cb002fL, 0xb8ada01L << 36),
2521: new EFP (P, -638, 0x91ff83775423cc06L, 0x7b6306aL << 36),
2522: new EFP (P, -691, 0x8380dea93da4bc60L, 0x4247cbaL << 36),
2523: new EFP (P, -745, 0xece53cec4a314ebdL, 0xa4f8bf5L << 36),
2524: new EFP (P, -798, 0xd5605fcdcf32e1d6L, 0xfb1e4aaL << 36),
2525: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2526: new EFP (P, -851, 0xc0314325637a1939L, 0xfa91115L << 36),
2527: new EFP (P, -1701, 0x9049ee32db23d21cL, 0x7132d33L << 36),
2528: new EFP (P, -2552, 0xd8a66d4a505de96bL, 0x5ae1b26L << 36),
2529: new EFP (P, -3402, 0xa2a682a5da57c0bdL, 0x87a6016L << 36),
2530: new EFP (P, -4253, 0xf4385d0975edbabeL, 0x1f4bf66L << 36),
2531: new EFP (P, -5103, 0xb759449f52a711b2L, 0x68e1eb7L << 36),
2532: new EFP (P, -5953, 0x89a63ba4c497b50eL, 0x6c83ad1L << 36),
2533: new EFP (P, -6804, 0xceae534f34362de4L, 0x492512dL << 36),
2534: new EFP (P, -7654, 0x9b2a840f28a1638fL, 0xe393a9cL << 36),
2535: new EFP (P, -8505, 0xe8fb7dc2dec0a404L, 0x598eec8L << 36),
2536: new EFP (P, -9355, 0xaee973911228abcaL, 0xe3187c3L << 36),
2537: new EFP (P, -10205, 0x8350bf3c91575a87L, 0xe79e237L << 36),
2538: new EFP (P, -11056, 0xc52ba8a6aeb15d92L, 0x9e98cbaL << 36),
2539: new EFP (P, -11906, 0x9406af8f83fd6265L, 0x4b4de35L << 36),
2540: new EFP (P, -12757, 0xde42ff8d37cad87fL, 0x1463ef5L << 36),
2541: new EFP (P, 0, 0x8000000000000000L, 0x0000000L << 36),
2542: new EFP (P, -13607, 0xa6dd04c8d2ce9fdeL, 0x2de3812L << 36),
2543: new EFP (P, -27214, 0xd986c20b686da869L, 0x5d1d4feL << 36),
2544: };
2545:
2546: public final EFP TENTO28 = new EFP (P, 93, 0x813f3978f8940984L, 0x4000000L << 36);
2547:
2548:
2549:
2550:
2551:
2552:
2553:
2554:
2555:
2556:
2557:
2558:
2559:
2560:
2561:
2562:
2563:
2564:
2565:
2566:
2567:
2568:
2569:
2570:
2571:
2572:
2573:
2574:
2575:
2576:
2577:
2578:
2579:
2580:
2581:
2582:
2583:
2584:
2585:
2586:
2587:
2588:
2589:
2590:
2591:
2592:
2593:
2594:
2595:
2596:
2597:
2598:
2599:
2600:
2601:
2602:
2603:
2604:
2605:
2606:
2607:
2608:
2609:
2610:
2611:
2612:
2613:
2614:
2615:
2616:
2617:
2618:
2619:
2620:
2621:
2622:
2623:
2624:
2625:
2626:
2627:
2628:
2629:
2630:
2631:
2632:
2633:
2634:
2635:
2636:
2637:
2638:
2639:
2640:
2641:
2642:
2643:
2644:
2645:
2646:
2647:
2648:
2649:
2650:
2651:
2652:
2653:
2654:
2655:
2656:
2657:
2658:
2659:
2660:
2661:
2662:
2663:
2664:
2665:
2666:
2667:
2668:
2669:
2670:
2671:
2672:
2673:
2674:
2675:
2676:
2677:
2678:
2679:
2680:
2681:
2682:
2683:
2684:
2685:
2686:
2687:
2688:
2689:
2690:
2691:
2692:
2693:
2694:
2695:
2696:
2697:
2698:
2699:
2700:
2701:
2702:
2703:
2704:
2705:
2706:
2707:
2708:
2709:
2710:
2711:
2712:
2713:
2714:
2715:
2716:
2717:
2718:
2719:
2720:
2721:
2722:
2723:
2724:
2725:
2726:
2727:
2728:
2729:
2730:
2731:
2732:
2733:
2734:
2735:
2736:
2737:
2738:
2739:
2740:
2741:
2742:
2743:
2744:
2745:
2746:
2747:
2748:
2749:
2750:
2751:
2752:
2753:
2754:
2755:
2756:
2757:
2758:
2759:
2760:
2761:
2762:
2763:
2764:
2765:
2766:
2767:
2768:
2769:
2770:
2771:
2772:
2773:
2774:
2775:
2776:
2777:
2778:
2779:
2780: public class EFP implements Comparable<EFP> {
2781:
2782:
2783:
2784:
2785: public static final int LEN = 92;
2786: public static final long MSB = 1L << 63;
2787: public static final long LSB = 1L << 128 - LEN;
2788: public static final long GBM = LSB >>> 1;
2789: public static final long RBM = GBM >>> 1;
2790: public static final long SBM = RBM - 1L;
2791:
2792: public static final int EFP_DECIMAL_PREC = 26;
2793:
2794: public static final int EFP_COTH_EPP_MAX = 5;
2795:
2796:
2797:
2798:
2799: public static final boolean EFP_FPCP_NAN = true;
2800:
2801:
2802:
2803:
2804:
2805: public int flg;
2806: public int epp;
2807: public long dvl;
2808:
2809: public long cvl;
2810:
2811:
2812:
2813:
2814:
2815:
2816:
2817:
2818:
2819:
2820:
2821:
2822: public EFP () {
2823: this.set0 ();
2824: }
2825: public EFP (double d) {
2826: this.setd (d);
2827: }
2828: public EFP (float f) {
2829: this.setf (f);
2830: }
2831: public EFP (int i) {
2832: this.seti (i);
2833: }
2834: public EFP (long l) {
2835: this.setl (l);
2836: }
2837: public EFP (String s) {
2838: this.parse (s);
2839: }
2840: public EFP (EFP x) {
2841: this.sete (x);
2842: }
2843:
2844:
2845:
2846:
2847:
2848: public EFP (int xf, int xe, long xd, long xc) {
2849: this.flg = xf;
2850: this.epp = xe;
2851: this.dvl = xd;
2852: this.cvl = xc;
2853: }
2854:
2855:
2856:
2857:
2858:
2859:
2860:
2861:
2862:
2863:
2864:
2865: public final EFP inner () {
2866: if (epbRoundingDepth++ == 0) {
2867: epbRoundingOuterPrec = epbRoundingPrec;
2868: epbRoundingPrec = EPB_PREC_EFP;
2869: epbRoundingOuterMode = epbRoundingMode;
2870: epbRoundingMode = EPB_MODE_RN;
2871: }
2872: if (false) {
2873: if (epbRoundingDepth == 10) {
2874: System.out.println ("too many EFP.inner()\n");
2875: }
2876: }
2877: return this;
2878: }
2879:
2880:
2881:
2882:
2883:
2884:
2885:
2886:
2887: public final EFP outer () {
2888: if (--epbRoundingDepth == 0) {
2889: epbRoundingPrec = epbRoundingOuterPrec;
2890: epbRoundingMode = epbRoundingOuterMode;
2891: }
2892: if (false) {
2893: if (epbRoundingDepth == -1) {
2894: System.out.println ("too many EFP.outer()\n");
2895: }
2896: }
2897: return this;
2898: }
2899:
2900:
2901:
2902:
2903:
2904:
2905: public final EFP finish () {
2906: int zf = this.flg;
2907: if (zf << 1 != 0) {
2908: return this;
2909: }
2910: switch (epbRoundingPrec) {
2911: case EPB_PREC_EXD:
2912: return this.roundx (epbRoundingMode);
2913: case EPB_PREC_SGL:
2914: return this.roundf (epbRoundingMode);
2915: case EPB_PREC_DBL:
2916: case EPB_PREC_DBL3:
2917: return this.roundd (epbRoundingMode);
2918: case EPB_PREC_TPL:
2919: return this.roundy (epbRoundingMode);
2920: case EPB_PREC_XSG:
2921: return this.roundg (epbRoundingMode);
2922: case EPB_PREC_EFP:
2923: default:
2924: int ze = this.epp;
2925: long zd = this.dvl;
2926: long zc = this.cvl;
2927: switch (epbRoundingMode) {
2928: case EPB_MODE_RN:
2929: if (zc << 28 != 0L) {
2930: epbFpsr |= EPB_FPSR_X2;
2931: if (zc << 28 < 0L && (zc & 0x00000017ffffffffL) != 0L &&
2932: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
2933: zd = MSB;
2934: ze++;
2935: }
2936: zc &= 0xfffffff000000000L;
2937: }
2938: break;
2939: case EPB_MODE_RZ:
2940: if (zc << 28 != 0L) {
2941: epbFpsr |= EPB_FPSR_X2;
2942: zc &= 0xfffffff000000000L;
2943: }
2944: break;
2945: case EPB_MODE_RM:
2946: if (zc << 28 != 0L) {
2947: epbFpsr |= EPB_FPSR_X2;
2948: if (zf < 0 &&
2949: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
2950: zd = MSB;
2951: ze++;
2952: }
2953: zc &= 0xfffffff000000000L;
2954: }
2955: break;
2956: case EPB_MODE_RP:
2957: default:
2958: if (zc << 28 != 0L) {
2959: epbFpsr |= EPB_FPSR_X2;
2960: if (0 <= zf &&
2961: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
2962: zd = MSB;
2963: ze++;
2964: }
2965: zc &= 0xfffffff000000000L;
2966: }
2967: break;
2968: }
2969: if ((short) ze != ze) {
2970: if (0 <= ze) {
2971: epbFpsr |= EPB_FPSR_OF;
2972: epbExceptionOperandExponent = zf;
2973: epbExceptionOperandMantissa = zd;
2974: return this.sete (OVFL_RESULTS[EPB_PREC_EFP << 3 | EPB_MODE_RP << 1 | zf >>> 31]);
2975: } else {
2976: epbFpsr |= EPB_FPSR_UF;
2977: epbExceptionOperandExponent = zf;
2978: epbExceptionOperandMantissa = zd;
2979: return this.sete (UNFL_RESULTS[EPB_PREC_EFP << 3 | EPB_MODE_RP << 1 | zf >>> 31]);
2980: }
2981: }
2982: this.flg = zf;
2983: this.epp = ze;
2984: this.dvl = zd;
2985: this.cvl = zc;
2986: return this;
2987: }
2988: }
2989: public final EFP finish (int zf, int ze, long zd, long zc, long zb) {
2990: if (zf << 1 != 0) {
2991: this.flg = zf;
2992: return this;
2993: }
2994: switch (epbRoundingPrec) {
2995: case EPB_PREC_EXD:
2996: this.flg = zf;
2997: this.epp = ze;
2998: this.dvl = zd;
2999: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3000: return this.roundx (epbRoundingMode);
3001: case EPB_PREC_SGL:
3002: this.flg = zf;
3003: this.epp = ze;
3004: this.dvl = zd;
3005: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3006: return this.roundf (epbRoundingMode);
3007: case EPB_PREC_DBL:
3008: case EPB_PREC_DBL3:
3009: this.flg = zf;
3010: this.epp = ze;
3011: this.dvl = zd;
3012: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3013: return this.roundd (epbRoundingMode);
3014: case EPB_PREC_TPL:
3015: this.flg = zf;
3016: this.epp = ze;
3017: this.dvl = zd;
3018: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3019: return this.roundy (epbRoundingMode);
3020: case EPB_PREC_XSG:
3021: this.flg = zf;
3022: this.epp = ze;
3023: this.dvl = zd;
3024: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3025: return this.roundg (epbRoundingMode);
3026: case EPB_PREC_EFP:
3027: default:
3028: switch (epbRoundingMode) {
3029: case EPB_MODE_RN:
3030: if ((zc << 28 | zb) != 0L) {
3031: epbFpsr |= EPB_FPSR_X2;
3032: if (zc << 28 < 0L && ((zc & 0x00000017ffffffffL) | zb) != 0L &&
3033: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3034: zd = MSB;
3035: ze++;
3036: }
3037: zc &= 0xfffffff000000000L;
3038: }
3039: break;
3040: case EPB_MODE_RZ:
3041: if ((zc << 28 | zb) != 0L) {
3042: epbFpsr |= EPB_FPSR_X2;
3043: zc &= 0xfffffff000000000L;
3044: }
3045: break;
3046: case EPB_MODE_RM:
3047: if ((zc << 28 | zb) != 0L) {
3048: epbFpsr |= EPB_FPSR_X2;
3049: if (zf < 0 &&
3050: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3051: zd = MSB;
3052: ze++;
3053: }
3054: zc &= 0xfffffff000000000L;
3055: }
3056: break;
3057: case EPB_MODE_RP:
3058: default:
3059: if ((zc << 28 | zb) != 0L) {
3060: epbFpsr |= EPB_FPSR_X2;
3061: if (0 <= zf &&
3062: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3063: zd = MSB;
3064: ze++;
3065: }
3066: zc &= 0xfffffff000000000L;
3067: }
3068: break;
3069: }
3070: if ((short) ze != ze) {
3071: if (0 <= ze) {
3072: epbFpsr |= EPB_FPSR_OF;
3073: epbExceptionOperandExponent = zf;
3074: epbExceptionOperandMantissa = zd;
3075: return this.sete (OVFL_RESULTS[EPB_PREC_EFP << 3 | EPB_MODE_RP << 1 | zf >>> 31]);
3076: } else {
3077: epbFpsr |= EPB_FPSR_UF;
3078: epbExceptionOperandExponent = zf;
3079: epbExceptionOperandMantissa = zd;
3080: return this.sete (UNFL_RESULTS[EPB_PREC_EFP << 3 | EPB_MODE_RP << 1 | zf >>> 31]);
3081: }
3082: }
3083: this.flg = zf;
3084: this.epp = ze;
3085: this.dvl = zd;
3086: this.cvl = zc;
3087: return this;
3088: }
3089: }
3090: public final EFP finish2 (int zf, int ze, long zd, long zc, long zb) {
3091: if (zf << 1 != 0) {
3092: this.flg = zf;
3093: return this;
3094: }
3095: switch (epbRoundingPrec) {
3096: case EPB_PREC_EXD:
3097: this.flg = zf;
3098: this.epp = ze;
3099: this.dvl = zd;
3100: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3101: return this.roundx2 (epbRoundingMode);
3102: case EPB_PREC_SGL:
3103: this.flg = zf;
3104: this.epp = ze;
3105: this.dvl = zd;
3106: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3107: return this.roundf (epbRoundingMode);
3108: case EPB_PREC_DBL:
3109: case EPB_PREC_DBL3:
3110: this.flg = zf;
3111: this.epp = ze;
3112: this.dvl = zd;
3113: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3114: return this.roundd (epbRoundingMode);
3115: case EPB_PREC_TPL:
3116: this.flg = zf;
3117: this.epp = ze;
3118: this.dvl = zd;
3119: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3120: return this.roundy2 (epbRoundingMode);
3121: case EPB_PREC_XSG:
3122: this.flg = zf;
3123: this.epp = ze;
3124: this.dvl = zd;
3125: this.cvl = zc | zb >>> 32 | zb & 0xffffffffL;
3126: return this.roundg (epbRoundingMode);
3127: case EPB_PREC_EFP:
3128: default:
3129: switch (epbRoundingMode) {
3130: case EPB_MODE_RN:
3131: if ((zc << 28 | zb) != 0L) {
3132: epbFpsr |= EPB_FPSR_X2;
3133: if (zc << 28 < 0L && ((zc & 0x00000017ffffffffL) | zb) != 0L &&
3134: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3135: zd = MSB;
3136: ze++;
3137: }
3138: zc &= 0xfffffff000000000L;
3139: }
3140: break;
3141: case EPB_MODE_RZ:
3142: if ((zc << 28 | zb) != 0L) {
3143: epbFpsr |= EPB_FPSR_X2;
3144: zc &= 0xfffffff000000000L;
3145: }
3146: break;
3147: case EPB_MODE_RM:
3148: if ((zc << 28 | zb) != 0L) {
3149: epbFpsr |= EPB_FPSR_X2;
3150: if (zf < 0 &&
3151: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3152: zd = MSB;
3153: ze++;
3154: }
3155: zc &= 0xfffffff000000000L;
3156: }
3157: break;
3158: case EPB_MODE_RP:
3159: default:
3160: if ((zc << 28 | zb) != 0L) {
3161: epbFpsr |= EPB_FPSR_X2;
3162: if (0 <= zf &&
3163: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3164: zd = MSB;
3165: ze++;
3166: }
3167: zc &= 0xfffffff000000000L;
3168: }
3169: break;
3170: }
3171: if ((short) ze != ze) {
3172: if (0 <= ze) {
3173: epbFpsr |= EPB_FPSR_OF;
3174: epbExceptionOperandExponent = zf;
3175: epbExceptionOperandMantissa = zd;
3176: return this.sete (OVFL_RESULTS[EPB_PREC_EFP << 3 | EPB_MODE_RP << 1 | zf >>> 31]);
3177: } else {
3178: epbFpsr |= EPB_FPSR_UF;
3179: epbExceptionOperandExponent = zf;
3180: epbExceptionOperandMantissa = zd;
3181: return this.sete (UNFL_RESULTS[EPB_PREC_EFP << 3 | EPB_MODE_RP << 1 | zf >>> 31]);
3182: }
3183: }
3184: this.flg = zf;
3185: this.epp = ze;
3186: this.dvl = zd;
3187: this.cvl = zc;
3188: return this;
3189: }
3190: }
3191: public final EFP ifinish (int zf, int ze, long zd, long zc, long zb) {
3192: if (zf << 1 == 0 &&
3193: (zc << 28 | zb) != 0L) {
3194: epbFpsr |= EPB_FPSR_X2;
3195: if (zc << 28 < 0L && ((zc & 0x00000017ffffffffL) | zb) != 0L &&
3196: (zc += 1L << 36) >>> 36 == 0L && ++zd == 0L) {
3197: zd = MSB;
3198: ze++;
3199: }
3200: zc &= 0xfffffff000000000L;
3201: }
3202: this.flg = zf;
3203: this.epp = ze;
3204: this.dvl = zd;
3205: this.cvl = zc;
3206: return this;
3207: }
3208:
3209:
3210:
3211:
3212:
3213:
3214:
3215:
3216:
3217:
3218:
3219:
3220:
3221:
3222:
3223:
3224:
3225:
3226:
3227:
3228: public final EFP originLowerLower (EFP x) {
3229: if (x.flg << 1 == 0 && x.epp < -16) {
3230: if (x.flg < 0) {
3231: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3232: if (this.gt (x)) {
3233:
3234: this.sete (x).finish ();
3235: }
3236: }
3237: if (epbRoundingMode == EPB_MODE_RM) {
3238: if (this.ge (x)) {
3239:
3240: this.nextdown (x, epbRoundingPrec);
3241: }
3242: }
3243: } else {
3244: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3245: if (this.gt (x)) {
3246:
3247: this.sete (x).finish ();
3248: }
3249: }
3250: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
3251: if (this.ge (x)) {
3252:
3253: this.nextdown (x, epbRoundingPrec);
3254: }
3255: }
3256: }
3257: }
3258: return this;
3259: }
3260: public final EFP originLowerUpper (EFP x) {
3261: if (x.flg << 1 == 0 && x.epp < -16) {
3262: if (x.flg < 0) {
3263: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3264: if (this.gt (x)) {
3265:
3266: this.sete (x).finish ();
3267: }
3268: }
3269: if (epbRoundingMode == EPB_MODE_RM) {
3270: if (this.ge (x)) {
3271:
3272: this.nextdown (x, epbRoundingPrec);
3273: }
3274: }
3275: } else {
3276: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3277: if (this.lt (x)) {
3278:
3279: this.sete (x).finish ();
3280: }
3281: }
3282: if (epbRoundingMode == EPB_MODE_RP) {
3283: if (this.le (x)) {
3284:
3285: this.nextup (x, epbRoundingPrec);
3286: }
3287: }
3288: }
3289: }
3290: return this;
3291: }
3292: public final EFP originUpperLower (EFP x) {
3293: if (x.flg << 1 == 0 && x.epp < -16) {
3294: if (x.flg < 0) {
3295: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3296: if (this.lt (x)) {
3297:
3298: this.sete (x).finish ();
3299: }
3300: }
3301: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
3302: if (this.le (x)) {
3303:
3304: this.nextup (x, epbRoundingPrec);
3305: }
3306: }
3307: } else {
3308: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3309: if (this.gt (x)) {
3310:
3311: this.sete (x).finish ();
3312: }
3313: }
3314: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
3315: if (this.ge (x)) {
3316:
3317: this.nextdown (x, epbRoundingPrec);
3318: }
3319: }
3320: }
3321: }
3322: return this;
3323: }
3324: public final EFP originUpperUpper (EFP x) {
3325: if (x.flg << 1 == 0 && x.epp < -16) {
3326: if (x.flg < 0) {
3327: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3328: if (this.lt (x)) {
3329:
3330: this.sete (x).finish ();
3331: }
3332: }
3333: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
3334: if (this.le (x)) {
3335:
3336: this.nextup (x, epbRoundingPrec);
3337: }
3338: }
3339: } else {
3340: if (epbRoundingPrec != EPB_PREC_SGL && epbRoundingPrec != EPB_PREC_DBL) {
3341: if (this.lt (x)) {
3342:
3343: this.sete (x).finish ();
3344: }
3345: }
3346: if (epbRoundingMode == EPB_MODE_RP) {
3347: if (this.le (x)) {
3348:
3349: this.nextup (x, epbRoundingPrec);
3350: }
3351: }
3352: }
3353: }
3354: return this;
3355: }
3356:
3357:
3358:
3359: public final EFP correctUnderflow (int savedFpsr) {
3360: if (this.flg << 1 == 0) {
3361: if (this.epp < (epbRoundingPrec == EPB_PREC_SGL ? -126 :
3362: epbRoundingPrec == EPB_PREC_DBL || epbRoundingPrec == EPB_PREC_DBL3 ? -1022 :
3363: -16383)) {
3364: epbFpsr |= EPB_FPSR_UF;
3365: } else {
3366: epbFpsr = epbFpsr & ~EPB_FPSR_UF | savedFpsr & EPB_FPSR_UF;
3367: }
3368: }
3369: return this;
3370: }
3371:
3372:
3373:
3374:
3375:
3376:
3377:
3378:
3379:
3380:
3381:
3382:
3383:
3384:
3385:
3386:
3387:
3388:
3389:
3390:
3391:
3392:
3393:
3394:
3395:
3396:
3397:
3398:
3399:
3400:
3401:
3402:
3403:
3404:
3405:
3406:
3407:
3408:
3409:
3410:
3411:
3412:
3413:
3414:
3415:
3416:
3417:
3418:
3419:
3420:
3421:
3422:
3423:
3424:
3425:
3426:
3427:
3428:
3429:
3430: public final EFP abs () {
3431: return this.finish (this.flg & ~M, this.epp, this.dvl, this.cvl, 0L);
3432: }
3433: public final EFP iabs () {
3434: this.flg &= ~M;
3435: return this;
3436: }
3437: public final EFP abs (EFP x) {
3438: return this.finish (x.flg & ~M, x.epp, x.dvl, x.cvl, 0L);
3439: }
3440: public final EFP iabs (EFP x) {
3441: this.flg = x.flg & ~M;
3442: this.epp = x.epp;
3443: this.dvl = x.dvl;
3444: this.cvl = x.cvl;
3445: return this;
3446: }
3447:
3448:
3449:
3450:
3451:
3452:
3453:
3454:
3455:
3456:
3457:
3458:
3459:
3460:
3461:
3462:
3463:
3464:
3465:
3466:
3467:
3468:
3469:
3470:
3471:
3472:
3473:
3474:
3475:
3476:
3477:
3478:
3479:
3480:
3481:
3482:
3483:
3484:
3485:
3486:
3487:
3488:
3489:
3490:
3491:
3492:
3493:
3494:
3495:
3496:
3497:
3498:
3499:
3500:
3501:
3502:
3503:
3504:
3505:
3506:
3507:
3508:
3509:
3510:
3511:
3512:
3513:
3514:
3515:
3516:
3517:
3518:
3519:
3520:
3521:
3522:
3523:
3524:
3525:
3526:
3527: public final EFP acos () {
3528: return this.acos (this);
3529: }
3530: public final EFP acos (EFP x) {
3531:
3532: int xf = x.flg;
3533: if (xf << 1 != 0) {
3534: if (xf << 1 < 0) {
3535: epbFpsr |= EPB_FPSR_X2;
3536: this.sete (ROUNDED_PI_2[epbRoundingMode]).finish ();
3537: } else if (xf << 2 < 0) {
3538: epbFpsr |= EPB_FPSR_OE;
3539: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
3540: epbExceptionOperandMantissa = 0x0000000000000000L;
3541: this.flg = N;
3542: } else {
3543: this.flg = N;
3544: }
3545: return this;
3546: }
3547:
3548: int xe = x.epp;
3549: if (xe >= 0) {
3550: if (xe == 0 && x.dvl == MSB && x.cvl == 0L) {
3551: if (xf >= 0) {
3552: this.flg = P | Z;
3553: } else {
3554: epbFpsr |= EPB_FPSR_X2;
3555: this.sete (ROUNDED_PI[epbRoundingMode]).finish ();
3556: }
3557: } else {
3558: epbFpsr |= EPB_FPSR_OE;
3559: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
3560: epbExceptionOperandMantissa = x.dvl;
3561: this.flg = N;
3562: }
3563: return this;
3564: }
3565:
3566: if (this == x) {
3567: x = new EFP (x);
3568: }
3569: return this.inner ().negdec (x).imul (new EFP ().inc (x)).sqrt ().outer ().atan2 (x);
3570: }
3571:
3572:
3573:
3574:
3575:
3576:
3577:
3578:
3579:
3580:
3581:
3582:
3583:
3584:
3585:
3586:
3587:
3588:
3589:
3590:
3591:
3592:
3593:
3594:
3595:
3596:
3597:
3598:
3599:
3600:
3601:
3602:
3603:
3604:
3605:
3606:
3607:
3608:
3609:
3610:
3611:
3612:
3613:
3614:
3615:
3616:
3617:
3618:
3619:
3620:
3621:
3622:
3623:
3624:
3625:
3626:
3627:
3628:
3629:
3630:
3631:
3632:
3633:
3634:
3635:
3636:
3637:
3638:
3639: public final EFP acosh () {
3640: return this.acosh (this);
3641: }
3642: public final EFP acosh (EFP x) {
3643: int xf = x.flg;
3644: if (xf != 0) {
3645: if (xf < 0 || xf << 1 < 0) {
3646: epbFpsr |= EPB_FPSR_OE;
3647: if (xf << 1 < 0) {
3648: epbExceptionOperandExponent = xf & M;
3649: epbExceptionOperandMantissa = 0x0000000000000000L;
3650: } else if (xf == (M | I)) {
3651: epbExceptionOperandExponent = M | 0x7fff << 16;
3652: epbExceptionOperandMantissa = 0x0000000000000000L;
3653: } else {
3654: epbExceptionOperandExponent = M | 0x3fff + x.epp << 16;
3655: epbExceptionOperandMantissa = x.dvl;
3656: }
3657: this.flg = N;
3658: } else {
3659: this.flg = xf == (P | I) ? P | I : N;
3660: }
3661: return this;
3662: }
3663:
3664: if (x.epp < 0) {
3665: epbFpsr |= EPB_FPSR_OE;
3666: epbExceptionOperandExponent = 0x3fff + x.epp << 16;
3667: epbExceptionOperandMantissa = x.dvl;
3668: this.flg = N;
3669: return this;
3670: }
3671:
3672: return this.inner ().dec (x).iadd (new EFP ().isqu (this).iadd (new EFP ().imul2 (this)).sqrt ()).outer ().log1p ();
3673: }
3674:
3675:
3676:
3677:
3678:
3679:
3680:
3681:
3682:
3683:
3684:
3685:
3686:
3687:
3688:
3689:
3690:
3691:
3692:
3693:
3694:
3695:
3696:
3697:
3698:
3699:
3700:
3701:
3702:
3703:
3704:
3705:
3706:
3707:
3708:
3709:
3710:
3711:
3712:
3713:
3714:
3715:
3716:
3717:
3718:
3719:
3720:
3721:
3722:
3723:
3724:
3725:
3726:
3727:
3728:
3729:
3730:
3731:
3732:
3733:
3734:
3735:
3736:
3737:
3738:
3739: public final EFP acot () {
3740: return this.acot (this);
3741: }
3742: public final EFP acot (EFP x) {
3743: return this.inner ().rcp (x).outer ().atan ();
3744: }
3745:
3746:
3747:
3748:
3749:
3750:
3751:
3752:
3753:
3754:
3755:
3756:
3757:
3758:
3759:
3760:
3761:
3762:
3763:
3764:
3765:
3766:
3767:
3768:
3769:
3770:
3771:
3772:
3773:
3774:
3775:
3776:
3777:
3778:
3779:
3780:
3781:
3782:
3783:
3784:
3785:
3786:
3787:
3788:
3789:
3790:
3791:
3792:
3793:
3794:
3795:
3796:
3797:
3798:
3799:
3800:
3801:
3802:
3803:
3804:
3805:
3806:
3807:
3808:
3809:
3810:
3811: public final EFP acoth () {
3812: return this.acoth (this);
3813: }
3814: public final EFP acoth (EFP x) {
3815: int xf = x.flg;
3816: if (xf << 1 != 0) {
3817: if (xf << 1 < 0) {
3818: epbFpsr |= EPB_FPSR_OE;
3819: epbExceptionOperandExponent = xf & M;
3820: epbExceptionOperandMantissa = 0x0000000000000000L;
3821: this.flg = N;
3822: } else {
3823: this.flg = xf << 2 < 0 ? xf ^ (Z | I) : N;
3824: }
3825: return this;
3826: }
3827:
3828: if (x.epp < 0) {
3829: epbFpsr |= EPB_FPSR_OE;
3830: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
3831: epbExceptionOperandMantissa = x.dvl;
3832: this.flg = N;
3833: return this;
3834: }
3835: if (x.epp == 0 && x.dvl == MSB && x.cvl == 0L) {
3836: epbFpsr |= EPB_FPSR_DZ;
3837: epbExceptionOperandExponent = xf & M | 0x3fff << 16;
3838: epbExceptionOperandMantissa = 0x8000000000000000L;
3839: this.flg = xf | I;
3840: return this;
3841: }
3842:
3843: return this.inner ().iabs (x).dec ().rcp ().imul2 ().log1p ().idiv2 ().outer ().neg (xf < 0);
3844: }
3845:
3846:
3847:
3848:
3849:
3850:
3851:
3852:
3853:
3854:
3855:
3856:
3857:
3858:
3859:
3860:
3861:
3862:
3863:
3864:
3865:
3866:
3867:
3868:
3869:
3870:
3871:
3872:
3873:
3874:
3875:
3876:
3877:
3878:
3879:
3880:
3881:
3882:
3883:
3884:
3885:
3886:
3887:
3888:
3889:
3890:
3891:
3892:
3893:
3894:
3895:
3896:
3897:
3898:
3899:
3900:
3901:
3902:
3903:
3904:
3905:
3906:
3907:
3908:
3909:
3910:
3911:
3912:
3913:
3914: public final EFP acsc () {
3915: return this.acsc (this);
3916: }
3917: public final EFP acsc (EFP x) {
3918: int xf = x.flg;
3919: if (xf << 1 != 0) {
3920: if (xf << 1 < 0) {
3921: epbFpsr |= EPB_FPSR_OE;
3922: epbExceptionOperandExponent = xf & M;
3923: epbExceptionOperandMantissa = 0x0000000000000000L;
3924: this.flg = N;
3925: } else {
3926: this.flg = xf << 2 < 0 ? xf ^ (Z | I) : N;
3927: }
3928: return this;
3929: }
3930:
3931: if (x.epp < 0) {
3932: epbFpsr |= EPB_FPSR_OE;
3933: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
3934: epbExceptionOperandMantissa = x.dvl;
3935: this.flg = N;
3936: return this;
3937: }
3938: if (x.epp == 0 && x.dvl == MSB && x.cvl == 0L) {
3939: epbFpsr |= EPB_FPSR_X2;
3940: if (xf >= 0) {
3941: this.sete (ROUNDED_PI_2[epbRoundingMode]).finish ();
3942: } else {
3943: this.sete (ROUNDED_NEGPI_2[epbRoundingMode]).finish ();
3944: }
3945: return this;
3946: }
3947:
3948: EFP t = new EFP ().inner ().inc (x);
3949: return this.dec (x).imul (t).sqrt ().rcp ().atan ().outer ().neg (xf < 0);
3950: }
3951:
3952:
3953:
3954:
3955:
3956:
3957:
3958:
3959:
3960:
3961:
3962:
3963:
3964:
3965:
3966:
3967:
3968:
3969:
3970:
3971:
3972:
3973:
3974:
3975:
3976:
3977:
3978:
3979:
3980:
3981:
3982:
3983:
3984:
3985:
3986:
3987:
3988:
3989:
3990:
3991:
3992:
3993:
3994:
3995:
3996:
3997:
3998:
3999:
4000:
4001:
4002:
4003:
4004:
4005:
4006:
4007:
4008:
4009:
4010:
4011:
4012:
4013:
4014:
4015:
4016:
4017:
4018:
4019:
4020:
4021:
4022:
4023:
4024:
4025:
4026:
4027:
4028:
4029:
4030:
4031:
4032:
4033:
4034:
4035:
4036:
4037:
4038:
4039:
4040:
4041:
4042:
4043:
4044:
4045:
4046:
4047:
4048:
4049:
4050: public final EFP acsch () {
4051: return this.acsch (this);
4052: }
4053: public final EFP acsch (EFP x) {
4054: int xf = x.flg;
4055: if (xf << 1 != 0) {
4056: if (xf << 1 < 0) {
4057: epbFpsr |= EPB_FPSR_OE;
4058: epbExceptionOperandExponent = xf & M;
4059: epbExceptionOperandMantissa = 0x0000000000000000L;
4060: this.flg = N;
4061: } else {
4062: this.flg = xf << 2 < 0 ? xf ^ (Z | I) : N;
4063: }
4064: return this;
4065: }
4066:
4067: x = new EFP ().inner ().rcp (x);
4068: if (x.epp < -1) {
4069: EFP x2 = new EFP ().isqu (x);
4070: return this.imul (ASINH_C43, x2)
4071: .iadd (ASINH_C41).imul (x2)
4072: .iadd (ASINH_C39).imul (x2)
4073: .iadd (ASINH_C37).imul (x2)
4074: .iadd (ASINH_C35).imul (x2)
4075: .iadd (ASINH_C33).imul (x2)
4076: .iadd (ASINH_C31).imul (x2)
4077: .iadd (ASINH_C29).imul (x2)
4078: .iadd (ASINH_C27).imul (x2)
4079: .iadd (ASINH_C25).imul (x2)
4080: .iadd (ASINH_C23).imul (x2)
4081: .iadd (ASINH_C21).imul (x2)
4082: .iadd (ASINH_C19).imul (x2)
4083: .iadd (ASINH_C17).imul (x2)
4084: .iadd (ASINH_C15).imul (x2)
4085: .iadd (ASINH_C13).imul (x2)
4086: .iadd (ASINH_C11).imul (x2)
4087: .iadd (ASINH_C9).imul (x2)
4088: .iadd (ASINH_C7).imul (x2)
4089: .iadd (ASINH_C5).imul (x2)
4090: .iadd (ASINH_C3).imul (x2)
4091: .iadd (ASINH_C1).outer ().mul (x);
4092: }
4093:
4094: return this.iabs (x).iadd (new EFP ().isqu (this).inc ().sqrt ()).log ().outer ().neg (xf < 0);
4095: }
4096:
4097:
4098:
4099:
4100:
4101:
4102:
4103:
4104:
4105:
4106:
4107:
4108: public final EFP add (EFP y) {
4109: int xf = this.flg;
4110: int xe = this.epp;
4111: long xd = this.dvl;
4112: long xc = this.cvl;
4113: long xb = 0L;
4114: int yf = y.flg;
4115: if ((xf | yf) << 1 != 0) {
4116: if ((xf | yf) << 3 < 0) {
4117: this.flg = N;
4118: return this;
4119: }
4120: if ((xf & yf) << 2 < 0 && xf != yf) {
4121: epbFpsr |= EPB_FPSR_OE;
4122: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
4123: epbExceptionOperandMantissa = 0x0000000000000000L;
4124: this.flg = N;
4125: return this;
4126: }
4127: if ((xf & yf) << 1 < 0 && xf != yf) {
4128: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4129: return this;
4130: }
4131: if (xf << 1 < 0 || yf << 2 < 0) {
4132: xf = yf;
4133: xe = y.epp;
4134: xd = y.dvl;
4135: xc = y.cvl;
4136: }
4137:
4138: } else {
4139:
4140: long yd = y.dvl;
4141: long yc = y.cvl;
4142: int o = xe - y.epp;
4143: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
4144:
4145: xf = yf;
4146: xe += o = -o;
4147: xd = yd;
4148: xc = yc;
4149: yf = this.flg;
4150: yd = this.dvl;
4151: yc = this.cvl;
4152: }
4153:
4154:
4155: if (0 < o) {
4156: if (o <= 63) {
4157: xb = yc << -o;
4158: yc = yd << -o | yc >>> o;
4159: yd >>>= o;
4160: } else if (o == 64) {
4161: xb = yc;
4162: yc = yd;
4163: yd = 0L;
4164: } else if (o <= 127) {
4165: xb = yd << -o | yc;
4166: yc = yd >>> o;
4167: yd = 0L;
4168: } else {
4169: xb = yd | yc;
4170: yc = 0L;
4171: yd = 0L;
4172: }
4173: }
4174:
4175: if (xf == yf) {
4176:
4177: xb |= yc << 62;
4178:
4179: xc = xd << 63 | xc >>> 1;
4180: xd >>>= 1;
4181: yc = yd << 63 | yc >>> 1;
4182: yd >>>= 1;
4183:
4184: yc >>>= 1;
4185: xc >>>= 1;
4186:
4187: xc += yc;
4188: xd += yd + (xc >>> 63);
4189:
4190: xc <<= 1;
4191:
4192: if (xd < 0L) {
4193: xe++;
4194: } else {
4195: xd = xd << 1 | xc >>> 63;
4196: xc <<= 1;
4197: }
4198: } else {
4199:
4200: xb |= yc << 63;
4201:
4202: yc >>>= 1;
4203: xc >>>= 1;
4204:
4205:
4206: if (xb != 0L) {
4207: xc--;
4208: }
4209: xc -= yc;
4210: xd -= yd + (xc >>> 63);
4211:
4212: xc <<= 1;
4213:
4214: if (0L <= xd) {
4215: if (xd != 0L) {
4216: xe -= o = Long.numberOfLeadingZeros (xd);
4217: xd = xd << o | xc >>> -o;
4218: xc <<= o;
4219: } else if (xc != 0L) {
4220: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
4221: xd = xc << o;
4222: xc = 0L;
4223: } else {
4224: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4225: }
4226: }
4227: }
4228: }
4229: return this.finish (xf, xe, xd, xc, xb);
4230: }
4231: public final EFP iadd (EFP y) {
4232: int xf = this.flg;
4233: int xe = this.epp;
4234: long xd = this.dvl;
4235: long xc = this.cvl;
4236: long xb = 0L;
4237: int yf = y.flg;
4238: if ((xf | yf) << 1 != 0) {
4239: if ((xf | yf) << 3 < 0) {
4240: this.flg = N;
4241: return this;
4242: }
4243: if ((xf & yf) << 2 < 0 && xf != yf) {
4244: epbFpsr |= EPB_FPSR_OE;
4245: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
4246: epbExceptionOperandMantissa = 0x0000000000000000L;
4247: this.flg = N;
4248: return this;
4249: }
4250: if ((xf & yf) << 1 < 0 && xf != yf) {
4251: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4252: return this;
4253: }
4254: if (xf << 1 < 0 || yf << 2 < 0) {
4255: xf = yf;
4256: xe = y.epp;
4257: xd = y.dvl;
4258: xc = y.cvl;
4259: }
4260:
4261: } else {
4262:
4263: long yd = y.dvl;
4264: long yc = y.cvl;
4265: int o = xe - y.epp;
4266: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
4267:
4268: xf = yf;
4269: xe += o = -o;
4270: xd = yd;
4271: xc = yc;
4272: yf = this.flg;
4273: yd = this.dvl;
4274: yc = this.cvl;
4275: }
4276:
4277:
4278: if (0 < o) {
4279: if (o <= 63) {
4280: xb = yc << -o;
4281: yc = yd << -o | yc >>> o;
4282: yd >>>= o;
4283: } else if (o == 64) {
4284: xb = yc;
4285: yc = yd;
4286: yd = 0L;
4287: } else if (o <= 127) {
4288: xb = yd << -o | yc;
4289: yc = yd >>> o;
4290: yd = 0L;
4291: } else {
4292: xb = yd | yc;
4293: yc = 0L;
4294: yd = 0L;
4295: }
4296: }
4297:
4298: if (xf == yf) {
4299:
4300: xb |= yc << 62;
4301:
4302: xc = xd << 63 | xc >>> 1;
4303: xd >>>= 1;
4304: yc = yd << 63 | yc >>> 1;
4305: yd >>>= 1;
4306:
4307: yc >>>= 1;
4308: xc >>>= 1;
4309:
4310: xc += yc;
4311: xd += yd + (xc >>> 63);
4312:
4313: xc <<= 1;
4314:
4315: if (xd < 0L) {
4316: xe++;
4317: } else {
4318: xd = xd << 1 | xc >>> 63;
4319: xc <<= 1;
4320: }
4321: } else {
4322:
4323: xb |= yc << 63;
4324:
4325: yc >>>= 1;
4326: xc >>>= 1;
4327:
4328:
4329: if (xb != 0L) {
4330: xc--;
4331: }
4332: xc -= yc;
4333: xd -= yd + (xc >>> 63);
4334:
4335: xc <<= 1;
4336:
4337: if (0L <= xd) {
4338: if (xd != 0L) {
4339: xe -= o = Long.numberOfLeadingZeros (xd);
4340: xd = xd << o | xc >>> -o;
4341: xc <<= o;
4342: } else if (xc != 0L) {
4343: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
4344: xd = xc << o;
4345: xc = 0L;
4346: } else {
4347: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4348: }
4349: }
4350: }
4351: }
4352: return this.ifinish (xf, xe, xd, xc, xb);
4353: }
4354: public final EFP add (EFP x, EFP y) {
4355: int xf = x.flg;
4356: int xe = x.epp;
4357: long xd = x.dvl;
4358: long xc = x.cvl;
4359: long xb = 0L;
4360: int yf = y.flg;
4361: if ((xf | yf) << 1 != 0) {
4362: if ((xf | yf) << 3 < 0) {
4363: this.flg = N;
4364: return this;
4365: }
4366: if ((xf & yf) << 2 < 0 && xf != yf) {
4367: epbFpsr |= EPB_FPSR_OE;
4368: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
4369: epbExceptionOperandMantissa = 0x0000000000000000L;
4370: this.flg = N;
4371: return this;
4372: }
4373: if ((xf & yf) << 1 < 0 && xf != yf) {
4374: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4375: return this;
4376: }
4377: if (xf << 1 < 0 || yf << 2 < 0) {
4378: xf = yf;
4379: xe = y.epp;
4380: xd = y.dvl;
4381: xc = y.cvl;
4382: }
4383:
4384: } else {
4385:
4386: long yd = y.dvl;
4387: long yc = y.cvl;
4388: int o = xe - y.epp;
4389: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
4390:
4391: xf = yf;
4392: xe += o = -o;
4393: xd = yd;
4394: xc = yc;
4395: yf = x.flg;
4396: yd = x.dvl;
4397: yc = x.cvl;
4398: }
4399:
4400:
4401: if (0 < o) {
4402: if (o <= 63) {
4403: xb = yc << -o;
4404: yc = yd << -o | yc >>> o;
4405: yd >>>= o;
4406: } else if (o == 64) {
4407: xb = yc;
4408: yc = yd;
4409: yd = 0L;
4410: } else if (o <= 127) {
4411: xb = yd << -o | yc;
4412: yc = yd >>> o;
4413: yd = 0L;
4414: } else {
4415: xb = yd | yc;
4416: yc = 0L;
4417: yd = 0L;
4418: }
4419: }
4420:
4421: if (xf == yf) {
4422:
4423: xb |= yc << 62;
4424:
4425: xc = xd << 63 | xc >>> 1;
4426: xd >>>= 1;
4427: yc = yd << 63 | yc >>> 1;
4428: yd >>>= 1;
4429:
4430: yc >>>= 1;
4431: xc >>>= 1;
4432:
4433: xc += yc;
4434: xd += yd + (xc >>> 63);
4435:
4436: xc <<= 1;
4437:
4438: if (xd < 0L) {
4439: xe++;
4440: } else {
4441: xd = xd << 1 | xc >>> 63;
4442: xc <<= 1;
4443: }
4444: } else {
4445:
4446: xb |= yc << 63;
4447:
4448: yc >>>= 1;
4449: xc >>>= 1;
4450:
4451:
4452: if (xb != 0L) {
4453: xc--;
4454: }
4455: xc -= yc;
4456: xd -= yd + (xc >>> 63);
4457:
4458: xc <<= 1;
4459:
4460: if (0L <= xd) {
4461: if (xd != 0L) {
4462: xe -= o = Long.numberOfLeadingZeros (xd);
4463: xd = xd << o | xc >>> -o;
4464: xc <<= o;
4465: } else if (xc != 0L) {
4466: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
4467: xd = xc << o;
4468: xc = 0L;
4469: } else {
4470: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4471: }
4472: }
4473: }
4474: }
4475: return this.finish (xf, xe, xd, xc, xb);
4476: }
4477: public final EFP iadd (EFP x, EFP y) {
4478: int xf = x.flg;
4479: int xe = x.epp;
4480: long xd = x.dvl;
4481: long xc = x.cvl;
4482: long xb = 0L;
4483: int yf = y.flg;
4484: if ((xf | yf) << 1 != 0) {
4485: if ((xf | yf) << 3 < 0) {
4486: this.flg = N;
4487: return this;
4488: }
4489: if ((xf & yf) << 2 < 0 && xf != yf) {
4490: epbFpsr |= EPB_FPSR_OE;
4491: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
4492: epbExceptionOperandMantissa = 0x0000000000000000L;
4493: this.flg = N;
4494: return this;
4495: }
4496: if ((xf & yf) << 1 < 0 && xf != yf) {
4497: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4498: return this;
4499: }
4500: if (xf << 1 < 0 || yf << 2 < 0) {
4501: xf = yf;
4502: xe = y.epp;
4503: xd = y.dvl;
4504: xc = y.cvl;
4505: }
4506:
4507: } else {
4508:
4509: long yd = y.dvl;
4510: long yc = y.cvl;
4511: int o = xe - y.epp;
4512: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
4513:
4514: xf = yf;
4515: xe += o = -o;
4516: xd = yd;
4517: xc = yc;
4518: yf = x.flg;
4519: yd = x.dvl;
4520: yc = x.cvl;
4521: }
4522:
4523:
4524: if (0 < o) {
4525: if (o <= 63) {
4526: xb = yc << -o;
4527: yc = yd << -o | yc >>> o;
4528: yd >>>= o;
4529: } else if (o == 64) {
4530: xb = yc;
4531: yc = yd;
4532: yd = 0L;
4533: } else if (o <= 127) {
4534: xb = yd << -o | yc;
4535: yc = yd >>> o;
4536: yd = 0L;
4537: } else {
4538: xb = yd | yc;
4539: yc = 0L;
4540: yd = 0L;
4541: }
4542: }
4543:
4544: if (xf == yf) {
4545:
4546: xb |= yc << 62;
4547:
4548: xc = xd << 63 | xc >>> 1;
4549: xd >>>= 1;
4550: yc = yd << 63 | yc >>> 1;
4551: yd >>>= 1;
4552:
4553: yc >>>= 1;
4554: xc >>>= 1;
4555:
4556: xc += yc;
4557: xd += yd + (xc >>> 63);
4558:
4559: xc <<= 1;
4560:
4561: if (xd < 0L) {
4562: xe++;
4563: } else {
4564: xd = xd << 1 | xc >>> 63;
4565: xc <<= 1;
4566: }
4567: } else {
4568:
4569: xb |= yc << 63;
4570:
4571: yc >>>= 1;
4572: xc >>>= 1;
4573:
4574:
4575: if (xb != 0L) {
4576: xc--;
4577: }
4578: xc -= yc;
4579: xd -= yd + (xc >>> 63);
4580:
4581: xc <<= 1;
4582:
4583: if (0L <= xd) {
4584: if (xd != 0L) {
4585: xe -= o = Long.numberOfLeadingZeros (xd);
4586: xd = xd << o | xc >>> -o;
4587: xc <<= o;
4588: } else if (xc != 0L) {
4589: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
4590: xd = xc << o;
4591: xc = 0L;
4592: } else {
4593: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
4594: }
4595: }
4596: }
4597: }
4598: return this.ifinish (xf, xe, xd, xc, xb);
4599: }
4600:
4601:
4602:
4603:
4604:
4605:
4606:
4607:
4608:
4609:
4610:
4611:
4612:
4613:
4614:
4615:
4616:
4617:
4618:
4619:
4620:
4621:
4622:
4623:
4624:
4625:
4626:
4627:
4628:
4629:
4630:
4631:
4632:
4633:
4634:
4635:
4636:
4637:
4638:
4639:
4640:
4641:
4642:
4643:
4644:
4645:
4646:
4647:
4648:
4649:
4650:
4651:
4652:
4653:
4654:
4655:
4656:
4657:
4658:
4659:
4660:
4661:
4662: public final EFP agi (EFP be) {
4663: return this.agi (this, be);
4664: }
4665: public final EFP agi (EFP ae, EFP be) {
4666: return this.agm (ae, be).rcpdiv (PI_2);
4667: }
4668:
4669:
4670:
4671:
4672:
4673:
4674:
4675:
4676:
4677:
4678:
4679:
4680:
4681:
4682:
4683:
4684:
4685:
4686:
4687:
4688:
4689:
4690:
4691:
4692:
4693:
4694:
4695:
4696:
4697:
4698:
4699:
4700:
4701:
4702:
4703:
4704:
4705:
4706:
4707:
4708:
4709:
4710:
4711:
4712:
4713:
4714:
4715:
4716:
4717:
4718:
4719:
4720:
4721:
4722:
4723:
4724:
4725:
4726:
4727:
4728:
4729:
4730:
4731:
4732:
4733: public final EFP agm (EFP be) {
4734: return this.agm (this, be);
4735: }
4736: public final EFP agm (EFP ae, EFP be) {
4737: int af = ae.flg;
4738: int bf = be.flg;
4739: if ((af | bf) != 0) {
4740: this.flg = ((af | bf) << 3 < 0 ||
4741: ((af | bf) & (Z | I)) == (Z | I) ? N :
4742: (af | bf) << 1 < 0 ? P | Z :
4743: (af | bf) < 0 ? N :
4744: P | I);
4745: return this;
4746: }
4747:
4748: EFP t = new EFP ();
4749: EFP u = new EFP ();
4750: EFP v = new EFP ();
4751: if (ae.ge (be)) {
4752:
4753: u.flg = ae.flg;
4754: u.epp = ae.epp;
4755: u.dvl = ae.dvl;
4756: u.cvl = ae.cvl;
4757:
4758: v.flg = be.flg;
4759: v.epp = be.epp;
4760: v.dvl = be.dvl;
4761: v.cvl = be.cvl;
4762: } else {
4763:
4764: u.flg = be.flg;
4765: u.epp = be.epp;
4766: u.dvl = be.dvl;
4767: u.cvl = be.cvl;
4768:
4769: v.flg = ae.flg;
4770: v.epp = ae.epp;
4771: v.dvl = ae.dvl;
4772: v.cvl = ae.cvl;
4773: }
4774:
4775:
4776: this.inner ();
4777: for (;;) {
4778:
4779: t.iadd (u, v).idiv2 ();
4780: if (t.ge (u)) {
4781: return this.outer ().sete (u).finish ();
4782: }
4783: v.imul (u).sqrt ();
4784:
4785: u.iadd (t, v).idiv2 ();
4786: if (u.ge (t)) {
4787: return this.outer ().sete (t).finish ();
4788: }
4789: v.imul (t).sqrt ();
4790: }
4791: }
4792:
4793:
4794:
4795:
4796:
4797:
4798:
4799:
4800:
4801:
4802:
4803:
4804:
4805:
4806:
4807:
4808:
4809:
4810:
4811:
4812:
4813:
4814:
4815:
4816:
4817:
4818:
4819:
4820:
4821:
4822:
4823:
4824:
4825:
4826:
4827:
4828:
4829:
4830:
4831:
4832:
4833:
4834:
4835:
4836:
4837:
4838:
4839:
4840:
4841:
4842:
4843:
4844:
4845:
4846:
4847:
4848:
4849:
4850:
4851:
4852:
4853:
4854:
4855:
4856: public final EFP asec () {
4857: return this.asec (this);
4858: }
4859: public final EFP asec (EFP x) {
4860: int xf = x.flg;
4861: if (x.cmp1abs () < 0) {
4862: epbFpsr |= EPB_FPSR_OE;
4863: if (xf << 1 < 0) {
4864: epbExceptionOperandExponent = xf & M;
4865: epbExceptionOperandMantissa = 0x0000000000000000L;
4866: } else {
4867: epbExceptionOperandExponent = xf & M | 0x3fff + x.epp << 16;
4868: epbExceptionOperandMantissa = x.dvl;
4869: }
4870: this.flg = N;
4871: return this;
4872: }
4873: EFP t = new EFP ().inner ().dec (x);
4874: this.inc (x).imul (t).sqrt ();
4875: return (xf < 0 ?
4876: this.atan ().negsub (PI).outer ().add (PIA) :
4877: this.outer ().atan ());
4878: }
4879:
4880:
4881:
4882:
4883:
4884:
4885:
4886:
4887:
4888:
4889:
4890:
4891:
4892:
4893:
4894:
4895:
4896:
4897:
4898:
4899:
4900:
4901:
4902:
4903:
4904:
4905:
4906:
4907:
4908:
4909:
4910:
4911:
4912:
4913:
4914:
4915:
4916:
4917:
4918:
4919:
4920:
4921:
4922:
4923:
4924:
4925:
4926:
4927:
4928:
4929:
4930:
4931:
4932:
4933:
4934:
4935:
4936:
4937:
4938:
4939:
4940:
4941:
4942:
4943:
4944:
4945:
4946:
4947: public final EFP asech () {
4948: return this.asech (this);
4949: }
4950: public final EFP asech (EFP x) {
4951:
4952: int xf = x.flg;
4953: if (xf != 0) {
4954: if (xf < 0 || xf << 2 < 0) {
4955: epbFpsr |= EPB_FPSR_OE;
4956: if (xf == (M | Z)) {
4957: epbExceptionOperandExponent = M;
4958: epbExceptionOperandMantissa = 0x0000000000000000L;
4959: } else if (xf << 2 < 0) {
4960: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
4961: epbExceptionOperandMantissa = 0x0000000000000000L;
4962: } else {
4963: epbExceptionOperandExponent = M | 0x3fff + x.epp << 16;
4964: epbExceptionOperandMantissa = x.dvl;
4965: }
4966: this.flg = N;
4967: } else {
4968: this.flg = xf << 1 < 0 ? P | I : N;
4969: }
4970: return this;
4971: }
4972:
4973: if (0 <= x.epp) {
4974: if (x.epp == 0 && x.dvl == MSB && x.cvl == 0L) {
4975: this.flg = P | Z;
4976: } else {
4977: epbFpsr |= EPB_FPSR_OE;
4978: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
4979: epbExceptionOperandMantissa = x.dvl;
4980: this.flg = N;
4981: }
4982: return this;
4983: }
4984:
4985: EFP t = new EFP ().inner ().negdec (x).div (x);
4986: return this.iadd (t, new EFP ().isqu (t).iadd (new EFP ().imul2 (t)).sqrt ()).outer ().log1p ();
4987: }
4988:
4989:
4990:
4991:
4992:
4993:
4994:
4995:
4996:
4997:
4998:
4999:
5000:
5001:
5002:
5003:
5004:
5005:
5006:
5007:
5008:
5009:
5010:
5011:
5012:
5013:
5014:
5015:
5016:
5017:
5018:
5019:
5020:
5021:
5022:
5023:
5024:
5025:
5026:
5027:
5028:
5029:
5030:
5031:
5032:
5033:
5034:
5035:
5036:
5037:
5038:
5039:
5040:
5041:
5042:
5043:
5044:
5045:
5046:
5047:
5048:
5049:
5050:
5051:
5052:
5053:
5054:
5055:
5056:
5057:
5058:
5059:
5060:
5061:
5062:
5063:
5064:
5065:
5066:
5067:
5068:
5069:
5070:
5071:
5072:
5073:
5074:
5075:
5076:
5077:
5078:
5079:
5080:
5081:
5082:
5083:
5084:
5085:
5086:
5087:
5088:
5089: public final EFP asin () {
5090: return this.asin (this);
5091: }
5092: public final EFP asin (EFP x) {
5093: int xf = x.flg;
5094: if (xf << 1 != 0) {
5095: if (xf << 2 < 0) {
5096: epbFpsr |= EPB_FPSR_OE;
5097: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
5098: epbExceptionOperandMantissa = 0x0000000000000000L;
5099: this.flg = N;
5100: } else {
5101: this.flg = xf;
5102: }
5103: return this;
5104: }
5105:
5106: int xe = x.epp;
5107: if (0 <= xe) {
5108: if (xe == 0 && x.dvl == MSB && x.cvl == 0L) {
5109: epbFpsr |= EPB_FPSR_X2;
5110: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
5111: epbExceptionOperandMantissa = x.dvl;
5112: if (0 <= xf) {
5113: this.sete (ROUNDED_PI_2[epbRoundingMode]).finish ();
5114: } else {
5115: this.sete (ROUNDED_NEGPI_2[epbRoundingMode]).finish ();
5116: }
5117: } else {
5118: epbFpsr |= EPB_FPSR_OE;
5119: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
5120: epbExceptionOperandMantissa = x.dvl;
5121: this.flg = N;
5122: }
5123: return this;
5124: }
5125:
5126: epbFpsr |= EPB_FPSR_X2;
5127: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
5128: epbExceptionOperandMantissa = x.dvl;
5129: if (x.epp < -4) {
5130:
5131:
5132: int savedFpsr = epbFpsr;
5133: this.inner ();
5134: if (this == x) {
5135: x = new EFP (x);
5136: }
5137: EFP x2 = new EFP ().isqu (x);
5138: this.imul (ASIN_C17, x2)
5139: .iadd (ASIN_C15).imul (x2)
5140: .iadd (ASIN_C13).imul (x2)
5141: .iadd (ASIN_C11).imul (x2)
5142: .iadd (ASIN_C9).imul (x2)
5143: .iadd (ASIN_C7).imul (x2)
5144: .iadd (ASIN_C5).imul (x2)
5145: .iadd (ASIN_C3).imul (x2)
5146: .iadd (ASIN_C1).outer ().mul (x);
5147: return this.originLowerUpper (x).correctUnderflow (savedFpsr);
5148: }
5149:
5150: this.inner ();
5151: EFP t = new EFP ().negdec (x).imul (new EFP ().inc (x)).sqrt ();
5152: return this.outer ().atan2 (x, t);
5153: }
5154:
5155:
5156:
5157:
5158:
5159:
5160:
5161:
5162:
5163:
5164:
5165:
5166:
5167:
5168:
5169:
5170:
5171:
5172:
5173:
5174:
5175:
5176:
5177:
5178:
5179:
5180:
5181:
5182:
5183:
5184:
5185:
5186:
5187:
5188:
5189:
5190:
5191:
5192:
5193:
5194:
5195:
5196:
5197:
5198:
5199:
5200:
5201:
5202:
5203:
5204:
5205:
5206:
5207:
5208:
5209:
5210:
5211:
5212:
5213:
5214:
5215:
5216:
5217:
5218:
5219:
5220:
5221:
5222:
5223:
5224:
5225:
5226:
5227:
5228:
5229:
5230:
5231:
5232:
5233:
5234:
5235:
5236: public final EFP asinh () {
5237: return this.asinh (this);
5238: }
5239: public final EFP asinh (EFP x) {
5240: int xf = x.flg;
5241: if (xf << 1 != 0) {
5242: this.flg = xf;
5243: return this;
5244: }
5245:
5246: if (x.epp < -1) {
5247: int savedFpsr = epbFpsr;
5248: this.inner ();
5249: if (this == x) {
5250: x = new EFP (x);
5251: }
5252: EFP x2 = new EFP ().isqu (x);
5253: this.imul (ASINH_C43, x2)
5254: .iadd (ASINH_C41).imul (x2)
5255: .iadd (ASINH_C39).imul (x2)
5256: .iadd (ASINH_C37).imul (x2)
5257: .iadd (ASINH_C35).imul (x2)
5258: .iadd (ASINH_C33).imul (x2)
5259: .iadd (ASINH_C31).imul (x2)
5260: .iadd (ASINH_C29).imul (x2)
5261: .iadd (ASINH_C27).imul (x2)
5262: .iadd (ASINH_C25).imul (x2)
5263: .iadd (ASINH_C23).imul (x2)
5264: .iadd (ASINH_C21).imul (x2)
5265: .iadd (ASINH_C19).imul (x2)
5266: .iadd (ASINH_C17).imul (x2)
5267: .iadd (ASINH_C15).imul (x2)
5268: .iadd (ASINH_C13).imul (x2)
5269: .iadd (ASINH_C11).imul (x2)
5270: .iadd (ASINH_C9).imul (x2)
5271: .iadd (ASINH_C7).imul (x2)
5272: .iadd (ASINH_C5).imul (x2)
5273: .iadd (ASINH_C3).imul (x2)
5274: .iadd (ASINH_C1).outer ().mul (x);
5275: return this.originUpperLower (x).correctUnderflow (savedFpsr);
5276: }
5277:
5278: EFP t = new EFP ().inner ().iabs (x);
5279: return this.isqu (t).inc ().sqrt ().iadd (t).log ().outer ().neg (xf < 0);
5280: }
5281:
5282:
5283:
5284:
5285:
5286:
5287:
5288:
5289:
5290:
5291:
5292:
5293:
5294:
5295:
5296:
5297:
5298:
5299:
5300:
5301:
5302:
5303:
5304:
5305:
5306:
5307:
5308:
5309:
5310:
5311:
5312:
5313:
5314:
5315:
5316:
5317:
5318:
5319:
5320:
5321:
5322:
5323:
5324:
5325:
5326:
5327:
5328:
5329:
5330:
5331:
5332:
5333:
5334:
5335:
5336:
5337:
5338:
5339:
5340:
5341:
5342:
5343:
5344:
5345:
5346:
5347:
5348:
5349:
5350:
5351:
5352:
5353:
5354:
5355:
5356:
5357:
5358:
5359:
5360:
5361:
5362:
5363:
5364:
5365:
5366:
5367:
5368:
5369:
5370:
5371:
5372:
5373:
5374:
5375:
5376:
5377:
5378:
5379:
5380:
5381:
5382:
5383:
5384:
5385:
5386:
5387:
5388:
5389:
5390:
5391:
5392:
5393:
5394:
5395:
5396:
5397:
5398:
5399:
5400:
5401:
5402:
5403:
5404:
5405:
5406:
5407:
5408:
5409:
5410:
5411:
5412:
5413:
5414:
5415:
5416:
5417:
5418:
5419:
5420:
5421:
5422:
5423:
5424:
5425:
5426:
5427:
5428:
5429:
5430:
5431:
5432:
5433:
5434:
5435:
5436:
5437:
5438:
5439:
5440:
5441:
5442:
5443:
5444:
5445:
5446:
5447:
5448:
5449:
5450:
5451:
5452:
5453:
5454:
5455:
5456:
5457:
5458:
5459:
5460:
5461:
5462:
5463:
5464:
5465:
5466:
5467:
5468:
5469:
5470:
5471:
5472:
5473:
5474:
5475:
5476:
5477:
5478:
5479:
5480:
5481:
5482:
5483:
5484:
5485:
5486:
5487:
5488:
5489:
5490:
5491:
5492:
5493:
5494:
5495:
5496:
5497:
5498:
5499:
5500:
5501:
5502:
5503:
5504:
5505:
5506:
5507:
5508:
5509:
5510:
5511:
5512:
5513:
5514:
5515:
5516:
5517:
5518:
5519:
5520:
5521:
5522:
5523:
5524:
5525:
5526:
5527:
5528:
5529:
5530:
5531:
5532:
5533:
5534:
5535:
5536:
5537:
5538:
5539:
5540:
5541:
5542:
5543:
5544:
5545:
5546:
5547:
5548:
5549:
5550:
5551:
5552:
5553:
5554:
5555:
5556:
5557:
5558:
5559:
5560:
5561:
5562:
5563:
5564:
5565:
5566:
5567:
5568:
5569:
5570:
5571:
5572:
5573:
5574:
5575:
5576:
5577:
5578:
5579:
5580:
5581:
5582:
5583:
5584:
5585:
5586:
5587:
5588:
5589:
5590:
5591:
5592:
5593:
5594:
5595:
5596:
5597:
5598:
5599:
5600:
5601:
5602:
5603:
5604:
5605:
5606:
5607:
5608:
5609:
5610:
5611:
5612:
5613:
5614:
5615:
5616:
5617:
5618:
5619:
5620:
5621:
5622:
5623:
5624:
5625:
5626:
5627:
5628:
5629:
5630:
5631:
5632:
5633:
5634:
5635:
5636:
5637:
5638:
5639:
5640:
5641:
5642:
5643:
5644:
5645:
5646:
5647:
5648:
5649:
5650:
5651:
5652:
5653:
5654:
5655:
5656:
5657:
5658:
5659:
5660:
5661:
5662:
5663:
5664:
5665:
5666:
5667:
5668:
5669:
5670:
5671:
5672:
5673:
5674:
5675:
5676:
5677:
5678:
5679:
5680:
5681:
5682:
5683:
5684:
5685:
5686:
5687:
5688:
5689:
5690:
5691:
5692:
5693:
5694:
5695:
5696:
5697:
5698:
5699:
5700:
5701:
5702:
5703:
5704:
5705:
5706:
5707:
5708:
5709:
5710:
5711:
5712:
5713:
5714:
5715:
5716:
5717:
5718:
5719:
5720: public final EFP atan () {
5721: return this.atan (this);
5722: }
5723: public final EFP atan (EFP x) {
5724: int xf = x.flg;
5725: if (xf << 1 != 0) {
5726: if (xf << 2 >= 0) {
5727: this.flg = xf;
5728: } else {
5729: epbFpsr |= EPB_FPSR_X2;
5730: if (xf >= 0) {
5731: this.sete (ROUNDED_PI_2[epbRoundingMode]).finish ();
5732: } else {
5733: this.sete (ROUNDED_NEGPI_2[epbRoundingMode]).finish ();
5734: }
5735: }
5736: return this;
5737: }
5738:
5739: int xe = x.epp;
5740: if (xe <= -LEN / 2) {
5741: epbFpsr |= EPB_FPSR_X2;
5742: int savedFpsr = epbFpsr;
5743:
5744: this.flg = xf;
5745: this.epp = xe;
5746: this.dvl = x.dvl;
5747: this.cvl = x.cvl;
5748: if (this.flg < 0) {
5749: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
5750: this.nextup (epbRoundingPrec);
5751: }
5752: } else {
5753: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
5754: this.nextdown (epbRoundingPrec);
5755: }
5756: }
5757: return this.finish ().correctUnderflow (savedFpsr);
5758: }
5759: if (LEN + 1 <= xe) {
5760: epbFpsr |= EPB_FPSR_X2;
5761: return this.sete (ROUNDED_PI_2[epbRoundingMode]).neg (xf < 0);
5762: }
5763: if (false) {
5764: this.inner ();
5765: EFP u = new EFP ().iabs (x);
5766: EFP b;
5767: EFP bw;
5768: EFP t = new EFP ();
5769: if (u.le (DECSQRT2)) {
5770: b = null;
5771: bw = null;
5772: } else if (u.lt (INCSQRT2)) {
5773:
5774:
5775: u.div (t.negdec (u), u.inc ());
5776: b = PI_4;
5777: bw = PI_4A;
5778: } else {
5779: u.rcp ();
5780: b = PI_2;
5781: bw = PI_2A;
5782: }
5783: if (false) {
5784: EFP x2 = new EFP (u).isqu ();
5785:
5786: this.flg = P | Z;
5787: for (int k = 0; ; k++) {
5788: t.divi (u, 2 * k + 1);
5789: if ((k & 1) == 0) {
5790: t.iadd (this, t);
5791: } else {
5792: t.sub (this, t);
5793: }
5794: if (this.eq (t)) {
5795: break;
5796: }
5797:
5798: this.flg = t.flg;
5799: this.epp = t.epp;
5800: this.dvl = t.dvl;
5801: this.cvl = t.cvl;
5802: u.imul (x2);
5803: }
5804: } else {
5805: t.isqu (u);
5806: this.imul (ATAN_C39, t)
5807: .iadd (ATAN_C37).imul (t)
5808: .iadd (ATAN_C35).imul (t)
5809: .iadd (ATAN_C33).imul (t)
5810: .iadd (ATAN_C31).imul (t)
5811: .iadd (ATAN_C29).imul (t)
5812: .iadd (ATAN_C27).imul (t)
5813: .iadd (ATAN_C25).imul (t)
5814: .iadd (ATAN_C23).imul (t)
5815: .iadd (ATAN_C21).imul (t)
5816: .iadd (ATAN_C19).imul (t)
5817: .iadd (ATAN_C17).imul (t)
5818: .iadd (ATAN_C15).imul (t)
5819: .iadd (ATAN_C13).imul (t)
5820: .iadd (ATAN_C11).imul (t)
5821: .iadd (ATAN_C9).imul (t)
5822: .iadd (ATAN_C7).imul (t)
5823: .iadd (ATAN_C5).imul (t)
5824: .iadd (ATAN_C3).imul (t)
5825: .iadd (ATAN_C1).imul (u);
5826: }
5827: if (b != null) {
5828: this.negsub (b).iadd (bw);
5829: }
5830: return this.outer ().neg (xf < 0);
5831: } else {
5832: int savedFpsr = epbFpsr;
5833: this.inner ();
5834: if (this == x) {
5835: x = new EFP (x);
5836: }
5837:
5838:
5839: long s = Double.doubleToLongBits (Math.atan (Double.longBitsToDouble ((long) (1023 + x.epp) << 52 | x.dvl << 1 >>> 12)));
5840: EFP tt = new EFP (xf, (int) (s >>> 52) - 1023, MSB | s << 12 >>> 1, 0L);
5841:
5842: EFP xx = new EFP ().tan (tt);
5843:
5844:
5845: this.imul (x, xx).inc ().rcp ().imul (xx.negsub (x)).outer ().add (tt);
5846: return this.originUpperLower (x).correctUnderflow (savedFpsr);
5847: }
5848: }
5849:
5850:
5851:
5852:
5853:
5854:
5855:
5856:
5857:
5858:
5859:
5860:
5861:
5862:
5863:
5864:
5865:
5866:
5867:
5868:
5869:
5870:
5871:
5872: public final EFP atan2 (EFP x) {
5873: return this.atan2 (this, x);
5874: }
5875: public final EFP atan2 (EFP y, EFP x) {
5876: int yf = y.flg;
5877: int xf = x.flg;
5878: if ((yf | xf) << 1 != 0) {
5879: if ((yf | xf) << 3 < 0) {
5880: this.flg = N;
5881: } else if ((yf & xf) << 2 < 0) {
5882: epbFpsr |= EPB_FPSR_X2;
5883: this.sete (yf >= 0 ? xf >= 0 ? PI_4 : PI3_4 : xf >= 0 ? NEGPI_4 : NEGPI3_4).finish ();
5884: } else if (yf << 1 < 0 || xf << 2 < 0) {
5885: if (xf >= 0) {
5886: this.sete (yf >= 0 ? ZERO : NEGZERO);
5887: } else {
5888: epbFpsr |= EPB_FPSR_X2;
5889: if (yf >= 0) {
5890: this.sete (ROUNDED_PI[epbRoundingMode]).finish ();
5891: } else {
5892: this.sete (ROUNDED_NEGPI[epbRoundingMode]).finish ();
5893: }
5894: }
5895: } else {
5896: epbFpsr |= EPB_FPSR_X2;
5897: if (yf >= 0) {
5898: this.sete (ROUNDED_PI_2[epbRoundingMode]).finish ();
5899: } else {
5900: this.sete (ROUNDED_NEGPI_2[epbRoundingMode]).finish ();
5901: }
5902: }
5903: return this;
5904: }
5905:
5906: return (xf < 0 ?
5907: this.inner ().div (y, x).atan ().outer ().add (yf >= 0 ? PI : NEGPI) :
5908: this.inner ().div (y, x).outer ().atan ());
5909: }
5910:
5911:
5912:
5913:
5914:
5915:
5916:
5917:
5918:
5919:
5920:
5921:
5922:
5923:
5924:
5925:
5926:
5927:
5928:
5929:
5930:
5931:
5932:
5933:
5934:
5935:
5936:
5937:
5938:
5939:
5940:
5941:
5942:
5943:
5944:
5945:
5946:
5947:
5948:
5949:
5950:
5951:
5952:
5953:
5954:
5955:
5956:
5957:
5958:
5959:
5960:
5961:
5962:
5963:
5964:
5965:
5966:
5967:
5968:
5969:
5970:
5971:
5972:
5973:
5974:
5975:
5976:
5977:
5978:
5979:
5980:
5981:
5982:
5983:
5984:
5985:
5986:
5987:
5988:
5989:
5990:
5991:
5992:
5993:
5994:
5995:
5996:
5997:
5998:
5999:
6000:
6001:
6002:
6003:
6004:
6005:
6006:
6007:
6008:
6009:
6010:
6011:
6012:
6013:
6014:
6015:
6016:
6017:
6018:
6019:
6020:
6021:
6022:
6023:
6024:
6025:
6026:
6027:
6028:
6029:
6030:
6031:
6032:
6033:
6034:
6035:
6036:
6037:
6038:
6039:
6040:
6041:
6042:
6043:
6044:
6045:
6046:
6047:
6048:
6049:
6050:
6051:
6052:
6053:
6054:
6055:
6056:
6057:
6058:
6059:
6060:
6061:
6062:
6063:
6064:
6065:
6066:
6067:
6068:
6069:
6070:
6071:
6072:
6073:
6074:
6075:
6076:
6077:
6078:
6079:
6080:
6081:
6082:
6083:
6084:
6085:
6086:
6087:
6088:
6089:
6090:
6091:
6092:
6093:
6094:
6095:
6096:
6097:
6098:
6099:
6100:
6101:
6102:
6103:
6104:
6105:
6106:
6107:
6108:
6109:
6110:
6111:
6112:
6113:
6114:
6115:
6116:
6117:
6118:
6119:
6120:
6121:
6122:
6123:
6124:
6125:
6126:
6127:
6128:
6129:
6130:
6131:
6132:
6133:
6134:
6135:
6136:
6137:
6138:
6139:
6140:
6141:
6142:
6143:
6144:
6145:
6146:
6147:
6148:
6149:
6150:
6151:
6152:
6153:
6154:
6155:
6156:
6157:
6158:
6159:
6160:
6161:
6162:
6163:
6164:
6165:
6166:
6167:
6168:
6169:
6170:
6171:
6172:
6173:
6174:
6175:
6176:
6177:
6178:
6179:
6180:
6181:
6182:
6183:
6184:
6185:
6186:
6187:
6188:
6189:
6190:
6191:
6192:
6193:
6194:
6195:
6196: public final EFP atanh () {
6197: return this.atanh (this);
6198: }
6199: public final EFP atanh (EFP x) {
6200: int xf = x.flg;
6201: if (xf << 1 != 0) {
6202: if (xf << 2 < 0) {
6203: epbFpsr |= EPB_FPSR_OE;
6204: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
6205: epbExceptionOperandMantissa = 0x0000000000000000L;
6206: this.flg = N;
6207: } else {
6208: this.flg = xf;
6209: }
6210: return this;
6211: }
6212:
6213: int xe = x.epp;
6214: if (0 <= xe) {
6215: if (xe == 0 && x.dvl == MSB && x.cvl == 0L) {
6216: epbFpsr |= EPB_FPSR_DZ;
6217: epbExceptionOperandExponent = xf | 0x3fff << 16;
6218: epbExceptionOperandMantissa = 0x8000000000000000L;
6219: this.flg = xf | I;
6220: } else {
6221: epbFpsr |= EPB_FPSR_OE;
6222: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
6223: epbExceptionOperandMantissa = x.dvl;
6224: this.flg = N;
6225: }
6226: return this;
6227: }
6228:
6229: if (false) {
6230: if (x.epp < -4) {
6231: EFP x2 = new EFP ().inner ().isqu (x);
6232: return this.imul (ATANH_C19, x2)
6233: .iadd (ATANH_C17).imul (x2)
6234: .iadd (ATANH_C15).imul (x2)
6235: .iadd (ATANH_C13).imul (x2)
6236: .iadd (ATANH_C11).imul (x2)
6237: .iadd (ATANH_C9).imul (x2)
6238: .iadd (ATANH_C7).imul (x2)
6239: .iadd (ATANH_C5).imul (x2)
6240: .iadd (ATANH_C3).imul (x2)
6241: .iadd (ATANH_C1).outer ().mul (x);
6242: }
6243:
6244: this.inner ().iabs (x);
6245: EFP t = new EFP ().negdec (this);
6246: return this.inc ().div (t).log ().idiv2 ().outer ().neg (xf < 0);
6247: } else {
6248: int savedFpsr = epbFpsr;
6249: this.inner ();
6250: long xd = x.dvl;
6251: long xc = x.cvl;
6252: if (xe <= -3 && (xe < -3 || xd <= 0xafb0ccc06219b7baL)) {
6253: if (this == x) {
6254: x = new EFP (x);
6255: }
6256: EFP x2 = new EFP ().isqu (x);
6257:
6258:
6259:
6260:
6261:
6262:
6263:
6264:
6265:
6266:
6267:
6268:
6269:
6270:
6271:
6272: this.imul (ATH_C27, x2)
6273: .iadd (ATH_C25).imul (x2)
6274: .iadd (ATH_C23).imul (x2)
6275: .iadd (ATH_C21).imul (x2)
6276: .iadd (ATH_C19).imul (x2)
6277: .iadd (ATH_C17).imul (x2)
6278: .iadd (ATH_C15).imul (x2)
6279: .iadd (ATH_C13).imul (x2)
6280: .iadd (ATH_C11).imul (x2)
6281: .iadd (ATH_C9).imul (x2)
6282: .iadd (ATH_C7).imul (x2)
6283: .iadd (ATH_C5).imul (x2)
6284: .iadd (ATH_C3).imul (x2)
6285: .iadd (ATH_C1).outer ().mul (x);
6286: return this.originLowerUpper (x).correctUnderflow (savedFpsr);
6287: }
6288: EFP a = new EFP (P, xe, xd, xc);
6289: EFP t = new EFP ().negdec (a);
6290: int n = -t.epp;
6291: if (ATH_T[n].lt (a)) {
6292: n++;
6293: }
6294: EFP u = new EFP ().iadd (a.inc (), t.shl (n));
6295: t.negsub (a).div (u);
6296: a.isqu (t);
6297:
6298:
6299:
6300:
6301:
6302:
6303:
6304:
6305:
6306:
6307:
6308:
6309:
6310:
6311:
6312: return this.imul (ATH_C27, a)
6313: .iadd (ATH_C25).imul (a)
6314: .iadd (ATH_C23).imul (a)
6315: .iadd (ATH_C21).imul (a)
6316: .iadd (ATH_C19).imul (a)
6317: .iadd (ATH_C17).imul (a)
6318: .iadd (ATH_C15).imul (a)
6319: .iadd (ATH_C13).imul (a)
6320: .iadd (ATH_C11).imul (a)
6321: .iadd (ATH_C9).imul (a)
6322: .iadd (ATH_C7).imul (a)
6323: .iadd (ATH_C5).imul (a)
6324: .iadd (ATH_C3).imul (a)
6325: .iadd (ATH_C1).imul (t).iadd (t.muli (LOG_2_2, n)).outer ().neg (xf < 0);
6326: }
6327: }
6328:
6329:
6330:
6331:
6332:
6333:
6334:
6335:
6336:
6337:
6338:
6339:
6340:
6341:
6342:
6343:
6344:
6345:
6346:
6347:
6348:
6349:
6350:
6351:
6352:
6353:
6354:
6355:
6356:
6357:
6358:
6359:
6360:
6361:
6362:
6363:
6364:
6365:
6366:
6367:
6368:
6369:
6370:
6371:
6372:
6373:
6374:
6375:
6376:
6377:
6378:
6379:
6380:
6381:
6382:
6383:
6384:
6385:
6386:
6387:
6388:
6389:
6390:
6391:
6392:
6393:
6394:
6395: public final EFP cbrt () {
6396: return this.cbrt (this);
6397: }
6398: public final EFP cbrt (EFP x) {
6399: int xf = x.flg;
6400: if (xf << 1 != 0) {
6401: this.flg = xf;
6402: return this;
6403: }
6404:
6405: if (false) {
6406: this.inner ();
6407: EFP s = new EFP ().sgn (x);
6408: EFP a = new EFP ().iabs (x);
6409: EFP t = new EFP ().iadd (TWO, a).div3 ();
6410: EFP w = new EFP ();
6411: do {
6412:
6413: this.flg = t.flg;
6414: this.epp = t.epp;
6415: this.dvl = t.dvl;
6416: this.cvl = t.cvl;
6417: w.isqu (t).mul3 ();
6418: t.cub ().imul2 ().iadd (a).div (w);
6419: } while (this.gt (t));
6420: return this.outer ().mul (s);
6421: } else {
6422: this.inner ();
6423: int xe = x.epp;
6424: int xe3 = (int) (xe * 43691L >> 17);
6425: long s = Double.doubleToLongBits (Math.cbrt (Double.longBitsToDouble ((long) (1023 + (xe - xe3 * 3)) << 52 | x.dvl << 1 >>> 12)));
6426: EFP t = new EFP (P, (int) (s >>> 52) - 1023 + xe3, MSB | s << 12 >>> 1, 0L);
6427: EFP t2 = new EFP ().imul2 (t);
6428: t2.flg |= xf;
6429: return this.iadd (t2, t.isqu ().rcpdiv (x)).outer ().div3 ();
6430: }
6431: }
6432:
6433:
6434:
6435:
6436:
6437:
6438:
6439:
6440:
6441:
6442:
6443:
6444:
6445:
6446:
6447:
6448:
6449:
6450:
6451:
6452:
6453:
6454:
6455:
6456:
6457:
6458:
6459:
6460:
6461:
6462:
6463:
6464:
6465:
6466:
6467:
6468:
6469:
6470:
6471:
6472:
6473:
6474:
6475:
6476:
6477:
6478:
6479:
6480:
6481:
6482:
6483:
6484:
6485: public final EFP ceil () {
6486: return this.ceil (this);
6487: }
6488: public final EFP ceil (EFP x) {
6489: int xf = x.flg;
6490: if (xf << 1 != 0) {
6491: this.flg = xf;
6492: return this;
6493: }
6494:
6495: int xe = x.epp;
6496: if (xe < 0) {
6497: epbFpsr |= EPB_FPSR_X2;
6498: if (xf < 0) {
6499: this.flg = M | Z;
6500: } else {
6501: this.flg = P;
6502: this.epp = 0;
6503: this.dvl = MSB;
6504: this.cvl = 0L;
6505: }
6506: return this;
6507: }
6508:
6509: long xd = x.dvl;
6510: long xc = x.cvl;
6511: long m = MSB >> xe;
6512: if (xf < 0) {
6513: if (xe <= 63) {
6514: if ((xd & ~m | xc) != 0L) {
6515: epbFpsr |= EPB_FPSR_X2;
6516: xd &= m;
6517: xc = 0L;
6518: }
6519: } else if (xe <= LEN - 2) {
6520: if ((xc & ~m) != 0L) {
6521: epbFpsr |= EPB_FPSR_X2;
6522: xc &= m;
6523: }
6524: }
6525:
6526: } else {
6527: if (xe <= 63) {
6528: long t = xd;
6529: xd &= m;
6530: if (((t ^ xd) | xc) != 0L) {
6531: epbFpsr |= EPB_FPSR_X2;
6532: xd -= m;
6533: if (xd >= 0L) {
6534: xd = MSB;
6535: xe++;
6536: if ((short) xe != xe) {
6537: epbFpsr |= EPB_FPSR_OF;
6538: epbExceptionOperandExponent = xf;
6539: epbExceptionOperandMantissa = xd;
6540: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
6541: }
6542: }
6543: xc = 0L;
6544: }
6545:
6546: } else if (xe <= LEN - 2) {
6547: long t = xc;
6548: xc &= m;
6549: if ((t ^ xc) != 0L) {
6550: epbFpsr |= EPB_FPSR_X2;
6551: xc -= m;
6552: if ((t ^ xc) < 0L) {
6553: xd++;
6554: if (xd >= 0L) {
6555: xd = MSB;
6556: xe++;
6557: if ((short) xe != xe) {
6558: epbFpsr |= EPB_FPSR_OF;
6559: epbExceptionOperandExponent = xf;
6560: epbExceptionOperandMantissa = xd;
6561: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
6562: }
6563: }
6564: }
6565: }
6566: }
6567:
6568: }
6569: return this.finish (xf, xe, xd, xc, 0L);
6570: }
6571:
6572:
6573:
6574:
6575:
6576:
6577:
6578:
6579:
6580:
6581:
6582:
6583:
6584:
6585:
6586:
6587:
6588:
6589:
6590:
6591:
6592:
6593:
6594:
6595:
6596:
6597: public int cmp (EFP y) {
6598: int xf = this.flg;
6599: int yf = y.flg;
6600: if ((xf | yf) << 1 != 0) {
6601:
6602:
6603:
6604: return EFP_CMP_TABLE[xf >>> 28] << (yf >>> 28 - 1) >> 30;
6605: }
6606:
6607: if (xf != yf) {
6608: return xf >= 0 ? 1 : -1;
6609: }
6610:
6611: int s;
6612: long t;
6613: return (xf >= 0 ? 1 : -1) * ((s = this.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
6614: (t = this.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
6615: (t = (this.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
6616: 0);
6617: }
6618:
6619:
6620:
6621:
6622:
6623:
6624:
6625:
6626:
6627:
6628:
6629:
6630:
6631:
6632:
6633:
6634:
6635:
6636:
6637:
6638:
6639:
6640:
6641:
6642:
6643:
6644:
6645:
6646:
6647:
6648:
6649:
6650:
6651:
6652:
6653:
6654:
6655:
6656:
6657:
6658:
6659:
6660:
6661:
6662:
6663:
6664:
6665:
6666:
6667:
6668:
6669:
6670:
6671: public int cmp0 () {
6672: int xf = this.flg;
6673: return xf << 3 < 0 || xf << 1 < 0 ? 0 : xf >= 0 ? 1 : -1;
6674: }
6675:
6676:
6677:
6678:
6679:
6680:
6681:
6682:
6683:
6684:
6685:
6686:
6687:
6688:
6689:
6690:
6691:
6692:
6693:
6694:
6695:
6696:
6697:
6698:
6699:
6700:
6701:
6702:
6703:
6704:
6705:
6706:
6707:
6708:
6709:
6710:
6711:
6712:
6713:
6714:
6715:
6716:
6717:
6718:
6719:
6720:
6721:
6722:
6723:
6724:
6725:
6726:
6727:
6728: public int cmp1 () {
6729: int xf = this.flg;
6730: if (xf != 0) {
6731: return xf << 3 < 0 ? 0 : (xf | xf << 1) < 0 ? -1 : 1;
6732: }
6733:
6734: int xe = this.epp;
6735: return xe < 0 ? -1 : xe == 0 && this.dvl == MSB && this.cvl == 0L ? 0 : 1;
6736: }
6737:
6738:
6739:
6740:
6741:
6742:
6743:
6744:
6745:
6746:
6747:
6748:
6749:
6750:
6751:
6752:
6753:
6754:
6755:
6756:
6757:
6758:
6759:
6760:
6761:
6762:
6763:
6764:
6765:
6766:
6767:
6768:
6769:
6770:
6771:
6772:
6773:
6774:
6775:
6776:
6777:
6778:
6779:
6780:
6781:
6782:
6783:
6784:
6785:
6786:
6787:
6788:
6789:
6790: public int cmp1abs () {
6791: int xf = this.flg;
6792: if (xf << 1 != 0) {
6793: return xf << 3 < 0 ? 0 : xf << 1 < 0 ? -1 : 1;
6794: }
6795:
6796: int xe = this.epp;
6797: return xe < 0 ? -1 : xe == 0 && this.dvl == MSB && this.cvl == 0L ? 0 : 1;
6798: }
6799:
6800:
6801:
6802:
6803:
6804:
6805: public int cmpabs (EFP y) {
6806: int xf = this.flg & ~M;
6807: int yf = y.flg & ~M;
6808: if ((xf | yf) << 1 != 0) {
6809: return EFP_CMP_TABLE[xf >>> 28] << (yf >>> 28 - 1) >> 30;
6810: }
6811:
6812: int s;
6813: long t;
6814: return ((s = this.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
6815: (t = this.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
6816: (t = (this.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
6817: 0);
6818: }
6819:
6820:
6821:
6822:
6823:
6824:
6825:
6826:
6827:
6828:
6829:
6830: @Override public int compareTo (EFP y) {
6831: EFP x = this;
6832: int xf = x.flg;
6833: int yf = y.flg;
6834: if ((xf | yf) << 1 != 0) {
6835:
6836:
6837:
6838:
6839: return EFP_COMPARE_TABLE[xf >>> 28] << (yf >>> 28 - 1) >> 30;
6840: }
6841:
6842: if (xf != yf) {
6843: return xf >= 0 ? 1 : -1;
6844: }
6845:
6846: int s;
6847: long t;
6848: return (xf >= 0 ? 1 : -1) * ((s = x.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
6849: (t = x.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
6850: (t = (x.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
6851: 0);
6852: }
6853:
6854:
6855:
6856:
6857:
6858:
6859:
6860:
6861:
6862:
6863:
6864:
6865:
6866:
6867:
6868:
6869:
6870:
6871:
6872:
6873:
6874:
6875:
6876:
6877:
6878:
6879:
6880:
6881:
6882:
6883:
6884:
6885:
6886:
6887:
6888:
6889:
6890:
6891:
6892:
6893:
6894:
6895:
6896:
6897:
6898:
6899:
6900:
6901:
6902:
6903:
6904:
6905:
6906:
6907:
6908:
6909:
6910:
6911:
6912:
6913:
6914:
6915:
6916:
6917:
6918:
6919:
6920:
6921:
6922:
6923:
6924:
6925:
6926:
6927:
6928:
6929:
6930:
6931:
6932:
6933:
6934:
6935:
6936:
6937:
6938:
6939:
6940:
6941:
6942:
6943:
6944:
6945:
6946:
6947:
6948:
6949:
6950:
6951:
6952:
6953:
6954:
6955:
6956:
6957:
6958: public final EFP cos () {
6959: return this.cos (this);
6960: }
6961: public final EFP cos (EFP x) {
6962: int xf = x.flg;
6963: if (xf << 1 != 0) {
6964: if (xf << 1 < 0) {
6965: this.flg = P;
6966: this.epp = 0;
6967: this.dvl = MSB;
6968: this.cvl = 0L;
6969: } else if (xf << 2 < 0) {
6970: epbFpsr |= EPB_FPSR_OE;
6971: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
6972: epbExceptionOperandMantissa = 0x0000000000000000L;
6973: this.flg = N;
6974: } else {
6975: this.flg = N;
6976: }
6977: return this;
6978: }
6979:
6980: this.inner ();
6981: EFP u = new EFP ();
6982: EFP u2 = new EFP ();
6983: int k = u.ieeerempi2 (x);
6984: if (false) {
6985: EFP s = new EFP ();
6986: EFP t = new EFP ();
6987: u2.isqu (u);
6988: if ((k & 1) != 0) {
6989:
6990: s.flg = u.flg;
6991: s.epp = u.epp;
6992: s.dvl = u.dvl;
6993: s.cvl = u.cvl;
6994:
6995: t.flg = P | Z;
6996:
6997: this.flg = s.flg;
6998: this.epp = s.epp;
6999: this.dvl = s.dvl;
7000: this.cvl = s.cvl;
7001: for (int twok1 = 3; this.ne (t); twok1 += 2) {
7002: s.imul (u2).divi ((1 - twok1) * twok1);
7003:
7004: t.flg = this.flg;
7005: t.epp = this.epp;
7006: t.dvl = this.dvl;
7007: t.cvl = this.cvl;
7008: this.iadd (s);
7009: }
7010: } else {
7011:
7012: s.flg = P;
7013: s.epp = 0;
7014: s.dvl = MSB;
7015: s.cvl = 0L;
7016:
7017: t.flg = P | Z;
7018:
7019: this.flg = s.flg;
7020: this.epp = s.epp;
7021: this.dvl = s.dvl;
7022: this.cvl = s.cvl;
7023: for (int twok = 2; this.ne (t); twok += 2) {
7024: s.imul (u2).divi ((1 - twok) * twok);
7025:
7026: t.flg = this.flg;
7027: t.epp = this.epp;
7028: t.dvl = this.dvl;
7029: t.cvl = this.cvl;
7030: this.iadd (s);
7031: }
7032: }
7033: } else {
7034: if ((k & 1) != 0) {
7035: u2.isqu (u);
7036: this.imul (SIN_C21, u2)
7037: .iadd (SIN_C19).imul (u2)
7038: .iadd (SIN_C17).imul (u2)
7039: .iadd (SIN_C15).imul (u2)
7040: .iadd (SIN_C13).imul (u2)
7041: .iadd (SIN_C11).imul (u2)
7042: .iadd (SIN_C9).imul (u2)
7043: .iadd (SIN_C7).imul (u2)
7044: .iadd (SIN_C5).imul (u2)
7045: .iadd (SIN_C3).imul (u2)
7046: .iadd (SIN_C1).imul (u);
7047: } else {
7048: u2.isqu (u);
7049: this.imul (COS_C20, u2)
7050: .iadd (COS_C18).imul (u2)
7051: .iadd (COS_C16).imul (u2)
7052: .iadd (COS_C14).imul (u2)
7053: .iadd (COS_C12).imul (u2)
7054: .iadd (COS_C10).imul (u2)
7055: .iadd (COS_C8).imul (u2)
7056: .iadd (COS_C6).imul (u2)
7057: .iadd (COS_C4).imul (u2)
7058: .iadd (COS_C2).imul (u2)
7059: .iadd (COS_C0);
7060: }
7061: }
7062:
7063: this.outer ().neg (0b0110 << 28 << k < 0);
7064:
7065:
7066:
7067: if (this.flg << 1 == 0 && this.epp == 0) {
7068: if (this.flg < 0) {
7069: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
7070: this.sete (NEXTUP_MINUSONE[epbRoundingPrec]);
7071: }
7072: } else {
7073: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
7074: this.sete (NEXTDOWN_PLUSONE[epbRoundingPrec]);
7075: }
7076: }
7077: }
7078: return this;
7079: }
7080:
7081:
7082:
7083:
7084:
7085:
7086:
7087:
7088:
7089:
7090:
7091:
7092:
7093:
7094:
7095:
7096:
7097:
7098:
7099:
7100:
7101:
7102:
7103:
7104:
7105:
7106:
7107:
7108:
7109:
7110:
7111:
7112:
7113:
7114:
7115:
7116:
7117:
7118:
7119:
7120:
7121:
7122:
7123:
7124:
7125:
7126:
7127:
7128:
7129:
7130:
7131:
7132:
7133:
7134:
7135:
7136:
7137:
7138:
7139:
7140:
7141:
7142:
7143:
7144:
7145:
7146:
7147:
7148:
7149:
7150:
7151:
7152:
7153:
7154:
7155: public final EFP cosh () {
7156: return this.cosh (this);
7157: }
7158: public final EFP cosh (EFP x) {
7159: int xf = x.flg;
7160: if (xf << 1 != 0) {
7161: if (xf << 1 < 0) {
7162:
7163: this.flg = P;
7164: this.epp = 0;
7165: this.dvl = MSB;
7166: this.cvl = 0L;
7167: } else if (xf << 2 < 0) {
7168: this.flg = P | I;
7169: } else {
7170: this.flg = N;
7171: }
7172: return this;
7173: }
7174:
7175: epbFpsr |= EPB_FPSR_X2;
7176: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
7177: epbExceptionOperandMantissa = x.dvl;
7178: if (15 <= x.epp) {
7179: epbFpsr |= EPB_FPSR_OF;
7180: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
7181: }
7182: if (x.epp < -3) {
7183: EFP x2 = new EFP ().inner ().isqu (x);
7184: return this.imul (COSH_C14, x2)
7185: .iadd (COSH_C12).imul (x2)
7186: .iadd (COSH_C10).imul (x2)
7187: .iadd (COSH_C8).imul (x2)
7188: .iadd (COSH_C6).imul (x2)
7189: .iadd (COSH_C4).imul (x2)
7190: .iadd (COSH_C2).imul (x2)
7191: .outer ().add (COSH_C0);
7192: }
7193:
7194:
7195:
7196: this.inner ().abs (x).exp ();
7197: this.iadd (new EFP ().rcp (this)).outer ().div2 ();
7198: if (this.flg << 2 < 0) {
7199: epbFpsr |= EPB_FPSR_OF;
7200: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | this.flg >>> 31]).finish ();
7201: }
7202: return this;
7203: }
7204:
7205:
7206:
7207:
7208:
7209:
7210:
7211:
7212:
7213:
7214:
7215:
7216:
7217:
7218:
7219:
7220:
7221:
7222:
7223:
7224:
7225:
7226:
7227:
7228:
7229:
7230:
7231:
7232:
7233:
7234:
7235:
7236:
7237:
7238:
7239:
7240:
7241:
7242:
7243:
7244:
7245:
7246:
7247:
7248:
7249:
7250:
7251:
7252:
7253:
7254:
7255:
7256:
7257:
7258:
7259:
7260:
7261:
7262:
7263:
7264:
7265:
7266:
7267:
7268:
7269: public final EFP cot () {
7270: return this.cot (this);
7271: }
7272: public final EFP cot (EFP x) {
7273: int xf = x.flg;
7274: if (xf << 1 != 0) {
7275: if (xf << 1 < 0) {
7276: epbFpsr |= EPB_FPSR_OE;
7277: epbExceptionOperandExponent = xf & M;
7278: epbExceptionOperandMantissa = 0x0000000000000000L;
7279: this.flg = N;
7280: } else if (xf << 2 < 0) {
7281: epbFpsr |= EPB_FPSR_OE;
7282: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
7283: epbExceptionOperandMantissa = 0x0000000000000000L;
7284: this.flg = N;
7285: } else {
7286: this.flg = N;
7287: }
7288: return this;
7289: }
7290:
7291: if (false) {
7292: EFP s = new EFP ().inner ().sin (x);
7293: return this.cos (x).outer ().div (s);
7294: } else if (false) {
7295: return this.inner ().sub (PI_2, x).iadd (PI_2A).outer ().tan ();
7296: } else if (false) {
7297: return this.inner ().tan (x).outer ().rcp ();
7298: } else {
7299: if (15 <= x.epp) {
7300: EFP s = new EFP ().inner ().sin (x);
7301: return this.cos (x).outer ().div (s);
7302: }
7303: this.inner ();
7304: EFP s = new EFP ();
7305: EFP t = new EFP ();
7306: EFP u = new EFP ().iabs (x);
7307: EFP u2 = new EFP ();
7308: s.iadd (u, TAN7_X).imul (TAN7_Y).trunc ();
7309:
7310: u.sub (t.imulw (u2, s, TAN7_Z)).sub (u2).sub (t.imul (s, TAN7_ZA));
7311: int k = s.geti () & 127;
7312: u2.isqu (u);
7313: this.imul (TAN7_C11, u2)
7314: .iadd (TAN7_C9).imul (u2)
7315: .iadd (TAN7_C7).imul (u2)
7316: .iadd (TAN7_C5).imul (u2)
7317: .iadd (TAN7_C3).imul (u2)
7318: .iadd (TAN7_C1).imul (u);
7319: if (k == 0) {
7320: this.rcp ();
7321: } else if (k <= 63) {
7322: t = TAN7_T[k];
7323: s.iadd (this, t);
7324: this.imul (t).negdec ().div (s);
7325: } else if (k == 64) {
7326: this.ineg ();
7327: } else {
7328: t = TAN7_T[128 - k];
7329: s.sub (this, t);
7330: this.imul (t).inc ().div (s);
7331: }
7332: return this.outer ().neg (xf < 0);
7333: }
7334: }
7335:
7336:
7337:
7338:
7339:
7340:
7341:
7342:
7343:
7344:
7345:
7346:
7347:
7348:
7349:
7350:
7351:
7352:
7353:
7354:
7355:
7356:
7357:
7358:
7359:
7360:
7361:
7362:
7363:
7364:
7365:
7366:
7367:
7368:
7369:
7370:
7371:
7372:
7373:
7374:
7375:
7376:
7377:
7378:
7379:
7380:
7381:
7382:
7383:
7384:
7385:
7386:
7387:
7388:
7389:
7390:
7391:
7392:
7393:
7394:
7395:
7396:
7397:
7398:
7399:
7400:
7401:
7402:
7403:
7404:
7405:
7406:
7407:
7408:
7409:
7410:
7411:
7412:
7413:
7414:
7415:
7416:
7417:
7418:
7419:
7420:
7421:
7422: public final EFP coth () {
7423: return this.coth (this);
7424: }
7425: public final EFP coth (EFP x) {
7426: int xf = x.flg;
7427: if (xf << 1 != 0) {
7428: if (xf << 1 < 0) {
7429: epbFpsr |= EPB_FPSR_OE;
7430: epbExceptionOperandExponent = xf & M;
7431: epbExceptionOperandMantissa = 0x0000000000000000L;
7432: this.flg = N;
7433: } else if (xf << 2 < 0) {
7434: this.flg = xf & M;
7435: this.epp = 0;
7436: this.dvl = MSB;
7437: this.cvl = 0L;
7438: } else {
7439: this.flg = N;
7440: }
7441: return this;
7442: }
7443:
7444:
7445: int xe = x.epp;
7446: if (xe < -2) {
7447: EFP x2 = new EFP ().inner ().isqu (x);
7448: return this.imul (TANH_C27, x2)
7449: .iadd (TANH_C25).imul (x2)
7450: .iadd (TANH_C23).imul (x2)
7451: .iadd (TANH_C21).imul (x2)
7452: .iadd (TANH_C19).imul (x2)
7453: .iadd (TANH_C17).imul (x2)
7454: .iadd (TANH_C15).imul (x2)
7455: .iadd (TANH_C13).imul (x2)
7456: .iadd (TANH_C11).imul (x2)
7457: .iadd (TANH_C9).imul (x2)
7458: .iadd (TANH_C7).imul (x2)
7459: .iadd (TANH_C5).imul (x2)
7460: .iadd (TANH_C3).imul (x2)
7461: .iadd (TANH_C1).imul (x).outer ().rcp ();
7462: }
7463:
7464: if (false) {
7465: EFP s = new EFP ().inner ().sinh (x);
7466: return this.cosh (x).outer ().div (s);
7467: } else if (EFP_COTH_EPP_MAX < xe) {
7468: this.flg = xf & M;
7469: this.epp = 0;
7470: this.dvl = MSB;
7471: this.cvl = 0L;
7472: return this;
7473: } else {
7474: EFP t = new EFP ().inner ().imul2 (x).exp ();
7475: return this.inc (t).outer ().div (t.dec ());
7476: }
7477: }
7478:
7479:
7480:
7481:
7482:
7483:
7484:
7485:
7486:
7487:
7488:
7489:
7490:
7491:
7492:
7493:
7494:
7495:
7496:
7497:
7498:
7499:
7500:
7501:
7502:
7503:
7504:
7505:
7506:
7507:
7508:
7509:
7510:
7511:
7512:
7513:
7514:
7515:
7516:
7517:
7518:
7519:
7520:
7521:
7522:
7523:
7524:
7525:
7526:
7527:
7528:
7529:
7530:
7531:
7532:
7533:
7534:
7535:
7536:
7537:
7538:
7539:
7540:
7541:
7542: public final EFP csc () {
7543: return this.csc (this);
7544: }
7545: public final EFP csc (EFP x) {
7546: return this.inner ().sin (x).outer ().rcp ();
7547: }
7548:
7549:
7550:
7551:
7552:
7553:
7554:
7555:
7556:
7557:
7558:
7559:
7560:
7561:
7562:
7563:
7564:
7565:
7566:
7567:
7568:
7569:
7570:
7571:
7572:
7573:
7574:
7575:
7576:
7577:
7578:
7579:
7580:
7581:
7582:
7583:
7584:
7585:
7586:
7587:
7588:
7589:
7590:
7591:
7592:
7593:
7594:
7595:
7596:
7597:
7598:
7599:
7600:
7601:
7602:
7603:
7604:
7605:
7606:
7607:
7608:
7609:
7610:
7611:
7612:
7613:
7614:
7615:
7616: public final EFP csch () {
7617: return this.csch (this);
7618: }
7619: public final EFP csch (EFP x) {
7620: int xf = x.flg;
7621: if (xf << 1 != 0) {
7622: if (xf << 1 < 0) {
7623: epbFpsr |= EPB_FPSR_OE;
7624: epbExceptionOperandExponent = xf & M;
7625: epbExceptionOperandMantissa = 0x0000000000000000L;
7626: this.flg = N;
7627: } else {
7628: this.flg = xf << 2 < 0 ? xf ^ (Z | I) : N;
7629: }
7630: return this;
7631: }
7632:
7633: if (true) {
7634: return this.inner ().sinh (x).outer ().rcp ();
7635: } else if (false) {
7636: this.inner ().exp (x);
7637: return this.sub (new EFP ().rcp (this)).outer ().rcp ().outer ().mul2 ();
7638: } else {
7639: return this.sub (new EFP ().inner ().exp (x), new EFP ().ineg (x).exp ()).rcp ().outer ().mul2 ();
7640: }
7641: }
7642:
7643:
7644:
7645:
7646:
7647:
7648:
7649:
7650:
7651:
7652:
7653:
7654:
7655:
7656:
7657:
7658:
7659:
7660:
7661:
7662:
7663:
7664:
7665:
7666:
7667:
7668:
7669:
7670:
7671:
7672:
7673:
7674:
7675:
7676:
7677:
7678:
7679:
7680:
7681:
7682:
7683:
7684:
7685:
7686:
7687:
7688:
7689:
7690:
7691:
7692:
7693:
7694:
7695:
7696:
7697:
7698:
7699:
7700:
7701:
7702:
7703: public final EFP cub () {
7704: return this.mul (new EFP ().isqu (this));
7705: }
7706: public final EFP cub (EFP x) {
7707: return this.mul (x, new EFP ().isqu (x));
7708: }
7709:
7710:
7711:
7712:
7713:
7714:
7715:
7716:
7717:
7718:
7719:
7720:
7721:
7722:
7723:
7724:
7725:
7726:
7727:
7728:
7729:
7730:
7731:
7732:
7733:
7734:
7735:
7736:
7737:
7738:
7739:
7740:
7741:
7742:
7743:
7744:
7745:
7746:
7747:
7748:
7749:
7750:
7751:
7752:
7753:
7754:
7755:
7756:
7757:
7758:
7759:
7760:
7761:
7762: public final EFP dec () {
7763: return this.dec (this);
7764: }
7765: public final EFP dec (EFP x) {
7766:
7767:
7768: int xf = x.flg;
7769: if (xf << 1 != 0) {
7770: if (xf << 1 < 0) {
7771: this.flg = M;
7772: this.epp = 0;
7773: this.dvl = MSB;
7774: this.cvl = 0L;
7775: } else {
7776: this.flg = xf;
7777: }
7778: return this;
7779: }
7780:
7781: int xe = x.epp;
7782: if (xe < -LEN) {
7783:
7784: epbFpsr |= EPB_FPSR_X2;
7785: this.flg = M;
7786: this.epp = 0;
7787: this.dvl = MSB;
7788: this.cvl = 0L;
7789: return this;
7790: }
7791: long xd = x.dvl;
7792: long xc = x.cvl;
7793: if (LEN < xe) {
7794:
7795: epbFpsr |= EPB_FPSR_X2;
7796: return this.finish (xf, xe, xd, xc, 0L);
7797: }
7798: long xb = 0L;
7799: if (xe == 0) {
7800:
7801: if (xf < 0) {
7802:
7803: xb = xc << -1;
7804: xc = xd << -1 | xc >>> 1;
7805: xd = (xd >>> 1) + (MSB >>> 1);
7806: xe++;
7807: } else {
7808:
7809: xd -= MSB;
7810: }
7811: } else if (0 < xe) {
7812:
7813: if (xf < 0) {
7814:
7815: if (xe <= 63) {
7816: if ((xd += MSB >>> xe) >>> ~xe == 0L) {
7817: xb = xc << -1;
7818: xc = xd << -1 | xc >>> 1;
7819: xd = MSB | xd >>> 1;
7820: xe++;
7821: }
7822: } else {
7823: if ((xc += MSB >>> xe) >>> ~xe == 0L && ++xd == 0L) {
7824: xb = xc << -1;
7825: xc = xc >>> 1;
7826: xd = MSB;
7827: xe++;
7828: }
7829: }
7830: } else {
7831:
7832: if (xe <= 63) {
7833: xd -= MSB >>> xe;
7834: } else {
7835: if (xc >>> ~xe != 0L) {
7836: xc -= MSB >>> xe;
7837: } else {
7838: xc |= MSB >> xe;
7839: xd--;
7840: }
7841: }
7842: }
7843: } else {
7844:
7845: if (-63 <= xe) {
7846: xb = xc << xe;
7847: xc = xd << xe | xc >>> -xe;
7848: xd >>>= -xe;
7849: } else if (-64 == xe) {
7850: xb = xc;
7851: xc = xd;
7852: xd = 0L;
7853: } else {
7854: xb = xd << xe | xc >>> -xe;
7855: xc = xd >>> -xe;
7856: xd = 0L;
7857: }
7858: xe = 0;
7859: if (xf < 0) {
7860:
7861: xd |= MSB;
7862: } else {
7863:
7864: if (xb != 0L) {
7865: xb = -xb;
7866: xc = -1L - xc;
7867: xd = MSB - 1L - xd;
7868: } else if (xc != 0L) {
7869: xc = -xc;
7870: xd = MSB - 1L - xd;
7871: } else {
7872: xd = MSB - xd;
7873: }
7874: xf ^= M;
7875: }
7876: }
7877:
7878: if (xd >= 0L) {
7879: if (xd != 0L) {
7880: int o = Long.numberOfLeadingZeros (xd);
7881: xe -= o;
7882: xd = xd << o | xc >>> -o;
7883: xc = xc << o | xb >>> -o;
7884: xb <<= o;
7885: } else if (xc < 0L) {
7886: xe -= 64;
7887: xd = xc;
7888: xc = xb;
7889: xb = 0L;
7890: } else if (xc != 0L) {
7891: int o = 64 + Long.numberOfLeadingZeros (xc);
7892: xe -= o;
7893: xd = xc << o | xb >>> -o;
7894: xc = xb << o;
7895: xb = 0L;
7896: } else if (xb < 0L) {
7897: xe -= 128;
7898: xd = xb;
7899: xc = 0L;
7900: xb = 0L;
7901: } else if (xb != 0L) {
7902: int o = 128 + Long.numberOfLeadingZeros (xb);
7903: xe -= o;
7904: xd = xb << o;
7905: xc = 0L;
7906: xb = 0L;
7907: } else {
7908: this.flg = P | Z;
7909: return this;
7910: }
7911: }
7912: return this.finish (xf, xe, xd, xc, xb);
7913: }
7914:
7915:
7916:
7917:
7918:
7919:
7920:
7921:
7922:
7923:
7924:
7925:
7926:
7927:
7928:
7929:
7930:
7931:
7932:
7933:
7934:
7935:
7936:
7937:
7938:
7939:
7940:
7941:
7942:
7943:
7944:
7945:
7946:
7947:
7948:
7949:
7950:
7951:
7952:
7953:
7954:
7955:
7956:
7957:
7958:
7959:
7960:
7961:
7962:
7963:
7964:
7965:
7966:
7967:
7968:
7969:
7970:
7971:
7972:
7973: public final EFP deg () {
7974: return this.deg (this);
7975: }
7976: public final EFP deg (EFP x) {
7977: return this.mul (x, TO_DEG);
7978: }
7979:
7980:
7981:
7982:
7983:
7984:
7985:
7986:
7987:
7988:
7989:
7990: public final EFP div (EFP y) {
7991: return this.div (this, y);
7992: }
7993: public final EFP div (EFP x, EFP y) {
7994: int xf = x.flg;
7995: int yf = y.flg;
7996: if ((xf | yf) << 1 != 0) {
7997: if ((xf | yf) << 3 != 0) {
7998: this.flg = N;
7999: } else if ((xf & yf & (Z | I)) != 0) {
8000: epbFpsr |= EPB_FPSR_OE;
8001: if (yf << 1 < 0) {
8002: epbExceptionOperandExponent = yf & M;
8003: epbExceptionOperandMantissa = 0x0000000000000000L;
8004: } else {
8005: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
8006: epbExceptionOperandMantissa = 0x0000000000000000L;
8007: }
8008: this.flg = N;
8009: } else if (xf << 1 == 0 && yf << 1 < 0) {
8010: epbFpsr |= EPB_FPSR_DZ;
8011: epbExceptionOperandExponent = yf & M;
8012: epbExceptionOperandMantissa = 0x0000000000000000L;
8013: this.flg = (xf ^ yf) & M | I;
8014: } else {
8015: this.flg = (xf ^ yf) & M | ((xf & Z | yf & I) != 0 ? Z : I);
8016: }
8017: return this;
8018: }
8019:
8020: long r01 = x.dvl;
8021: long y01 = y.dvl;
8022: long r2 = (r01 << -2 | x.cvl >>> 2) >>> 33;
8023: long y2 = (y01 << -2 | y.cvl >>> 2) >>> 33;
8024: r01 >>>= 2;
8025: y01 >>>= 2;
8026: long y0 = y01 >>> 31;
8027: long y1 = y01 & 0x7fffffffL;
8028:
8029: boolean qq;
8030: if (r01 < y01 || (r01 == y01 && r2 < y2)) {
8031: qq = false;
8032: } else {
8033: qq = true;
8034: r2 -= y2;
8035: r01 -= y01;
8036: if (r2 < 0L) {
8037: r2 += 0x80000000L;
8038: r01--;
8039: }
8040: }
8041:
8042: long q0 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
8043: r01 = (r01 - q0 * y0 << 31) + r2 - q0 * y1;
8044: if (r01 < 0L) {
8045: q0--;
8046: r01 += y01;
8047: }
8048: r2 = q0 * y2 + 0x7fffffffL;
8049: r01 -= r2 >> 31;
8050: r2 = ~r2 & 0x7fffffffL;
8051: if (r01 < 0L) {
8052: q0--;
8053: r2 += y2;
8054: r01 += y01 + (r2 >> 31);
8055: r2 &= 0x7fffffffL;
8056: }
8057:
8058: long q1 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
8059: r01 = (r01 - q1 * y0 << 31) + r2 - q1 * y1;
8060: if (r01 < 0L) {
8061: q1--;
8062: r01 += y01;
8063: }
8064: r2 = q1 * y2 + 0x7fffffffL;
8065: r01 -= r2 >> 31;
8066: r2 = ~r2 & 0x7fffffffL;
8067: if (r01 < 0L) {
8068: q1--;
8069: r2 += y2;
8070: r01 += y01 + (r2 >> 31);
8071: r2 &= 0x7fffffffL;
8072: }
8073:
8074: long q2 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
8075: r01 = (r01 - q2 * y0 << 31) + r2 - q2 * y1;
8076: if (r01 < 0L) {
8077: q2--;
8078: r01 += y01;
8079: }
8080: r2 = q2 * y2 + 0x7fffffffL;
8081: r01 -= r2 >> 31;
8082: r2 = ~r2 & 0x7fffffffL;
8083: if (r01 < 0L) {
8084: q2--;
8085: r2 += y2;
8086: r01 += y01 + (r2 >> 31);
8087: r2 &= 0x7fffffffL;
8088: }
8089:
8090:
8091:
8092: int ze = x.epp - y.epp;
8093: if (qq) {
8094: q0 = MSB | q0 << 32 | q1 << 1 | q2 >>> 30;
8095: q2 <<= -30;
8096: } else {
8097: ze--;
8098: q0 = q0 << -31 | q1 << 2 | q2 >>> 29;
8099: q2 <<= -29;
8100: }
8101: return this.finish2 (xf ^ yf, ze, q0, q2, r01 | r2);
8102: }
8103:
8104:
8105:
8106:
8107:
8108:
8109:
8110:
8111:
8112:
8113:
8114:
8115:
8116:
8117:
8118:
8119:
8120:
8121:
8122:
8123:
8124:
8125:
8126:
8127:
8128:
8129:
8130:
8131:
8132:
8133:
8134:
8135:
8136:
8137:
8138:
8139:
8140:
8141:
8142:
8143:
8144:
8145:
8146:
8147:
8148:
8149:
8150:
8151:
8152:
8153:
8154:
8155:
8156:
8157:
8158:
8159:
8160:
8161:
8162: public final EFP div2 () {
8163: return this.finish (this.flg, this.epp - 1, this.dvl, this.cvl, 0L);
8164: }
8165: public final EFP idiv2 () {
8166: this.epp--;
8167: return this;
8168: }
8169: public final EFP div2 (EFP x) {
8170: return this.finish (x.flg, x.epp - 1, x.dvl, x.cvl, 0L);
8171: }
8172: public final EFP idiv2 (EFP x) {
8173: this.flg = x.flg;
8174: this.epp = x.epp - 1;
8175: this.dvl = x.dvl;
8176: this.cvl = x.cvl;
8177: return this;
8178: }
8179:
8180:
8181:
8182:
8183:
8184:
8185:
8186:
8187:
8188:
8189:
8190:
8191:
8192:
8193:
8194:
8195:
8196:
8197:
8198:
8199:
8200:
8201:
8202:
8203:
8204:
8205:
8206:
8207:
8208:
8209:
8210:
8211:
8212:
8213:
8214:
8215:
8216:
8217:
8218:
8219:
8220:
8221:
8222:
8223:
8224:
8225:
8226:
8227:
8228:
8229:
8230:
8231:
8232:
8233:
8234:
8235:
8236:
8237:
8238: public final EFP div3 () {
8239: return this.div3 (this);
8240: }
8241: public final EFP div3 (EFP x) {
8242:
8243: int xf = x.flg;
8244: if (xf << 1 != 0) {
8245: this.flg = xf;
8246: return this;
8247: }
8248:
8249:
8250: int ze = x.epp;
8251: long zc = x.dvl;
8252: long zb = x.cvl;
8253: zb = (zc << -1 | zb >>> 1) >>> 3;
8254: zc >>>= 1;
8255: long zd = zc / 3L;
8256: zb |= zc - zd * 3L << -3;
8257: zc = zb / 3L;
8258: zb -= zc * 3L;
8259: zc <<= 3;
8260:
8261: if (zd << 2 < 0L) {
8262: ze--;
8263: zd = zd << 2 | zc >>> -2;
8264: zc <<= 2;
8265: } else {
8266: ze -= 2;
8267: zd = zd << 3 | zc >>> -3;
8268: zc <<= 3;
8269: }
8270: return this.finish (xf, ze, zd, zc, zb);
8271: }
8272:
8273:
8274:
8275:
8276:
8277:
8278:
8279:
8280: public final EFP divi (int n) {
8281: return this.divi (this, n);
8282: }
8283: public final EFP divi (EFP x, int n) {
8284:
8285: int xf = x.flg;
8286: if (n == 0) {
8287: if (xf << 1 != 0) {
8288: if (xf << 1 < 0) {
8289: epbFpsr |= EPB_FPSR_OE;
8290: epbExceptionOperandExponent = P;
8291: epbExceptionOperandMantissa = 0x0000000000000000L;
8292: this.flg = N;
8293: } else {
8294: this.flg = xf;
8295: }
8296: } else {
8297: epbFpsr |= EPB_FPSR_DZ;
8298: epbExceptionOperandExponent = P;
8299: epbExceptionOperandMantissa = 0x0000000000000000L;
8300: this.flg = (xf & M) | I;
8301: }
8302: return this;
8303: }
8304: if (xf << 1 != 0) {
8305: this.flg = xf << 3 < 0 ? N : xf ^ (n & M);
8306: return this;
8307: }
8308:
8309: int ze = x.epp;
8310: long zd = x.dvl;
8311: long zc = x.cvl;
8312: long zb = 0L;
8313: if (n < 0) {
8314: xf ^= M;
8315:
8316: if (n == 0x80000000) {
8317: ze -= 31;
8318: if ((short) ze != ze) {
8319: epbFpsr |= EPB_FPSR_UF;
8320: epbExceptionOperandExponent = xf;
8321: epbExceptionOperandMantissa = zd;
8322: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
8323: }
8324: this.flg = xf;
8325: this.epp = ze;
8326: this.dvl = zd;
8327: this.cvl = zc;
8328: return this;
8329: }
8330: n = -n;
8331: }
8332: if (n != 1) {
8333: long y = (long) n;
8334: if (n >>> 16 == 0) {
8335:
8336: zb = (zd << -1 | zc >>> 1) >>> 17;
8337: zc = zd >>> 1;
8338: zd = zc / y;
8339: zb |= zc - zd * y << 47;
8340: zc = zb / y;
8341: zb -= zc * y;
8342: zc <<= 17;
8343: } else {
8344:
8345: zb = (zd << -1 | zc >>> 1) >>> 33;
8346: zc = zd >>> 1;
8347: zd = zc / y;
8348: zb |= zc - zd * y << 31;
8349: zc = zb / y;
8350: zb = zb - zc * y << 31;
8351: long t = zb / y;
8352: zc = (zc << 31 | t) << 2;
8353: zb -= t * y;
8354: }
8355:
8356: int o = Long.numberOfLeadingZeros (zd);
8357: ze -= o - 1;
8358: zd = zd << o | zc >>> -o;
8359: zc <<= o;
8360: }
8361: return this.finish (xf, ze, zd, zc, zb);
8362: }
8363:
8364:
8365:
8366:
8367:
8368:
8369:
8370:
8371:
8372:
8373:
8374:
8375:
8376:
8377:
8378:
8379:
8380:
8381:
8382:
8383:
8384:
8385:
8386:
8387:
8388:
8389:
8390:
8391:
8392:
8393:
8394:
8395:
8396:
8397:
8398:
8399:
8400:
8401:
8402:
8403:
8404:
8405:
8406:
8407:
8408:
8409:
8410:
8411:
8412:
8413:
8414:
8415:
8416:
8417:
8418:
8419:
8420:
8421:
8422: public final EFP divpi () {
8423: return this.mul (this, ONE_PI);
8424: }
8425: public final EFP divpi (EFP x) {
8426: return this.mul (x, ONE_PI);
8427: }
8428:
8429:
8430:
8431:
8432:
8433:
8434:
8435:
8436: public final EFP divrz (EFP y) {
8437: return this.divrz (this, y);
8438: }
8439: public final EFP divrz (EFP x, EFP y) {
8440: int xf = x.flg;
8441: int yf = y.flg;
8442: if ((xf | yf) << 1 != 0) {
8443: if ((xf | yf) << 3 != 0) {
8444: this.flg = N;
8445: } else if ((xf & yf & (Z | I)) != 0) {
8446: epbFpsr |= EPB_FPSR_OE;
8447: if (yf << 1 < 0) {
8448: epbExceptionOperandExponent = yf & M;
8449: epbExceptionOperandMantissa = 0x0000000000000000L;
8450: } else {
8451: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
8452: epbExceptionOperandMantissa = 0x0000000000000000L;
8453: }
8454: this.flg = N;
8455: } else if (xf << 1 == 0 && yf << 1 < 0) {
8456: epbFpsr |= EPB_FPSR_DZ;
8457: epbExceptionOperandExponent = yf & M;
8458: epbExceptionOperandMantissa = 0x0000000000000000L;
8459: this.flg = (xf ^ yf) & M | I;
8460: } else {
8461: this.flg = (xf ^ yf) & M | ((xf & Z | yf & I) != 0 ? Z : I);
8462: }
8463: return this;
8464: }
8465:
8466: long r01 = x.dvl;
8467: long y01 = y.dvl;
8468: long r2 = (r01 << -2 | x.cvl >>> 2) >>> 33;
8469: long y2 = (y01 << -2 | y.cvl >>> 2) >>> 33;
8470: r01 >>>= 2;
8471: y01 >>>= 2;
8472: long y0 = y01 >>> 31;
8473: long y1 = y01 & 0x7fffffffL;
8474:
8475: boolean qq;
8476: if (r01 < y01 || (r01 == y01 && r2 < y2)) {
8477: qq = false;
8478: } else {
8479: qq = true;
8480: r2 -= y2;
8481: r01 -= y01;
8482: if (r2 < 0L) {
8483: r2 += 0x80000000L;
8484: r01--;
8485: }
8486: }
8487:
8488: long q0 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
8489: r01 = (r01 - q0 * y0 << 31) + r2 - q0 * y1;
8490: if (r01 < 0L) {
8491: q0--;
8492: r01 += y01;
8493: }
8494: r2 = q0 * y2 + 0x7fffffffL;
8495: r01 -= r2 >> 31;
8496: r2 = ~r2 & 0x7fffffffL;
8497: if (r01 < 0L) {
8498: q0--;
8499: r2 += y2;
8500: r01 += y01 + (r2 >> 31);
8501: r2 &= 0x7fffffffL;
8502: }
8503:
8504: long q1 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
8505: r01 = (r01 - q1 * y0 << 31) + r2 - q1 * y1;
8506: if (r01 < 0L) {
8507: q1--;
8508: r01 += y01;
8509: }
8510: r2 = q1 * y2 + 0x7fffffffL;
8511: r01 -= r2 >> 31;
8512: r2 = ~r2 & 0x7fffffffL;
8513: if (r01 < 0L) {
8514: q1--;
8515: r2 += y2;
8516: r01 += y01 + (r2 >> 31);
8517: r2 &= 0x7fffffffL;
8518: }
8519:
8520: long q2 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
8521: r01 = (r01 - q2 * y0 << 31) + r2 - q2 * y1;
8522: if (r01 < 0L) {
8523: q2--;
8524: r01 += y01;
8525: }
8526: r2 = q2 * y2 + 0x7fffffffL;
8527: r01 -= r2 >> 31;
8528: r2 = ~r2 & 0x7fffffffL;
8529: if (r01 < 0L) {
8530: q2--;
8531: r2 += y2;
8532: r01 += y01 + (r2 >> 31);
8533: r2 &= 0x7fffffffL;
8534: }
8535:
8536:
8537:
8538: int ze = x.epp - y.epp;
8539: if (qq) {
8540: q0 = MSB | q0 << 32 | q1 << 1 | q2 >>> 30;
8541: q2 <<= -30;
8542: } else {
8543: ze--;
8544: q0 = q0 << -31 | q1 << 2 | q2 >>> 29;
8545: q2 <<= -29;
8546: }
8547: return this.finish (xf ^ yf, ze, q0, q2, r01 | r2);
8548: }
8549:
8550:
8551:
8552:
8553:
8554:
8555:
8556:
8557:
8558:
8559:
8560: public boolean eq (EFP y) {
8561: int xf = this.flg;
8562: int yf = y.flg;
8563: return ((xf | yf) << 1 != 0 ?
8564: EFP_EQ_TABLE[xf >>> 28] << (yf >>> 28 - 1) < 0
8565: :
8566: xf == yf && this.epp == y.epp && this.dvl == y.dvl && this.cvl == y.cvl);
8567: }
8568:
8569:
8570:
8571:
8572:
8573:
8574:
8575:
8576:
8577:
8578:
8579:
8580: @Override public boolean equals (Object yo) {
8581: if (yo instanceof EFP) {
8582: EFP x = this;
8583: EFP y = (EFP) yo;
8584: return (x.flg == y.flg &&
8585: x.epp == y.epp &&
8586: x.dvl == y.dvl &&
8587: x.cvl == y.cvl);
8588: }
8589: return false;
8590: }
8591:
8592:
8593:
8594:
8595:
8596:
8597:
8598:
8599:
8600:
8601:
8602:
8603:
8604:
8605:
8606:
8607:
8608:
8609:
8610:
8611:
8612:
8613:
8614:
8615:
8616:
8617:
8618:
8619:
8620:
8621:
8622:
8623:
8624:
8625:
8626:
8627:
8628:
8629:
8630:
8631:
8632:
8633:
8634:
8635:
8636:
8637:
8638:
8639:
8640:
8641:
8642:
8643:
8644:
8645:
8646:
8647:
8648:
8649:
8650:
8651:
8652:
8653:
8654:
8655:
8656:
8657:
8658:
8659:
8660:
8661:
8662:
8663:
8664: public final EFP exp () {
8665: return this.exp (this);
8666: }
8667: public final EFP exp (EFP x) {
8668: int xf = x.flg;
8669: if (xf << 1 != 0) {
8670: if (xf << 1 < 0) {
8671:
8672: this.flg = P;
8673: this.epp = 0;
8674: this.dvl = MSB;
8675: this.cvl = 0L;
8676: } else {
8677: this.flg = (xf == (P | I) ? P | I :
8678: xf == (M | I) ? P | Z :
8679: N);
8680: }
8681: return this;
8682: }
8683:
8684: epbFpsr |= EPB_FPSR_X2;
8685: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
8686: epbExceptionOperandMantissa = x.dvl;
8687: if (15 <= x.epp) {
8688: if (xf < 0) {
8689: epbFpsr |= EPB_FPSR_UF;
8690: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
8691: } else {
8692: epbFpsr |= EPB_FPSR_OF;
8693: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
8694: }
8695: }
8696: if (false) {
8697: this.inner ();
8698: EFP s = new EFP (1);
8699: EFP t = new EFP (0);
8700: EFP u = new EFP (x);
8701:
8702: this.flg = s.flg;
8703: this.epp = s.epp;
8704: this.dvl = s.dvl;
8705: this.cvl = s.cvl;
8706: for (int k = 1; this.ne (t); k++) {
8707: s.imul (u).divi (k);
8708:
8709: t.flg = this.flg;
8710: t.epp = this.epp;
8711: t.dvl = this.dvl;
8712: t.cvl = this.cvl;
8713: this.iadd (s);
8714: }
8715: return this.outer ().finish ();
8716: } else if (false) {
8717: return this.pow (E, x);
8718: } else if (true) {
8719: this.inner ();
8720: if (this == x) {
8721: x = new EFP (x);
8722: }
8723: if (x.epp < -32) {
8724: this.imul (x, ONE_3).inc ().imul (x).idiv2 ().inc ().imul (x).outer ().inc ();
8725: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
8726: if (xf < 0) {
8727:
8728: if (this.flg << 1 == 0 && 0 <= this.epp) {
8729: this.set1 ().nextdown (epbRoundingPrec);
8730: }
8731: }
8732: } else if (epbRoundingMode == EPB_MODE_RP) {
8733:
8734: if (new EFP (this.flg, this.epp, this.dvl, this.cvl).dec ().le (x)) {
8735: this.inner ().inc(x).outer ().nextup (epbRoundingPrec);
8736: }
8737: }
8738: } else {
8739: this.imul (LOG2_E, x).outer ().exp2 ();
8740: }
8741: return this;
8742: } else if (false) {
8743: int xe = x.epp;
8744: if (xe < 0) {
8745: return this.inner ().imul (LOG2_E, x).outer ().exp2 ();
8746: }
8747:
8748: this.inner ();
8749: int o = (int) (x.dvl >>> ~xe);
8750: this.frac (x).imul (LOG2_E).exp2 ();
8751: EFP[] a = xf >= 0 ? EXP_P_I : EXP_M_I;
8752: for (int i = 0; o != 0; i++) {
8753: if ((o & 1) != 0) {
8754: this.imul (a[i]);
8755: }
8756: o >>>= 1;
8757: }
8758: return this.outer ().finish ();
8759: } else {
8760: int xe = x.epp;
8761: this.inner ();
8762: long xd = x.dvl;
8763: long xc = x.cvl;
8764: EFP u;
8765: if (false) {
8766: u = new EFP ().shl (x, 6).frac ().shr (6);
8767: } else {
8768: int uf = xf;
8769: int ue;
8770: long ud;
8771: long uc;
8772: int o = xe + 7;
8773: if (o <= 0) {
8774: ue = xe;
8775: ud = xd;
8776: uc = xc;
8777: } else if (o <= 63) {
8778: ue = -7;
8779: ud = xd << o | xc >>> -o;
8780: uc = xc << o;
8781: } else if (o <= LEN - 1) {
8782: ue = -7;
8783: ud = xc << o;
8784: uc = 0L;
8785: } else {
8786: ue = 0;
8787: ud = 0L;
8788: uc = 0L;
8789: }
8790: if (ud >= 0L) {
8791: if (ud != 0L) {
8792: o = Long.numberOfLeadingZeros (ud);
8793: ue -= o;
8794: ud = ud << o | uc >>> -o;
8795: uc <<= o;
8796: } else if (uc != 0L) {
8797: o = 64 + Long.numberOfLeadingZeros (uc);
8798: ue -= o;
8799: ud = uc << o;
8800: uc = 0L;
8801: } else {
8802: uf |= Z;
8803: }
8804: }
8805: u = new EFP (uf, ue, ud, uc);
8806: }
8807: this.imul (EXP_C10, u)
8808: .iadd (EXP_C9).imul (u)
8809: .iadd (EXP_C8).imul (u)
8810: .iadd (EXP_C7).imul (u)
8811: .iadd (EXP_C6).imul (u)
8812: .iadd (EXP_C5).imul (u)
8813: .iadd (EXP_C4).imul (u)
8814: .iadd (EXP_C3).imul (u)
8815: .iadd (EXP_C2).imul (u)
8816: .iadd (EXP_C1).imul (u)
8817:
8818: .inc ();
8819: if (xf >= 0) {
8820: if (xe >= 0) {
8821: this.imul (EXP_P_T[(int) (xd << xe + 1 >>> -6)]);
8822: int o = (int) (xd >>> ~xe);
8823: for (int i = 0; o != 0; i++) {
8824: if ((o & 1) != 0) {
8825: this.imul (EXP_P_I[i]);
8826: }
8827: o >>>= 1;
8828: }
8829: } else if (xe >= -6) {
8830: this.imul (EXP_P_T[(int) (xd >>> ~xe - 6)]);
8831: }
8832: } else {
8833: if (xe >= 0) {
8834: this.imul (EXP_M_T[(int) (xd << xe + 1 >>> -6)]);
8835: int o = (int) (xd >>> ~xe);
8836: for (int i = 0; o != 0; i++) {
8837: if ((o & 1) != 0) {
8838: this.imul (EXP_M_I[i]);
8839: }
8840: o >>>= 1;
8841: }
8842: } else if (xe >= -6) {
8843: this.imul (EXP_M_T[(int) (xd >>> ~xe - 6)]);
8844: }
8845: }
8846: return this.outer ().finish ();
8847: }
8848: }
8849:
8850:
8851:
8852:
8853:
8854:
8855:
8856:
8857:
8858:
8859:
8860:
8861:
8862:
8863:
8864:
8865:
8866:
8867:
8868:
8869:
8870:
8871:
8872:
8873:
8874:
8875:
8876:
8877:
8878:
8879:
8880:
8881:
8882:
8883:
8884:
8885:
8886:
8887:
8888:
8889:
8890:
8891:
8892:
8893:
8894:
8895:
8896:
8897:
8898:
8899:
8900:
8901:
8902:
8903:
8904:
8905:
8906:
8907:
8908:
8909:
8910:
8911:
8912:
8913:
8914:
8915:
8916:
8917:
8918:
8919:
8920:
8921:
8922:
8923:
8924:
8925:
8926:
8927:
8928:
8929:
8930:
8931:
8932: public final EFP exp10 () {
8933: return this.exp10 (this);
8934: }
8935: public final EFP exp10 (EFP x) {
8936: int xf = x.flg;
8937: if (xf << 1 != 0) {
8938: if (xf << 1 < 0) {
8939:
8940: this.flg = P;
8941: this.epp = 0;
8942: this.dvl = MSB;
8943: this.cvl = 0L;
8944: } else {
8945: this.flg = (xf == (P | I) ? P | I :
8946: xf == (M | I) ? P | Z :
8947: N);
8948: }
8949: return this;
8950: }
8951:
8952: epbFpsr |= EPB_FPSR_X2;
8953: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
8954: epbExceptionOperandMantissa = x.dvl;
8955: if (15 <= x.epp) {
8956: if (xf < 0) {
8957: epbFpsr |= EPB_FPSR_UF;
8958: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
8959: } else {
8960: epbFpsr |= EPB_FPSR_OF;
8961: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
8962: }
8963: }
8964: if (false) {
8965: return this.pow (TEN, x);
8966: } else if (false) {
8967: return this.inner ().imul (LOG_10, x).outer ().exp ();
8968: } else if (true) {
8969:
8970:
8971: return this.inner ().imul (LOG2_10, x).outer ().exp2 ();
8972: } else if (false) {
8973:
8974:
8975:
8976:
8977:
8978:
8979: this.inner ();
8980: EFP t = new EFP ().imul (LOG2_10A, x).exp2m1 ();
8981: this.imul (LOG2_10, x).exp2 ();
8982: t.imul (this);
8983: return this.outer ().add (t);
8984: } else if (false) {
8985: int xe = x.epp;
8986: this.inner ();
8987: if (xe < 0) {
8988: this.imul (LOG2_10, x).exp2 ();
8989: } else {
8990: int o = (int) (x.dvl >>> ~xe);
8991: this.frac (x).imul (LOG2_10).exp2 ();
8992: EFP[] a = xf >= 0 ? EXP10_P_I : EXP10_M_I;
8993: for (int i = 0; o != 0; i++) {
8994: if ((o & 1) != 0) {
8995: this.imul (a[i]);
8996: }
8997: o >>>= 1;
8998: }
8999: }
9000: return this.outer ().finish ();
9001: } else {
9002: int xe = x.epp;
9003: this.inner ();
9004: long xd = x.dvl;
9005: long xc = x.cvl;
9006: EFP u;
9007: if (false) {
9008: u = new EFP ().shl (x, 6).frac ().shr (6);
9009: } else {
9010: int uf = xf;
9011: int ue;
9012: long ud;
9013: long uc;
9014: int o = xe + 7;
9015: if (o <= 0) {
9016: ue = xe;
9017: ud = xd;
9018: uc = xc;
9019: } else if (o <= 63) {
9020: ue = -7;
9021: ud = xd << o | xc >>> -o;
9022: uc = xc << o;
9023: } else if (o <= LEN - 1) {
9024: ue = -7;
9025: ud = xc << o;
9026: uc = 0L;
9027: } else {
9028: ue = 0;
9029: ud = 0L;
9030: uc = 0L;
9031: }
9032: if (ud >= 0L) {
9033: if (ud != 0L) {
9034: o = Long.numberOfLeadingZeros (ud);
9035: ue -= o;
9036: ud = ud << o | uc >>> -o;
9037: uc <<= o;
9038: } else if (uc != 0L) {
9039: o = 64 + Long.numberOfLeadingZeros (uc);
9040: ue -= o;
9041: ud = uc << o;
9042: uc = 0L;
9043: } else {
9044: uf |= Z;
9045: }
9046: }
9047: u = new EFP (uf, ue, ud, uc);
9048: }
9049: this.imul (EXP10_C11, u)
9050: .iadd (EXP10_C10).imul (u)
9051: .iadd (EXP10_C9).imul (u)
9052: .iadd (EXP10_C8).imul (u)
9053: .iadd (EXP10_C7).imul (u)
9054: .iadd (EXP10_C6).imul (u)
9055: .iadd (EXP10_C5).imul (u)
9056: .iadd (EXP10_C4).imul (u)
9057: .iadd (EXP10_C3).imul (u)
9058: .iadd (EXP10_C2).imul (u)
9059: .iadd (EXP10_C1).imul (u)
9060:
9061: .inc ();
9062: if (xf >= 0) {
9063: if (xe >= 0) {
9064: this.imul (EXP10_P_T[(int) (xd << xe + 1 >>> -6)]);
9065: int o = (int) (xd >>> ~xe);
9066: for (int i = 0; o != 0; i++) {
9067: if ((o & 1) != 0) {
9068: this.imul (EXP10_P_I[i]);
9069: }
9070: o >>>= 1;
9071: }
9072: } else if (xe >= -6) {
9073: this.imul (EXP10_P_T[(int) (xd >>> ~xe - 6)]);
9074: }
9075: this.outer ().finish ();
9076: if (epbRoundingMode == EPB_MODE_RP) {
9077:
9078: if (this.flg << 1 == 0 && (this.epp < 0 ||
9079: this.epp == 0 && this.dvl == MSB && this.cvl == 0L)) {
9080: this.set1 ().nextup (epbRoundingPrec);
9081: }
9082: }
9083: } else {
9084: if (xe >= 0) {
9085: this.imul (EXP10_M_T[(int) (xd << xe + 1 >>> -6)]);
9086: int o = (int) (xd >>> ~xe);
9087: for (int i = 0; o != 0; i++) {
9088: if ((o & 1) != 0) {
9089: this.imul (EXP10_M_I[i]);
9090: }
9091: o >>>= 1;
9092: }
9093: } else if (xe >= -6) {
9094: this.imul (EXP10_M_T[(int) (xd >>> ~xe - 6)]);
9095: }
9096: this.outer ().finish ();
9097: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
9098:
9099: if (this.flg << 1 == 0 && 0 <= this.epp) {
9100: this.set1 ().nextdown (epbRoundingPrec);
9101: }
9102: }
9103: }
9104: return this;
9105: }
9106: }
9107:
9108:
9109:
9110:
9111:
9112:
9113:
9114:
9115:
9116:
9117:
9118:
9119:
9120:
9121:
9122:
9123:
9124:
9125:
9126:
9127:
9128:
9129:
9130:
9131:
9132:
9133:
9134:
9135:
9136:
9137:
9138:
9139:
9140:
9141:
9142:
9143:
9144:
9145:
9146:
9147:
9148:
9149:
9150:
9151:
9152:
9153:
9154:
9155:
9156:
9157:
9158:
9159:
9160:
9161:
9162:
9163:
9164:
9165:
9166:
9167:
9168:
9169:
9170:
9171:
9172:
9173:
9174:
9175:
9176:
9177:
9178:
9179:
9180:
9181:
9182:
9183:
9184:
9185:
9186:
9187:
9188:
9189:
9190:
9191:
9192:
9193:
9194:
9195:
9196:
9197:
9198:
9199:
9200:
9201:
9202:
9203:
9204:
9205:
9206:
9207:
9208:
9209:
9210:
9211:
9212:
9213:
9214:
9215:
9216:
9217:
9218:
9219:
9220:
9221: public final EFP exp2 () {
9222: return this.exp2 (this);
9223: }
9224: public final EFP exp2 (EFP x) {
9225: int xf = x.flg;
9226: if (xf << 1 != 0) {
9227: if (xf << 1 < 0) {
9228:
9229: this.flg = P;
9230: this.epp = 0;
9231: this.dvl = MSB;
9232: this.cvl = 0L;
9233: } else {
9234: this.flg = (xf == (P | I) ? P | I :
9235: xf == (M | I) ? P | Z :
9236: N);
9237: }
9238: return this;
9239: }
9240:
9241: epbFpsr |= EPB_FPSR_X2;
9242: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
9243: epbExceptionOperandMantissa = x.dvl;
9244: if (15 <= x.epp) {
9245: if (xf < 0) {
9246: epbFpsr |= EPB_FPSR_UF;
9247: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
9248: } else {
9249: epbFpsr |= EPB_FPSR_OF;
9250: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
9251: }
9252: }
9253: if (false) {
9254: return this.pow (TWO, x);
9255: } else if (false) {
9256: return this.inner ().imul (LOG_2, x).outer ().exp ();
9257: } else {
9258: int xe = x.epp;
9259: long xd = x.dvl;
9260: long xc = x.cvl;
9261: this.inner ();
9262: EFP u;
9263: if (false) {
9264: u = new EFP ().shl (x, 6).frac ().shr (6);
9265: } else {
9266: int uf = xf;
9267: int ue;
9268: long ud;
9269: long uc;
9270: int o = xe + 7;
9271: if (o <= 0) {
9272: ue = xe;
9273: ud = xd;
9274: uc = xc;
9275: } else if (o <= 63) {
9276: ue = -7;
9277: ud = xd << o | xc >>> -o;
9278: uc = xc << o;
9279: } else if (o <= LEN - 1) {
9280: ue = -7;
9281: ud = xc << o;
9282: uc = 0L;
9283: } else {
9284: ue = 0;
9285: ud = 0L;
9286: uc = 0L;
9287: }
9288: if (ud >= 0L) {
9289: if (ud != 0L) {
9290: o = Long.numberOfLeadingZeros (ud);
9291: ue -= o;
9292: ud = ud << o | uc >>> -o;
9293: uc <<= o;
9294: } else if (uc != 0L) {
9295: o = 64 + Long.numberOfLeadingZeros (uc);
9296: ue -= o;
9297: ud = uc << o;
9298: uc = 0L;
9299: } else {
9300: uf |= Z;
9301: }
9302: }
9303: u = new EFP (uf, ue, ud, uc);
9304: }
9305: if (xf >= 0) {
9306: this.imul (EXP2P_C8, u)
9307: .iadd (EXP2P_C7).imul (u)
9308: .iadd (EXP2P_C6).imul (u)
9309: .iadd (EXP2P_C5).imul (u)
9310: .iadd (EXP2P_C4).imul (u)
9311: .iadd (EXP2P_C3).imul (u)
9312: .iadd (EXP2P_C2).imul (u)
9313: .iadd (EXP2P_C1).imul (u)
9314:
9315: .inc ();
9316: if (xe >= 0) {
9317: this.imul (EXP2P_T[(int) (xd << xe + 1 >>> -6)]).shl ((int) (xd >>> ~xe));
9318: } else if (xe >= -6) {
9319: this.imul (EXP2P_T[(int) (xd >>> ~xe - 6)]);
9320: }
9321: this.outer ().finish ();
9322: if (epbRoundingMode == EPB_MODE_RP) {
9323:
9324: if (this.flg << 1 == 0 && (this.epp < 0 ||
9325: this.epp == 0 && this.dvl == MSB && this.cvl == 0L)) {
9326: this.set1 ().nextup (epbRoundingPrec);
9327: }
9328: }
9329: } else {
9330: this.imul (EXP2M_C8, u)
9331: .iadd (EXP2M_C7).imul (u)
9332: .iadd (EXP2M_C6).imul (u)
9333: .iadd (EXP2M_C5).imul (u)
9334: .iadd (EXP2M_C4).imul (u)
9335: .iadd (EXP2M_C3).imul (u)
9336: .iadd (EXP2M_C2).imul (u)
9337: .iadd (EXP2M_C1).imul (u)
9338:
9339: .inc ();
9340: if (xe >= 0) {
9341: this.imul (EXP2M_T[(int) (xd << xe + 1 >>> -6)]).shr ((int) (xd >>> ~xe));
9342: } else if (xe >= -6) {
9343: this.imul (EXP2M_T[(int) (xd >>> ~xe - 6)]);
9344: }
9345: this.outer ().finish ();
9346: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
9347:
9348: if (this.flg << 1 == 0 && 0 <= this.epp) {
9349: this.set1 ().nextdown (epbRoundingPrec);
9350: }
9351: }
9352: }
9353: return this;
9354: }
9355: }
9356:
9357:
9358:
9359:
9360:
9361:
9362:
9363:
9364:
9365:
9366:
9367:
9368:
9369:
9370:
9371:
9372:
9373:
9374:
9375:
9376:
9377:
9378:
9379:
9380:
9381:
9382:
9383:
9384:
9385:
9386:
9387:
9388:
9389:
9390:
9391:
9392:
9393:
9394:
9395:
9396:
9397:
9398:
9399:
9400:
9401:
9402:
9403:
9404:
9405:
9406:
9407:
9408:
9409:
9410:
9411:
9412:
9413:
9414:
9415:
9416:
9417:
9418:
9419:
9420:
9421:
9422:
9423:
9424:
9425:
9426:
9427:
9428:
9429:
9430:
9431:
9432:
9433:
9434:
9435:
9436:
9437:
9438:
9439:
9440:
9441:
9442:
9443:
9444:
9445:
9446:
9447:
9448:
9449:
9450:
9451: public final EFP exp2m1 () {
9452: return this.exp2m1 (this);
9453: }
9454: public final EFP exp2m1 (EFP x) {
9455: int xf = x.flg;
9456: if (xf << 1 != 0) {
9457: if (xf == (M | I)) {
9458: this.flg = M;
9459: this.epp = 0;
9460: this.dvl = MSB;
9461: this.cvl = 0L;
9462: } else {
9463: this.flg = xf;
9464: }
9465: return this;
9466: }
9467:
9468: epbFpsr |= EPB_FPSR_X2;
9469: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
9470: epbExceptionOperandMantissa = x.dvl;
9471: if (xf < 0) {
9472: if (8 <= x.epp) {
9473:
9474: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
9475: return this.sete (NEXTUP_MINUSONE[epbRoundingPrec]).finish ();
9476: } else {
9477: return this.negset1 ().finish ();
9478: }
9479: }
9480: } else {
9481: if (15 <= x.epp) {
9482: epbFpsr |= EPB_FPSR_OF;
9483: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
9484: }
9485: }
9486: int xe = x.epp;
9487: if (xe < -2) {
9488: this.inner ();
9489: if (this == x) {
9490: x = new EFP (x);
9491: }
9492: return this.imul (EXP2M1_C17, x)
9493: .iadd (EXP2M1_C16).imul (x)
9494: .iadd (EXP2M1_C15).imul (x)
9495: .iadd (EXP2M1_C14).imul (x)
9496: .iadd (EXP2M1_C13).imul (x)
9497: .iadd (EXP2M1_C12).imul (x)
9498: .iadd (EXP2M1_C11).imul (x)
9499: .iadd (EXP2M1_C10).imul (x)
9500: .iadd (EXP2M1_C9).imul (x)
9501: .iadd (EXP2M1_C8).imul (x)
9502: .iadd (EXP2M1_C7).imul (x)
9503: .iadd (EXP2M1_C6).imul (x)
9504: .iadd (EXP2M1_C5).imul (x)
9505: .iadd (EXP2M1_C4).imul (x)
9506: .iadd (EXP2M1_C3).imul (x)
9507: .iadd (EXP2M1_C2).imul (x)
9508: .iadd (EXP2M1_C1).outer ().mul (x);
9509: }
9510: int savedFpsr = epbFpsr;
9511: this.inner ().exp2 (x).outer ().dec ();
9512:
9513: if (this.flg << 1 == 0 && (this.flg < 0 && 0 <= this.epp)) {
9514: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
9515: this.sete (NEXTUP_MINUSONE[epbRoundingPrec]).finish ();
9516: }
9517: }
9518: return this.correctUnderflow (savedFpsr);
9519: }
9520:
9521:
9522:
9523:
9524:
9525:
9526:
9527:
9528:
9529:
9530:
9531:
9532:
9533:
9534:
9535:
9536:
9537:
9538:
9539:
9540:
9541:
9542:
9543:
9544:
9545:
9546:
9547:
9548:
9549:
9550:
9551:
9552:
9553:
9554:
9555:
9556:
9557:
9558:
9559:
9560:
9561:
9562:
9563:
9564:
9565:
9566:
9567:
9568:
9569:
9570:
9571:
9572:
9573:
9574:
9575:
9576:
9577:
9578:
9579:
9580:
9581:
9582:
9583:
9584:
9585:
9586:
9587:
9588:
9589:
9590:
9591:
9592:
9593:
9594:
9595:
9596:
9597:
9598:
9599:
9600: public final EFP expm1 () {
9601: return this.expm1 (this);
9602: }
9603: public final EFP expm1 (EFP x) {
9604: int xf = x.flg;
9605: if (xf << 1 != 0) {
9606: if (xf == (M | I)) {
9607: this.flg = M;
9608: this.epp = 0;
9609: this.dvl = MSB;
9610: this.cvl = 0L;
9611: } else {
9612: this.flg = xf;
9613: }
9614: return this;
9615: }
9616:
9617: epbFpsr |= EPB_FPSR_X2;
9618: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
9619: epbExceptionOperandMantissa = x.dvl;
9620: if (xf < 0) {
9621: if (8 <= x.epp) {
9622:
9623: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
9624: return this.sete (NEXTUP_MINUSONE[epbRoundingPrec]).finish ();
9625: } else {
9626: return this.negset1 ().finish ();
9627: }
9628: }
9629: } else {
9630: if (15 <= x.epp) {
9631: epbFpsr |= EPB_FPSR_OF;
9632: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1]).finish ();
9633: }
9634: }
9635: int savedFpsr = epbFpsr;
9636: this.inner ();
9637: if (x.epp < -2) {
9638: if (this == x) {
9639: x = new EFP (x);
9640: }
9641: this.imul (EXPM1_C18, x)
9642: .iadd (EXPM1_C17).imul (x)
9643: .iadd (EXPM1_C16).imul (x)
9644: .iadd (EXPM1_C15).imul (x)
9645: .iadd (EXPM1_C14).imul (x)
9646: .iadd (EXPM1_C13).imul (x)
9647: .iadd (EXPM1_C12).imul (x)
9648: .iadd (EXPM1_C11).imul (x)
9649: .iadd (EXPM1_C10).imul (x)
9650: .iadd (EXPM1_C9).imul (x)
9651: .iadd (EXPM1_C8).imul (x)
9652: .iadd (EXPM1_C7).imul (x)
9653: .iadd (EXPM1_C6).imul (x)
9654: .iadd (EXPM1_C5).imul (x)
9655: .iadd (EXPM1_C4).imul (x)
9656: .iadd (EXPM1_C3).imul (x)
9657: .iadd (EXPM1_C2).imul (x)
9658: .iadd (EXPM1_C1).outer ().mul (x);
9659: return this.originUpperUpper (x).correctUnderflow (savedFpsr);
9660: }
9661: return this.imul (LOG2_E, x).outer ().exp2m1 ();
9662: }
9663:
9664:
9665:
9666:
9667:
9668:
9669:
9670:
9671:
9672:
9673:
9674:
9675:
9676:
9677:
9678:
9679:
9680:
9681:
9682:
9683:
9684:
9685:
9686:
9687:
9688:
9689:
9690:
9691:
9692:
9693:
9694:
9695:
9696:
9697:
9698:
9699:
9700:
9701:
9702:
9703:
9704:
9705:
9706:
9707:
9708:
9709:
9710:
9711:
9712:
9713:
9714:
9715:
9716:
9717:
9718:
9719:
9720:
9721: public final EFP floor () {
9722: return this.floor (this);
9723: }
9724: public final EFP floor (EFP x) {
9725: int xf = x.flg;
9726: if (xf << 1 != 0) {
9727: this.flg = xf;
9728: return this;
9729: }
9730:
9731: int xe = x.epp;
9732: if (xe < 0) {
9733: epbFpsr |= EPB_FPSR_X2;
9734: if (xf >= 0) {
9735: this.flg = P | Z;
9736: } else {
9737: this.flg = M;
9738: this.epp = 0;
9739: this.dvl = MSB;
9740: this.cvl = 0L;
9741: }
9742: return this;
9743: }
9744:
9745: long xd = x.dvl;
9746: long xc = x.cvl;
9747: long m = MSB >> xe;
9748: if (xf >= 0) {
9749: if (xe <= 63) {
9750: if ((xd & ~m | xc) != 0L) {
9751: epbFpsr |= EPB_FPSR_X2;
9752: xd &= m;
9753: xc = 0L;
9754: }
9755: } else if (xe <= LEN - 2) {
9756: if ((xc & ~m) != 0L) {
9757: epbFpsr |= EPB_FPSR_X2;
9758: xc &= m;
9759: }
9760: }
9761:
9762: } else {
9763: if (xe <= 63) {
9764: long t = xd;
9765: xd &= m;
9766: if (((t ^ xd) | xc) != 0L) {
9767: epbFpsr |= EPB_FPSR_X2;
9768: xd -= m;
9769: if (xd >= 0L) {
9770: xd = MSB;
9771: xe++;
9772: if ((short) xe != xe) {
9773: epbFpsr |= EPB_FPSR_OF;
9774: epbExceptionOperandExponent = xf;
9775: epbExceptionOperandMantissa = xd;
9776: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | 1]).finish ();
9777: }
9778: }
9779: xc = 0L;
9780: }
9781:
9782: } else if (xe <= LEN - 2) {
9783: long t = xc;
9784: xc &= m;
9785: if ((t ^ xc) != 0L) {
9786: epbFpsr |= EPB_FPSR_X2;
9787: xc -= m;
9788: if ((t ^ xc) < 0L) {
9789: xd++;
9790: if (xd >= 0L) {
9791: xd = MSB;
9792: xe++;
9793: if ((short) xe != xe) {
9794: epbFpsr |= EPB_FPSR_OF;
9795: epbExceptionOperandExponent = xf;
9796: epbExceptionOperandMantissa = xd;
9797: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | 1]).finish ();
9798: }
9799: }
9800: }
9801: }
9802: }
9803:
9804: }
9805: return this.finish (xf, xe, xd, xc, 0L);
9806: }
9807:
9808:
9809:
9810:
9811:
9812:
9813:
9814:
9815:
9816:
9817:
9818:
9819:
9820:
9821:
9822:
9823:
9824:
9825:
9826:
9827:
9828:
9829:
9830:
9831:
9832:
9833:
9834:
9835:
9836:
9837:
9838:
9839:
9840:
9841:
9842:
9843:
9844:
9845:
9846:
9847:
9848:
9849:
9850:
9851:
9852:
9853:
9854:
9855:
9856:
9857:
9858:
9859:
9860:
9861:
9862:
9863:
9864:
9865:
9866:
9867:
9868:
9869:
9870:
9871:
9872: public final EFP frac () {
9873: return this.frac (this);
9874: }
9875: public final EFP frac (EFP x) {
9876: int xf = x.flg;
9877: if (xf << 1 != 0) {
9878: this.flg = xf << 2 != 0 ? N : xf;
9879: return this;
9880: }
9881:
9882: int xe = x.epp;
9883: if (xe >= LEN - 1) {
9884: this.flg = xf | Z;
9885: return this;
9886: }
9887: long xd = x.dvl;
9888: long xc = x.cvl;
9889: if (xe >= 0) {
9890: if (xe < 63) {
9891: xe++;
9892: xd = xd << xe | xc >>> -xe;
9893: xc <<= xe;
9894: if (xd != 0L) {
9895: xe = Long.numberOfLeadingZeros (xd);
9896: if (xe > 0) {
9897: xd = xd << xe | xc >>> -xe;
9898: xc <<= xe;
9899: }
9900: xe = ~xe;
9901: } else if (xc != 0L) {
9902: xe = Long.numberOfLeadingZeros (xc);
9903: xd = xc << xe;
9904: xc = 0L;
9905: xe = -65 - xe;
9906: } else {
9907: this.flg = xf | Z;
9908: return this;
9909: }
9910: } else {
9911: xe++;
9912: xc <<= xe;
9913: if (xc != 0L) {
9914: xe = Long.numberOfLeadingZeros (xc);
9915: xd = xc << xe;
9916: xc = 0L;
9917: xe = ~xe;
9918: } else {
9919: this.flg = xf | Z;
9920: return this;
9921: }
9922: }
9923: }
9924: this.flg = xf;
9925: this.epp = xe;
9926: this.dvl = xd;
9927: this.cvl = xc;
9928: return this;
9929: }
9930:
9931:
9932:
9933:
9934:
9935:
9936:
9937:
9938:
9939:
9940:
9941: public boolean ge (EFP y) {
9942: int xf = this.flg;
9943: int yf = y.flg;
9944: if ((xf | yf) << 1 != 0) {
9945: return EFP_GE_TABLE[xf >>> 28] << (yf >>> 28 - 1) < 0;
9946: }
9947:
9948: if (xf != yf) {
9949: return xf > yf;
9950: }
9951:
9952: int s;
9953: long t;
9954: return (xf >= 0 ? 1 : -1) * ((s = this.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
9955: (t = this.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
9956: (t = (this.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
9957: 0) >= 0;
9958: }
9959:
9960:
9961:
9962:
9963:
9964:
9965:
9966:
9967:
9968:
9969:
9970:
9971: public int getb () {
9972: int xf = this.flg;
9973: if (xf << 1 != 0) {
9974: if (xf << 1 < 0) {
9975: return 0;
9976: } else if (xf << 2 < 0) {
9977: epbFpsr |= EPB_FPSR_OE;
9978: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
9979: epbExceptionOperandMantissa = 0x0000000000000000L;
9980: return xf >> 31 ^ 0x0000007f;
9981: } else {
9982: epbFpsr |= EPB_FPSR_OE | EPB_FPSR_AV;
9983: epbExceptionOperandExponent = 0x7fff << 16;
9984: epbExceptionOperandMantissa = 0xffffffffffffffffL;
9985: return -1;
9986: }
9987: }
9988:
9989: int xe = this.epp;
9990: long xd = this.dvl;
9991: long xc = this.cvl;
9992: if (xe < 0) {
9993: if (false) {
9994: epbFpsr |= EPB_FPSR_X2;
9995: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
9996: epbExceptionOperandMantissa = xd;
9997: }
9998: return 0;
9999: }
10000:
10001: if (xe < 7) {
10002: if (false) {
10003: if ((xd << 1 + xe | xc) != 0L) {
10004: epbFpsr |= EPB_FPSR_X2;
10005: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
10006: epbExceptionOperandMantissa = xd;
10007: }
10008: }
10009: return xf >= 0 ? (int) (xd >>> ~xe) : -(int) (xd >>> ~xe);
10010: }
10011:
10012: if (xf >= 0) {
10013: epbFpsr |= EPB_FPSR_OE;
10014: epbExceptionOperandExponent = 0x3fff + xe << 16;
10015: epbExceptionOperandMantissa = xd;
10016: return 0x0000007f;
10017: }
10018:
10019: if (xe != 7 || xd != MSB || xc != 0L) {
10020: epbFpsr |= EPB_FPSR_OE;
10021: epbExceptionOperandExponent = M | 0x3fff + xe << 16;
10022: epbExceptionOperandMantissa = this.dvl;
10023: }
10024: return 0xffffff80;
10025: }
10026: public int getb (int roundingMode) {
10027: return (roundingMode == EPB_MODE_RN ? new EFP ().inner ().rint (this).outer ().getb () :
10028: roundingMode == EPB_MODE_RM ? new EFP ().inner ().floor (this).outer ().getb () :
10029: roundingMode == EPB_MODE_RP ? new EFP ().inner ().ceil (this).outer ().getb () :
10030: new EFP ().inner ().trunc (this).outer ().getb ());
10031: }
10032:
10033:
10034:
10035:
10036:
10037:
10038:
10039:
10040:
10041:
10042:
10043:
10044:
10045:
10046:
10047:
10048:
10049:
10050:
10051:
10052:
10053:
10054:
10055:
10056:
10057:
10058:
10059:
10060:
10061:
10062:
10063:
10064:
10065:
10066:
10067:
10068:
10069:
10070:
10071:
10072:
10073:
10074:
10075:
10076:
10077:
10078:
10079: public double getd () {
10080: return Double.longBitsToDouble (this.getd01 (EPB_MODE_RN));
10081: }
10082: public double getd (int roundingMode) {
10083: return Double.longBitsToDouble (this.getd01 (roundingMode));
10084: }
10085: public long getd01 () {
10086: return this.getd01 (EPB_MODE_RN);
10087: }
10088: public long getd01 (int roundingMode) {
10089: int xf = this.flg;
10090: if (xf << 1 != 0) {
10091: return (xf << 1 < 0 ? 0 <= xf ? 0x0000000000000000L : 0x8000000000000000L :
10092: xf << 2 < 0 ? 0 <= xf ? 0x7ff0000000000000L : 0xfff0000000000000L :
10093: EFP_FPCP_NAN ? 0x7fffffffffffffffL : 0x7ff8000000000000L);
10094: }
10095:
10096: int xe = this.epp;
10097: long xd = this.dvl;
10098: long xc = this.cvl;
10099: if (xe < -1075) {
10100: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
10101: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10102: epbExceptionOperandMantissa = xd;
10103: return (0 <= xf ?
10104: roundingMode == EPB_MODE_RP ? 0x0000000000000001L : 0x0000000000000000L :
10105: roundingMode == EPB_MODE_RM ? 0x8000000000000001L : 0x8000000000000000L);
10106: }
10107: if (1023 < xe) {
10108: if (true) {
10109: epbFpsr |= EPB_FPSR_OF;
10110: if ((xd << 53 | xc) != 0L) {
10111: epbFpsr |= EPB_FPSR_X2;
10112: }
10113: } else {
10114: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
10115: }
10116: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
10117: epbExceptionOperandMantissa = xd;
10118: return (0 <= xf ?
10119: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RM ? 0x7fefffffffffffffL : 0x7ff0000000000000L :
10120: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RP ? 0xffefffffffffffffL : 0xfff0000000000000L);
10121: }
10122: long xb = 0L;
10123: int o = xe <= -1023 ? 11 + -1022 - xe : 11;
10124: if (o < 64) {
10125: xb = xc << -o;
10126: xc = xd << -o | xc >>> o;
10127: xd >>>= o;
10128: } else {
10129: xb = xc;
10130: xc = xd;
10131: xd = 0L;
10132: }
10133: if ((xc | xb) != 0L) {
10134: epbFpsr |= EPB_FPSR_X2;
10135: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
10136: roundingMode == EPB_MODE_RM && xf < 0 ||
10137: roundingMode == EPB_MODE_RP && 0 <= xf) {
10138: xd++;
10139: if (xd >>> 53 != 0L) {
10140: xd = 1L << 52;
10141: xe++;
10142: if (1023 < xe) {
10143: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
10144: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
10145: epbExceptionOperandMantissa = xd;
10146: return (0 <= xf ?
10147: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RM ? 0x7fefffffffffffffL : 0x7ff0000000000000L :
10148: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RP ? 0xffefffffffffffffL : 0xfff0000000000000L);
10149: }
10150: } else if (11 < o) {
10151: if (xd << o - 1 < 0L) {
10152: xe++;
10153:
10154: if (xe == -1022) {
10155:
10156: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
10157: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10158: epbExceptionOperandMantissa = xd;
10159: }
10160:
10161: }
10162: }
10163: }
10164:
10165: if (xe <= -1023) {
10166: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
10167: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10168: epbExceptionOperandMantissa = xd;
10169: if (xd == 0L) {
10170: return (0 <= xf ?
10171: roundingMode == EPB_MODE_RP ? 0x0000000000000001L : 0x0000000000000000L :
10172: roundingMode == EPB_MODE_RM ? 0x8000000000000001L : 0x8000000000000000L);
10173: }
10174: }
10175: } else {
10176: if (xe <= -1023) {
10177: epbFpsr |= EPB_FPSR_UF;
10178: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10179: epbExceptionOperandMantissa = xd;
10180: if (xd == 0L) {
10181: return (0 <= xf ?
10182: roundingMode == EPB_MODE_RP ? 0x0000000000000001L : 0x0000000000000000L :
10183: roundingMode == EPB_MODE_RM ? 0x8000000000000001L : 0x8000000000000000L);
10184: }
10185: }
10186: }
10187: return ((long) (xf | Math.max (0, xe + 1023) << 52 - 32) << 32 |
10188: xd & ((1L << 52) - 1L));
10189: }
10190: public long getd01 (byte[] b, int a) {
10191: long l = this.getd01 (EPB_MODE_RN);
10192: b[a ] = (byte) (l >>> 56);
10193: b[a + 1] = (byte) (l >>> 48);
10194: b[a + 2] = (byte) (l >>> 40);
10195: b[a + 3] = (byte) (l >>> 32);
10196: b[a + 4] = (byte) (l >>> 24);
10197: b[a + 5] = (byte) (l >>> 16);
10198: b[a + 6] = (byte) (l >>> 8);
10199: b[a + 7] = (byte) l;
10200: return l;
10201: }
10202: public long getd01 (byte[] b, int a, int roundingMode) {
10203: long l = this.getd01 (roundingMode);
10204: b[a ] = (byte) (l >>> 56);
10205: b[a + 1] = (byte) (l >>> 48);
10206: b[a + 2] = (byte) (l >>> 40);
10207: b[a + 3] = (byte) (l >>> 32);
10208: b[a + 4] = (byte) (l >>> 24);
10209: b[a + 5] = (byte) (l >>> 16);
10210: b[a + 6] = (byte) (l >>> 8);
10211: b[a + 7] = (byte) l;
10212: return l;
10213: }
10214:
10215:
10216:
10217:
10218:
10219:
10220:
10221:
10222: public final EFP getexp () {
10223: return this.getexp (this);
10224: }
10225: public final EFP getexp (EFP x) {
10226: int xf = x.flg;
10227: if (xf << 1 != 0) {
10228: if (xf << 2 < 0) {
10229: epbFpsr |= EPB_FPSR_OE;
10230: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
10231: epbExceptionOperandMantissa = 0x0000000000000000L;
10232: this.flg = N;
10233: } else {
10234: this.flg = xf;
10235: }
10236: return this;
10237: }
10238: return this.seti (x.epp);
10239: }
10240:
10241:
10242:
10243:
10244:
10245:
10246:
10247:
10248:
10249:
10250:
10251:
10252:
10253:
10254:
10255:
10256:
10257:
10258:
10259:
10260:
10261:
10262:
10263:
10264:
10265:
10266:
10267:
10268:
10269:
10270:
10271:
10272:
10273:
10274:
10275:
10276:
10277:
10278:
10279:
10280:
10281:
10282:
10283:
10284:
10285:
10286:
10287: public float getf () {
10288: return Float.intBitsToFloat (this.getf0 (EPB_MODE_RN));
10289: }
10290: public float getf (int roundingMode) {
10291: return Float.intBitsToFloat (this.getf0 (roundingMode));
10292: }
10293: public int getf0 () {
10294: return this.getf0 (EPB_MODE_RN);
10295: }
10296: public int getf0 (int roundingMode) {
10297: int xf = this.flg;
10298: if (xf << 1 != 0) {
10299: return (xf << 1 < 0 ? xf & M :
10300: xf << 2 < 0 ? (xf & M) | 0x7f800000 :
10301: EFP_FPCP_NAN ? 0x7fffffff : 0x7fc00000);
10302: }
10303:
10304: int xe = this.epp;
10305: long xd = this.dvl;
10306: long xc = this.cvl;
10307: if (xe < -150) {
10308: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
10309: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10310: epbExceptionOperandMantissa = xd;
10311: return (0 <= xf ?
10312: roundingMode == EPB_MODE_RP ? 0x00000001 : 0x00000000 :
10313: roundingMode == EPB_MODE_RM ? 0x80000001 : 0x80000000);
10314: }
10315: if (127 < xe) {
10316: if (true) {
10317: epbFpsr |= EPB_FPSR_OF;
10318: if ((xd << 24 | xc) != 0L) {
10319: epbFpsr |= EPB_FPSR_X2;
10320: }
10321: } else {
10322: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
10323: }
10324: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
10325: epbExceptionOperandMantissa = xd;
10326: return (0 <= xf ?
10327: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RM ? 0x7f7fffff : 0x7f800000 :
10328: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RP ? 0xff7fffff : 0xff800000);
10329: }
10330: long xb = 0L;
10331: int o = xe <= -127 ? 40 + -126 - xe : 40;
10332: if (o < 64) {
10333: xb = xc << -o;
10334: xc = xd << -o | xc >>> o;
10335: xd >>>= o;
10336: } else {
10337: xb = xc;
10338: xc = xd;
10339: xd = 0L;
10340: }
10341: if ((xc | xb) != 0L) {
10342: epbFpsr |= EPB_FPSR_X2;
10343: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << -1 | xc << 1 | xb) != 0L ||
10344: roundingMode == EPB_MODE_RM && xf < 0 ||
10345: roundingMode == EPB_MODE_RP && 0 <= xf) {
10346: xd++;
10347: if (xd >>> 24 != 0L) {
10348: xd = 1L << 23;
10349: xe++;
10350: if (127 < xe) {
10351: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
10352: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
10353: epbExceptionOperandMantissa = xd;
10354: return (0 <= xf ?
10355: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RM ? 0x7f7fffff : 0x7f800000 :
10356: roundingMode == EPB_MODE_RZ || roundingMode == EPB_MODE_RP ? 0xff7fffff : 0xff800000);
10357: }
10358: } else if (40 < o) {
10359: if (xd << o - 1 < 0L) {
10360: xe++;
10361:
10362: if (xe == -126) {
10363:
10364: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
10365: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10366: epbExceptionOperandMantissa = xd;
10367: }
10368:
10369: }
10370: }
10371: }
10372:
10373: if (xe <= -127) {
10374: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
10375: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10376: epbExceptionOperandMantissa = xd;
10377: if (xd == 0L) {
10378: return (0 <= xf ?
10379: roundingMode == EPB_MODE_RP ? 0x00000001 : 0x00000000 :
10380: roundingMode == EPB_MODE_RM ? 0x80000001 : 0x80000000);
10381: }
10382: }
10383: } else {
10384: if (xe <= -127) {
10385: epbFpsr |= EPB_FPSR_UF;
10386: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
10387: epbExceptionOperandMantissa = xd;
10388: if (xd == 0L) {
10389: return (0 <= xf ?
10390: roundingMode == EPB_MODE_RP ? 0x00000001 : 0x00000000 :
10391: roundingMode == EPB_MODE_RM ? 0x80000001 : 0x80000000);
10392: }
10393: }
10394: }
10395: return (xf | Math.max (0, xe + 127) << 23 |
10396: (int) xd & ((1 << 23) - 1));
10397: }
10398: public int getf0 (byte[] b, int a) {
10399: int i = this.getf0 (EPB_MODE_RN);
10400: b[a ] = (byte) (i >>> 24);
10401: b[a + 1] = (byte) (i >>> 16);
10402: b[a + 2] = (byte) (i >>> 8);
10403: b[a + 3] = (byte) i;
10404: return i;
10405: }
10406: public int getf0 (byte[] b, int a, int roundingMode) {
10407: int i = this.getf0 (roundingMode);
10408: b[a ] = (byte) (i >>> 24);
10409: b[a + 1] = (byte) (i >>> 16);
10410: b[a + 2] = (byte) (i >>> 8);
10411: b[a + 3] = (byte) i;
10412: return i;
10413: }
10414:
10415:
10416:
10417:
10418:
10419:
10420:
10421:
10422:
10423:
10424: public int geti () {
10425: int xf = this.flg;
10426: if (xf << 1 != 0) {
10427: if (xf << 1 < 0) {
10428: return 0;
10429: } else if (xf << 2 < 0) {
10430: epbFpsr |= EPB_FPSR_OE;
10431: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
10432: epbExceptionOperandMantissa = 0x0000000000000000L;
10433: return xf >> 31 ^ 0x7fffffff;
10434: } else {
10435: epbFpsr |= EPB_FPSR_OE | EPB_FPSR_AV;
10436: epbExceptionOperandExponent = 0x7fff << 16;
10437: epbExceptionOperandMantissa = 0xffffffffffffffffL;
10438: return -1;
10439: }
10440: }
10441:
10442: int xe = this.epp;
10443: long xd = this.dvl;
10444: long xc = this.cvl;
10445: if (xe < 0) {
10446: if (false) {
10447: epbFpsr |= EPB_FPSR_X2;
10448: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
10449: epbExceptionOperandMantissa = xd;
10450: }
10451: return 0;
10452: }
10453:
10454: if (xe < 31) {
10455: if (false) {
10456: if ((xd << 1 + xe | xc) != 0L) {
10457: epbFpsr |= EPB_FPSR_X2;
10458: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
10459: epbExceptionOperandMantissa = xd;
10460: }
10461: }
10462: return xf >= 0 ? (int) (xd >>> ~xe) : -(int) (xd >>> ~xe);
10463: }
10464:
10465: if (xf >= 0) {
10466: epbFpsr |= EPB_FPSR_OE;
10467: epbExceptionOperandExponent = 0x3fff + xe << 16;
10468: epbExceptionOperandMantissa = xd;
10469: return 0x7fffffff;
10470: }
10471:
10472: if (xe != 31 || xd != MSB || xc != 0L) {
10473: epbFpsr |= EPB_FPSR_OE;
10474: epbExceptionOperandExponent = M | 0x3fff + xe << 16;
10475: epbExceptionOperandMantissa = this.dvl;
10476: }
10477: return 0x80000000;
10478: }
10479: public int geti (int roundingMode) {
10480: return (roundingMode == EPB_MODE_RN ? new EFP ().inner ().rint (this).outer ().geti () :
10481: roundingMode == EPB_MODE_RM ? new EFP ().inner ().floor (this).outer ().geti () :
10482: roundingMode == EPB_MODE_RP ? new EFP ().inner ().ceil (this).outer ().geti () :
10483: new EFP ().inner ().trunc (this).outer ().geti ());
10484: }
10485:
10486:
10487:
10488:
10489:
10490:
10491: public int geti32 () {
10492: int xf = this.flg;
10493: if (xf << 1 != 0) {
10494: return 0;
10495: }
10496: int t = this.geti32abs ();
10497: return xf < 0 ? -t : t;
10498: }
10499:
10500:
10501:
10502:
10503:
10504:
10505: public int geti32abs () {
10506: int xf = this.flg;
10507: if (xf << 1 != 0) {
10508: return 0;
10509: }
10510:
10511:
10512:
10513:
10514:
10515:
10516:
10517:
10518:
10519:
10520:
10521:
10522:
10523:
10524:
10525:
10526:
10527:
10528:
10529:
10530:
10531:
10532:
10533: int xe = this.epp;
10534: long xd = this.dvl;
10535: long xc = this.cvl;
10536: return (xe <= -1 ? 0 :
10537: xe <= 63 ? (int) (xd >>> (63 - xe)) :
10538: xe <= 94 ? (int) (xd << (xe - 63) | xc >>> (127 - xe)) :
10539: xe <= 126 ? (int) (xc >>> (127 - xe)) :
10540: xe <= 158 ? (int) (xc << (xe - 127)) :
10541: 0);
10542: }
10543:
10544:
10545:
10546:
10547:
10548:
10549: public long geti64 () {
10550: int xf = this.flg;
10551: if (xf << 1 != 0) {
10552: return 0L;
10553: }
10554: long t = this.geti64abs ();
10555: return xf < 0 ? -t : t;
10556: }
10557:
10558:
10559:
10560:
10561:
10562:
10563: public long geti64abs () {
10564: int xf = this.flg;
10565: if (xf << 1 != 0) {
10566: return 0L;
10567: }
10568:
10569:
10570:
10571:
10572:
10573:
10574:
10575:
10576:
10577:
10578:
10579:
10580:
10581:
10582:
10583:
10584:
10585:
10586:
10587:
10588:
10589:
10590:
10591: int xe = this.epp;
10592: long xd = this.dvl;
10593: long xc = this.cvl;
10594: return (xe <= -1 ? 0L :
10595: xe <= 63 ? (xd >>> (63 - xe)) :
10596: xe <= 126 ? (xd << (xe - 63) | xc >>> (127 - xe)) :
10597: xe <= 190 ? (xc << (xe - 127)) :
10598: 0L);
10599: }
10600:
10601:
10602:
10603:
10604:
10605:
10606:
10607:
10608:
10609: public long getl () {
10610: int xf = this.flg;
10611: if (xf << 1 != 0) {
10612: if (xf << 1 < 0) {
10613: return 0L;
10614: } else if (xf << 2 < 0) {
10615: epbFpsr |= EPB_FPSR_OE;
10616: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
10617: epbExceptionOperandMantissa = 0x0000000000000000L;
10618: return xf < 0 ? MSB : ~MSB;
10619: } else {
10620: epbFpsr |= EPB_FPSR_OE;
10621: epbExceptionOperandExponent = 0x7fff << 16;
10622: epbExceptionOperandMantissa = 0xffffffffffffffffL;
10623: return 0L;
10624: }
10625: }
10626:
10627: int xe = this.epp;
10628: if (xe < 0) {
10629: return 0L;
10630: }
10631:
10632: if (xe < 63) {
10633: return xf >= 0 ? this.dvl >>> ~xe : -(this.dvl >>> ~xe);
10634: }
10635:
10636: if (xf >= 0) {
10637: epbFpsr |= EPB_FPSR_OE;
10638: epbExceptionOperandExponent = 0x3fff + xe << 16;
10639: epbExceptionOperandMantissa = this.dvl;
10640: return 0x7fffffffffffffffL;
10641: }
10642:
10643: if (xe != 63 || this.dvl != MSB || this.cvl != 0L) {
10644: epbFpsr |= EPB_FPSR_OE;
10645: epbExceptionOperandExponent = M | 0x3fff + xe << 16;
10646: epbExceptionOperandMantissa = this.dvl;
10647: }
10648: return 0x8000000000000000L;
10649: }
10650: public long getl (int roundingMode) {
10651: return (roundingMode == EPB_MODE_RN ? new EFP ().inner ().rint (this).outer ().getl () :
10652: roundingMode == EPB_MODE_RM ? new EFP ().inner ().floor (this).outer ().getl () :
10653: roundingMode == EPB_MODE_RP ? new EFP ().inner ().ceil (this).outer ().getl () :
10654: this.getl ());
10655: }
10656:
10657:
10658:
10659:
10660:
10661:
10662:
10663:
10664: public final EFP getman () {
10665: return this.getman (this);
10666: }
10667: public final EFP getman (EFP x) {
10668: int xf = x.flg;
10669: if (xf << 1 != 0) {
10670: if (xf << 2 < 0) {
10671: epbFpsr |= EPB_FPSR_OE;
10672: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
10673: epbExceptionOperandMantissa = 0x0000000000000000L;
10674: this.flg = N;
10675: } else {
10676: this.flg = xf;
10677: }
10678: return this;
10679: }
10680: this.flg = xf;
10681: this.epp = 0;
10682: this.dvl = x.dvl;
10683: this.cvl = x.cvl;
10684: return this;
10685: }
10686:
10687:
10688:
10689:
10690:
10691:
10692:
10693:
10694:
10695:
10696:
10697:
10698:
10699:
10700:
10701:
10702:
10703:
10704:
10705:
10706:
10707:
10708: public void getp012 (byte[] b, int a) {
10709: getp012 (b, a, 17);
10710: }
10711: public void getp012 (byte[] b, int a, int k) {
10712: k = k << -7 >> -7;
10713: int u;
10714: long v;
10715: int xf = this.flg;
10716: if (xf << 1 != 0) {
10717: if (xf << 1 < 0) {
10718: u = xf & M;
10719: v = 0L;
10720: } else if (xf << 2 < 0) {
10721: u = (xf & M) | 0x7fff0000;
10722: v = 0L;
10723: } else {
10724: u = 0x7fff0000;
10725: v = 0xffffffffffffffffL;
10726: }
10727: } else {
10728: if (k > 17) {
10729: epbFpsr |= EPB_FPSR_OE;
10730: epbExceptionOperandExponent = this.flg & M | 0x3fff + this.epp << 16;
10731: epbExceptionOperandMantissa = this.dvl;
10732: k = 17;
10733: }
10734:
10735:
10736:
10737:
10738:
10739:
10740:
10741:
10742:
10743:
10744: int xe = this.epp;
10745: long xd = this.dvl;
10746: long xc = this.cvl;
10747: EFP x = new EFP (P, xe, xd, xc);
10748: int savedFpsr = epbFpsr;
10749: this.inner ();
10750:
10751:
10752:
10753:
10754:
10755:
10756: int e = (int) Math.floor (0.30102999566398119521373889472449302677 * xe);
10757:
10758:
10759: if (e < 0) {
10760: int o = -e;
10761: EFP t = new EFP (ONE);
10762: for (int i = 0; o != 0; i++, o >>>= 1) {
10763: if ((o & 1) != 0) {
10764: t.imul (EFP_TEN_POWER_P[i]);
10765: }
10766: }
10767: x.imul (t);
10768: } else if (e <= 18) {
10769: e = 0;
10770: } else {
10771: int o = e -= 18;
10772: EFP t = new EFP (ONE);
10773: for (int i = 0; o != 0; i++, o >>>= 1) {
10774: if ((o & 1) != 0) {
10775: t.imul (EFP_TEN_POWER_P[i]);
10776: }
10777: }
10778: x.div (t);
10779: }
10780:
10781:
10782:
10783: u = 0;
10784: v = 0L;
10785: if (0 <= x.epp) {
10786:
10787: long s, t;
10788: if (x.epp <= 63) {
10789: s = 0L;
10790: t = x.dvl >>> ~x.epp;
10791: } else {
10792: s = 1L;
10793: t = x.dvl << 1 | x.cvl >>> -1;
10794: }
10795:
10796: long r = s << 32 | t >>> 32;
10797: s = r / 10000L;
10798: r = r - s * 10000L << 32 | t & 0xffffffffL;
10799: t = r / 10000L;
10800: v = XEiJ.FMT_BCD4[(int) (r - t * 10000L)];
10801: t = XEiJ.fmtBcd16 (s << 32 | t);
10802: u = (int) (t >>> 48);
10803: v |= t << 16;
10804: }
10805:
10806:
10807: while ((u & 0xfffffff0) == 0) {
10808: u = u << 16 | (int) (v >>> -16);
10809: v = v << 16 | XEiJ.FMT_BCD4[x.frac ().muli (10000).geti32abs ()];
10810: e -= 4;
10811: }
10812: long rest = x.frac ().iszero () ? 0L : 1L;
10813: this.outer ();
10814: epbFpsr = savedFpsr;
10815:
10816:
10817:
10818:
10819:
10820:
10821: int w = 24 - (Integer.numberOfLeadingZeros (u) >>> 2);
10822:
10823:
10824: if (k <= 0) {
10825:
10826:
10827:
10828:
10829: k = Math.max (1, Math.min (17, w + e - k));
10830: }
10831:
10832: int i = w - k - 1 << 2;
10833: if (0 < i) {
10834: if (i < 64) {
10835: long mask = -1L << i;
10836: rest |= v & ~mask;
10837: v &= mask;
10838: } else {
10839: int mask = -1 << i - 64;
10840: rest |= (long) (u & ~mask) | v;
10841: u &= mask;
10842: v = 0L;
10843: }
10844: }
10845:
10846: int d = (i < 64 ? (int) (v >>> i) : u >>> i - 64) & 15;
10847: if (d != 0 || rest != 0L) {
10848: epbFpsr |= EPB_FPSR_X2;
10849: epbExceptionOperandExponent = xf & M | 0x3fff + xe << 16;
10850: epbExceptionOperandMantissa = xd;
10851: if (i < 64) {
10852: v &= ~(15L << i);
10853: } else {
10854: u &= ~(15 << i);
10855: }
10856: i += 4;
10857: if ((epbRoundingMode == EPB_MODE_RN &&
10858: (5 < d ||
10859: (d == 5 && (rest != 0L ||
10860: ((i < 64 ? (int) (v >>> i) : u >>> i - 64) & 1) != 0)))) ||
10861: (epbRoundingMode == EPB_MODE_RM && xf < 0) ||
10862: (epbRoundingMode == EPB_MODE_RP && 0 <= xf)) {
10863:
10864:
10865:
10866: while (((i < 64 ? (int) (v >>> i) : u >>> i - 64) & 15) == 9) {
10867: if (i < 64) {
10868: v &= ~(15L << i);
10869: } else {
10870: u &= ~(15 << i);
10871: }
10872: i += 4;
10873: }
10874:
10875:
10876: if (i < 64) {
10877: v += 1L << i;
10878: } else {
10879: u += 1 << i;
10880: }
10881: }
10882: }
10883:
10884: w = 7 - (Integer.numberOfLeadingZeros (u) >>> 2);
10885: e += 16 + w;
10886: i = w << 2;
10887: v = (long) u << -i | v >>> i;
10888: u >>>= i - 64;
10889:
10890: if (e < 0) {
10891: u |= 0x40000000;
10892: e = -e;
10893: }
10894: e = XEiJ.fmtBcd8 (e);
10895: if ((e & ~0xfff) != 0) {
10896: epbFpsr |= EPB_FPSR_OE;
10897: epbExceptionOperandExponent = xf & M | 0x3fff + xe << 16;
10898: epbExceptionOperandMantissa = xd;
10899: }
10900: u |= (e & 0xfff) << 16 | (e & 0xf000);
10901:
10902: u |= xf & M;
10903: }
10904: b[a ] = (byte) (u >> 24);
10905: b[a + 1] = (byte) (u >> 16);
10906: b[a + 2] = (byte) (u >> 8);
10907: b[a + 3] = (byte) u;
10908: u = (int) (v >>> 32);
10909: b[a + 4] = (byte) (u >> 24);
10910: b[a + 5] = (byte) (u >> 16);
10911: b[a + 6] = (byte) (u >> 8);
10912: b[a + 7] = (byte) u;
10913: u = (int) v;
10914: b[a + 8] = (byte) (u >> 24);
10915: b[a + 9] = (byte) (u >> 16);
10916: b[a + 10] = (byte) (u >> 8);
10917: b[a + 11] = (byte) u;
10918: return;
10919: }
10920:
10921:
10922:
10923:
10924:
10925:
10926:
10927:
10928:
10929:
10930:
10931:
10932: public int gets () {
10933: int xf = this.flg;
10934: if (xf << 1 != 0) {
10935: if (xf << 1 < 0) {
10936: return 0;
10937: } else if (xf << 2 < 0) {
10938: epbFpsr |= EPB_FPSR_OE;
10939: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
10940: epbExceptionOperandMantissa = 0x0000000000000000L;
10941: return xf >> 31 ^ 0x00007fff;
10942: } else {
10943: epbFpsr |= EPB_FPSR_OE | EPB_FPSR_AV;
10944: epbExceptionOperandExponent = 0x7fff << 16;
10945: epbExceptionOperandMantissa = 0xffffffffffffffffL;
10946: return -1;
10947: }
10948: }
10949:
10950: int xe = this.epp;
10951: long xd = this.dvl;
10952: long xc = this.cvl;
10953: if (xe < 0) {
10954: if (false) {
10955: epbFpsr |= EPB_FPSR_X2;
10956: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
10957: epbExceptionOperandMantissa = xd;
10958: }
10959: return 0;
10960: }
10961:
10962: if (xe < 15) {
10963: if (false) {
10964: if ((xd << 1 + xe | xc) != 0L) {
10965: epbFpsr |= EPB_FPSR_X2;
10966: epbExceptionOperandExponent = xf | 0x3fff + xe << 16;
10967: epbExceptionOperandMantissa = xd;
10968: }
10969: }
10970: return xf >= 0 ? (int) (xd >>> ~xe) : -(int) (xd >>> ~xe);
10971: }
10972:
10973: if (xf >= 0) {
10974: epbFpsr |= EPB_FPSR_OE;
10975: epbExceptionOperandExponent = 0x3fff + xe << 16;
10976: epbExceptionOperandMantissa = xd;
10977: return 0x00007fff;
10978: }
10979:
10980: if (xe != 15 || xd != MSB || xc != 0L) {
10981: epbFpsr |= EPB_FPSR_OE;
10982: epbExceptionOperandExponent = M | 0x3fff + xe << 16;
10983: epbExceptionOperandMantissa = this.dvl;
10984: }
10985: return 0xffff8000;
10986: }
10987: public int gets (int roundingMode) {
10988: return (roundingMode == EPB_MODE_RN ? new EFP ().inner ().rint (this).outer ().gets () :
10989: roundingMode == EPB_MODE_RM ? new EFP ().inner ().floor (this).outer ().gets () :
10990: roundingMode == EPB_MODE_RP ? new EFP ().inner ().ceil (this).outer ().gets () :
10991: new EFP ().inner ().trunc (this).outer ().gets ());
10992: }
10993:
10994:
10995:
10996:
10997:
10998:
10999:
11000:
11001:
11002:
11003:
11004:
11005:
11006:
11007:
11008:
11009:
11010:
11011:
11012:
11013:
11014:
11015:
11016:
11017:
11018:
11019:
11020:
11021:
11022:
11023:
11024:
11025:
11026:
11027: public void getx012 (byte[] b, int a) {
11028: this.getx012 (b, a, EPB_MODE_RN);
11029: }
11030: public void getx012 (byte[] b, int a, int roundingMode) {
11031: int xf = this.flg;
11032: int xe = this.epp;
11033: long xd = this.dvl;
11034: long xc = this.cvl;
11035: xfxd:
11036: {
11037: if (xf << 1 != 0) {
11038: if (xf << 1 < 0) {
11039: xf &= M;
11040: xd = 0x0000000000000000L;
11041: } else if (xf << 2 < 0) {
11042: xf = (xf & M) | 0x7fff0000;
11043: xd = 0x0000000000000000L;
11044: } else {
11045: xf = 0x7fff0000;
11046: xd = 0xffffffffffffffffL;
11047: }
11048: break xfxd;
11049: }
11050:
11051: if (xe < -16447) {
11052: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
11053: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
11054: epbExceptionOperandMantissa = xd;
11055: if (0 <= xf) {
11056: if (roundingMode == EPB_MODE_RP) {
11057: xf = 0x00000000;
11058: xd = 0x0000000000000001L;
11059: } else {
11060: xf = 0x00000000;
11061: xd = 0x0000000000000000L;
11062: }
11063: } else {
11064: if (roundingMode == EPB_MODE_RM) {
11065: xf = 0x80000000;
11066: xd = 0x0000000000000001L;
11067: } else {
11068: xf = 0x80000000;
11069: xd = 0x0000000000000000L;
11070: }
11071: }
11072: break xfxd;
11073: }
11074: if (16383 < xe) {
11075: if (true) {
11076: epbFpsr |= EPB_FPSR_OF;
11077: if (xc != 0L) {
11078: epbFpsr |= EPB_FPSR_X2;
11079: }
11080: } else {
11081: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
11082: }
11083: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
11084: epbExceptionOperandMantissa = xd;
11085: if (0 <= xf) {
11086: if (roundingMode == EPB_MODE_RM) {
11087: xf = 0x7ffe0000;
11088: xd = 0xffffffffffffffffL;
11089: } else {
11090: xf = 0x7fff0000;
11091: xd = 0x0000000000000000L;
11092: }
11093: } else {
11094: if (roundingMode == EPB_MODE_RP) {
11095: xf = 0xfffe0000;
11096: xd = 0xffffffffffffffffL;
11097: } else {
11098: xf = 0xffff0000;
11099: xd = 0x0000000000000000L;
11100: }
11101: }
11102: break xfxd;
11103: }
11104: long xb = 0L;
11105: int o = xe <= -16384 ? 0 + -16383 - xe : 0;
11106: if (o == 0) {
11107: } else if (o < 64) {
11108: xb = xc << -o;
11109: xc = xd << -o | xc >>> o;
11110: xd >>>= o;
11111: } else {
11112: xb = xc;
11113: xc = xd;
11114: xd = 0L;
11115: }
11116: if ((xc | xb) != 0L) {
11117: epbFpsr |= EPB_FPSR_X2;
11118: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
11119: roundingMode == EPB_MODE_RM && xf < 0 ||
11120: roundingMode == EPB_MODE_RP && 0 <= xf) {
11121: xd++;
11122: if (xd == 0L) {
11123: xd = MSB;
11124: xe++;
11125: if (16383 < xe) {
11126: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
11127: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
11128: epbExceptionOperandMantissa = xd;
11129: if (0 <= xf) {
11130: if (roundingMode == EPB_MODE_RM) {
11131: xf = 0x7ffe0000;
11132: xd = 0xffffffffffffffffL;
11133: } else {
11134: xf = 0x7fff0000;
11135: xd = 0x0000000000000000L;
11136: }
11137: } else {
11138: if (roundingMode == EPB_MODE_RP) {
11139: xf = 0xfffe0000;
11140: xd = 0xffffffffffffffffL;
11141: } else {
11142: xf = 0xffff0000;
11143: xd = 0x0000000000000000L;
11144: }
11145: }
11146: break xfxd;
11147: }
11148: } else if (0 < o) {
11149: if (xd << o - 1 < 0L) {
11150: xe++;
11151:
11152:
11153:
11154:
11155:
11156:
11157:
11158:
11159: }
11160: }
11161: }
11162:
11163: if (xe <= -16384) {
11164: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
11165: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
11166: epbExceptionOperandMantissa = xd;
11167: if (xd == 0L) {
11168: if (0 <= xf) {
11169: if (roundingMode == EPB_MODE_RP) {
11170: xf = 0x00000000;
11171: xd = 0x0000000000000001L;
11172: } else {
11173: xf = 0x00000000;
11174: xd = 0x0000000000000000L;
11175: }
11176: } else {
11177: if (roundingMode == EPB_MODE_RM) {
11178: xf = 0x80000000;
11179: xd = 0x0000000000000001L;
11180: } else {
11181: xf = 0x80000000;
11182: xd = 0x0000000000000000L;
11183: }
11184: }
11185: break xfxd;
11186: }
11187: }
11188: } else {
11189: if (xe <= -16384) {
11190: epbFpsr |= EPB_FPSR_UF;
11191: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
11192: epbExceptionOperandMantissa = xd;
11193: if (xd == 0L) {
11194: if (0 <= xf) {
11195: if (roundingMode == EPB_MODE_RP) {
11196: xf = 0x00000000;
11197: xd = 0x0000000000000001L;
11198: } else {
11199: xf = 0x00000000;
11200: xd = 0x0000000000000000L;
11201: }
11202: } else {
11203: if (roundingMode == EPB_MODE_RM) {
11204: xf = 0x80000000;
11205: xd = 0x0000000000000001L;
11206: } else {
11207: xf = 0x80000000;
11208: xd = 0x0000000000000000L;
11209: }
11210: }
11211: break xfxd;
11212: }
11213: }
11214: }
11215: xf |= Math.max (0, 16383 + xe) << 16;
11216: }
11217:
11218: b[a ] = (byte) (xf >> 24);
11219: b[a + 1] = (byte) (xf >> 16);
11220: b[a + 2] = 0;
11221: b[a + 3] = 0;
11222: xf = (int) (xd >>> 32);
11223: b[a + 4] = (byte) (xf >> 24);
11224: b[a + 5] = (byte) (xf >> 16);
11225: b[a + 6] = (byte) (xf >> 8);
11226: b[a + 7] = (byte) xf;
11227: xf = (int) xd;
11228: b[a + 8] = (byte) (xf >> 24);
11229: b[a + 9] = (byte) (xf >> 16);
11230: b[a + 10] = (byte) (xf >> 8);
11231: b[a + 11] = (byte) xf;
11232: return;
11233: }
11234: public int getx0 () {
11235: byte[] b = new byte[12];
11236: this.getx012 (b, 0, EPB_MODE_RN);
11237: return b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
11238: }
11239: public int getx0 (int roundingMode) {
11240: byte[] b = new byte[12];
11241: this.getx012 (b, 0, roundingMode);
11242: return b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
11243: }
11244: public long getx12 () {
11245: byte[] b = new byte[12];
11246: this.getx012 (b, 0, EPB_MODE_RN);
11247: return ((long) (b[4] << 24 | (b[5] & 255) << 16 | (char) (b[ 6] << 8 | b[ 7] & 255)) << 32 |
11248: (long) (b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255)) & 0xffffffffL);
11249: }
11250: public long getx12 (int roundingMode) {
11251: byte[] b = new byte[12];
11252: this.getx012 (b, 0, roundingMode);
11253: return ((long) (b[4] << 24 | (b[5] & 255) << 16 | (char) (b[ 6] << 8 | b[ 7] & 255)) << 32 |
11254: (long) (b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255)) & 0xffffffffL);
11255: }
11256:
11257:
11258:
11259:
11260:
11261:
11262:
11263:
11264:
11265:
11266:
11267:
11268:
11269:
11270:
11271:
11272:
11273:
11274:
11275:
11276:
11277:
11278:
11279:
11280:
11281:
11282:
11283:
11284:
11285:
11286:
11287: public void gety012 (byte[] b, int a) {
11288: this.gety012 (b, a, EPB_MODE_RN);
11289: }
11290: public void gety012 (byte[] b, int a, int roundingMode) {
11291: int xf = this.flg;
11292: int xe = this.epp;
11293: long xd = this.dvl;
11294: long xc = this.cvl;
11295: xfxd:
11296: {
11297: if (xf << 1 != 0) {
11298: if (xf << 1 < 0) {
11299: xf &= M;
11300: xd = 0x0000000000000000L;
11301: } else if (xf << 2 < 0) {
11302: xf = (xf & M) | 0x7fff0000;
11303: xd = 0x0000000000000000L;
11304: } else {
11305: xf = 0x7fffffff;
11306: xd = 0xffffffffffffffffL;
11307: }
11308: break xfxd;
11309: }
11310:
11311: if (xe < -16463) {
11312: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
11313: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
11314: epbExceptionOperandMantissa = xd;
11315: if (0 <= xf) {
11316: if (roundingMode == EPB_MODE_RP) {
11317: xf = 0x00000001;
11318: xd = 0x0000000000000000L;
11319: } else {
11320: xf = 0x00000000;
11321: xd = 0x0000000000000000L;
11322: }
11323: } else {
11324: if (roundingMode == EPB_MODE_RM) {
11325: xf = 0x80000001;
11326: xd = 0x0000000000000000L;
11327: } else {
11328: xf = 0x80000000;
11329: xd = 0x0000000000000000L;
11330: }
11331: }
11332: break xfxd;
11333: }
11334: if (16383 < xe) {
11335: if (true) {
11336: epbFpsr |= EPB_FPSR_OF;
11337: if (xc << 16 != 0L) {
11338: epbFpsr |= EPB_FPSR_X2;
11339: }
11340: } else {
11341: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
11342: }
11343: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
11344: epbExceptionOperandMantissa = xd;
11345: if (0 <= xf) {
11346: if (roundingMode == EPB_MODE_RM) {
11347: xf = 0x7ffeffff;
11348: xd = 0xffffffffffffffffL;
11349: } else {
11350: xf = 0x7fff0000;
11351: xd = 0x0000000000000000L;
11352: }
11353: } else {
11354: if (roundingMode == EPB_MODE_RP) {
11355: xf = 0xfffeffff;
11356: xd = 0xffffffffffffffffL;
11357: } else {
11358: xf = 0xffff0000;
11359: xd = 0x0000000000000000L;
11360: }
11361: }
11362: break xfxd;
11363: }
11364: long xb = 0L;
11365: long xa = 0L;
11366: int o = xe <= -16384 ? 48 + -16383 - xe : 48;
11367: if (o < 64) {
11368: xb = xc << -o;
11369: xc = xd << -o | xc >>> o;
11370: xd >>>= o;
11371: } else if (o == 64) {
11372: xb = xc;
11373: xc = xd;
11374: xd = 0L;
11375: } else if (o < 128) {
11376: xa = xc << -o;
11377: xb = xd << -o | xc >>> o;
11378: xc = xd >>> o;
11379: xd = 0L;
11380: } else {
11381: xa = xc;
11382: xb = xd;
11383: xc = 0L;
11384: xd = 0L;
11385: }
11386: if ((xb | xa) != 0L) {
11387: epbFpsr |= EPB_FPSR_X2;
11388: if (roundingMode == EPB_MODE_RN && xb < 0L && (xc << 63 | xb << 1 | xa) != 0L ||
11389: roundingMode == EPB_MODE_RM && xf < 0 ||
11390: roundingMode == EPB_MODE_RP && 0 <= xf) {
11391: xc++;
11392: if (xc == 0L) {
11393: xd++;
11394: if (xd >>> 16 != 0L) {
11395:
11396: xe++;
11397: if (16383 < xe) {
11398: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
11399: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
11400: epbExceptionOperandMantissa = xd;
11401: if (0 <= xf) {
11402: if (roundingMode == EPB_MODE_RM) {
11403: xf = 0x7ffeffff;
11404: xd = 0xffffffffffffffffL;
11405: } else {
11406: xf = 0x7fff0000;
11407: xd = 0x0000000000000000L;
11408: }
11409: } else {
11410: if (roundingMode == EPB_MODE_RP) {
11411: xf = 0xfffeffff;
11412: xd = 0xffffffffffffffffL;
11413: } else {
11414: xf = 0xffff0000;
11415: xd = 0x0000000000000000L;
11416: }
11417: }
11418: break xfxd;
11419: }
11420: } else if (48 < o) {
11421: if (xd << o - 1 < 0L) {
11422: xe++;
11423:
11424:
11425:
11426:
11427:
11428:
11429:
11430:
11431: }
11432: }
11433: }
11434: }
11435:
11436: if (xe <= -16384) {
11437: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
11438: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
11439: epbExceptionOperandMantissa = xd;
11440: if ((xd | xc) == 0L) {
11441: if (0 <= xf) {
11442: if (roundingMode == EPB_MODE_RP) {
11443: xf = 0x00000001;
11444: xd = 0x0000000000000000L;
11445: } else {
11446: xf = 0x00000000;
11447: xd = 0x0000000000000000L;
11448: }
11449: } else {
11450: if (roundingMode == EPB_MODE_RM) {
11451: xf = 0x80000001;
11452: xd = 0x0000000000000000L;
11453: } else {
11454: xf = 0x80000000;
11455: xd = 0x0000000000000000L;
11456: }
11457: }
11458: break xfxd;
11459: }
11460: }
11461: } else {
11462: if (xe <= -16384) {
11463: epbFpsr |= EPB_FPSR_UF;
11464: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
11465: epbExceptionOperandMantissa = xd;
11466: if ((xd | xc) == 0L) {
11467: if (0 <= xf) {
11468: if (roundingMode == EPB_MODE_RP) {
11469: xf = 0x00000001;
11470: xd = 0x0000000000000000L;
11471: } else {
11472: xf = 0x00000000;
11473: xd = 0x0000000000000000L;
11474: }
11475: } else {
11476: if (roundingMode == EPB_MODE_RM) {
11477: xf = 0x80000001;
11478: xd = 0x0000000000000000L;
11479: } else {
11480: xf = 0x80000000;
11481: xd = 0x0000000000000000L;
11482: }
11483: }
11484: break xfxd;
11485: }
11486: }
11487: }
11488: xd = xd << 48 | xc >>> -48;
11489: xc <<= 48;
11490: xf |= Math.max (0, 16383 + xe) << 16;
11491: }
11492:
11493: b[a ] = (byte) (xf >> 24);
11494: b[a + 1] = (byte) (xf >> 16);
11495: xf = (int) (xc >>> 48);
11496: b[a + 2] = (byte) (xf >> 8);
11497: b[a + 3] = (byte) xf;
11498: xf = (int) (xd >>> 32);
11499: b[a + 4] = (byte) (xf >> 24);
11500: b[a + 5] = (byte) (xf >> 16);
11501: b[a + 6] = (byte) (xf >> 8);
11502: b[a + 7] = (byte) xf;
11503: xf = (int) xd;
11504: b[a + 8] = (byte) (xf >> 24);
11505: b[a + 9] = (byte) (xf >> 16);
11506: b[a + 10] = (byte) (xf >> 8);
11507: b[a + 11] = (byte) xf;
11508: return;
11509: }
11510: public int gety0 () {
11511: byte[] b = new byte[12];
11512: this.gety012 (b, 0, EPB_MODE_RN);
11513: return b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
11514: }
11515: public int gety0 (int roundingMode) {
11516: byte[] b = new byte[12];
11517: this.gety012 (b, 0, roundingMode);
11518: return b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
11519: }
11520: public long gety12 () {
11521: byte[] b = new byte[12];
11522: this.gety012 (b, 0, EPB_MODE_RN);
11523: return ((long) (b[4] << 24 | (b[5] & 255) << 16 | (char) (b[ 6] << 8 | b[ 7] & 255)) << 32 |
11524: (long) (b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255)) & 0xffffffffL);
11525: }
11526: public long gety12 (int roundingMode) {
11527: byte[] b = new byte[12];
11528: this.gety012 (b, 0, roundingMode);
11529: return ((long) (b[4] << 24 | (b[5] & 255) << 16 | (char) (b[ 6] << 8 | b[ 7] & 255)) << 32 |
11530: (long) (b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255)) & 0xffffffffL);
11531: }
11532:
11533:
11534:
11535:
11536:
11537:
11538:
11539:
11540:
11541:
11542:
11543: public boolean gt (EFP y) {
11544: int xf = this.flg;
11545: int yf = y.flg;
11546: if ((xf | yf) << 1 != 0) {
11547: return EFP_GT_TABLE[xf >>> 28] << (yf >>> 28 - 1) < 0;
11548: }
11549:
11550: if (xf != yf) {
11551: return xf > yf;
11552: }
11553:
11554: int s;
11555: long t;
11556: return (xf >= 0 ? 1 : -1) * ((s = this.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
11557: (t = this.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
11558: (t = (this.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
11559: 0) > 0;
11560: }
11561:
11562:
11563:
11564:
11565:
11566:
11567:
11568:
11569: public int hashCode () {
11570: return (this.flg ^
11571: this.epp ^
11572: (int) (this.dvl >> 32) ^
11573: (int) this.dvl ^
11574: (int) (this.cvl >> 32));
11575: }
11576:
11577:
11578:
11579:
11580:
11581:
11582:
11583:
11584:
11585:
11586:
11587:
11588:
11589:
11590:
11591:
11592:
11593: public final EFP ieeerem (EFP y) {
11594: return this.ieeerem (this, y);
11595: }
11596: public final EFP ieeerem (EFP x, EFP y) {
11597: int xf = x.flg;
11598: int yf = y.flg;
11599: epbFpsr &= 0xff00ffff;
11600: if ((xf | yf) << 1 != 0) {
11601: if ((xf | yf) << 3 < 0) {
11602: this.flg = N;
11603: } else if (xf << 2 < 0 ||
11604: yf << 1 < 0) {
11605:
11606: epbFpsr |= EPB_FPSR_OE;
11607: if (yf << 1 < 0) {
11608: epbExceptionOperandExponent = yf & M;
11609: epbExceptionOperandMantissa = 0x0000000000000000L;
11610: } else if (yf << 2 < 0) {
11611: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
11612: epbExceptionOperandMantissa = 0x0000000000000000L;
11613: } else {
11614: epbExceptionOperandExponent = yf & M | 0x3fff + y.epp << 16;
11615: epbExceptionOperandMantissa = y.dvl;
11616: }
11617: this.flg = N;
11618: } else if (xf << 1 < 0) {
11619: epbFpsr |= ((xf ^ yf) & M) >>> 8;
11620: this.flg = xf;
11621: } else {
11622: epbFpsr |= ((xf ^ yf) & M) >>> 8;
11623: this.finish (xf, x.epp, x.dvl, x.cvl, 0L);
11624: }
11625: return this;
11626: }
11627:
11628: epbFpsr |= ((xf ^ yf) & M) >>> 8;
11629: if (false) {
11630: this.inner ();
11631:
11632: EFP q = new EFP ().quo (x, y);
11633: int qi = q.geti32abs ();
11634: EFP w = new EFP ();
11635: this.imulw (w, q, y).negsub (x).sub (w);
11636: int k = w.imul2 (this).cmpabs (y);
11637: if (k > 0 || k == 0 && (qi & 1) != 0) {
11638: qi++;
11639: if ((xf ^ yf) >= 0) {
11640: this.sub (y);
11641: } else {
11642: this.iadd (y);
11643: }
11644: }
11645: epbQuotient = qi;
11646: epbFpsr |= (qi & 127) << 16;
11647: if (this.flg << 1 < 0) {
11648: this.flg = xf | Z;
11649: }
11650: return this.outer ().finish ();
11651: } else {
11652: this.inner ();
11653: int ye = y.epp;
11654: long yd = y.dvl;
11655: long yc = y.cvl;
11656: long yc1 = yc >>> 1;
11657: this.epp = x.epp;
11658: this.dvl = x.dvl;
11659: this.cvl = x.cvl;
11660: int i;
11661: long l;
11662: int q = 0;
11663: if ((i = this.epp - ye) > 0 ||
11664: i == 0 && ((l = this.dvl - yd) > 0L ||
11665: l == 0L && this.cvl >>> 1 >= yc1)) {
11666: this.flg = P;
11667: EFP t = new EFP (P, 0, yd, yc);
11668: do {
11669: t.epp = i = (l = this.dvl - yd) > 0L || l == 0L && this.cvl >>> 1 >= yc1 ? this.epp : this.epp - 1;
11670: if ((i -= ye) <= 31) {
11671: q |= 1 << i;
11672: }
11673: this.sub (t);
11674: } while (this.flg == 0 &&
11675: ((i = this.epp - ye) > 0 ||
11676: i == 0 && ((l = this.dvl - yd) > 0L ||
11677: l == 0L && this.cvl >>> 1 >= yc1)));
11678: this.flg |= xf;
11679: } else {
11680: this.flg = xf;
11681: }
11682: if (this.flg << 1 >= 0) {
11683: if ((i = this.epp - ye + 1) > 0 ||
11684: i == 0 && ((l = this.dvl - yd) > 0L ||
11685: l == 0L && ((l = (this.cvl >>> 1) - yc1) > 0L ||
11686: l == 0L && (q & 1) != 0))) {
11687: this.sub (new EFP (this.flg, ye, yd, yc));
11688: q++;
11689: }
11690: if ((short) this.epp != this.epp) {
11691: this.outer ();
11692: epbFpsr |= EPB_FPSR_UF;
11693: epbExceptionOperandExponent = this.flg & M;
11694: epbExceptionOperandMantissa = this.dvl;
11695: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
11696: }
11697: }
11698: epbQuotient = q;
11699: epbFpsr |= (q & 127) << 16;
11700: return this.outer ().finish ();
11701: }
11702: }
11703:
11704:
11705:
11706:
11707:
11708:
11709:
11710:
11711:
11712:
11713:
11714:
11715:
11716:
11717:
11718:
11719:
11720:
11721:
11722:
11723:
11724:
11725:
11726:
11727:
11728:
11729:
11730:
11731:
11732:
11733:
11734:
11735:
11736:
11737:
11738:
11739:
11740:
11741:
11742:
11743:
11744:
11745:
11746: public int ieeerempi2 () {
11747: return this.ieeerempi2 (this);
11748: }
11749: public int ieeerempi2 (EFP x) {
11750: int xf = x.flg;
11751: if (xf << 1 != 0) {
11752: this.flg = xf;
11753: return 0;
11754: }
11755:
11756: int xe = x.epp;
11757: long xd = x.dvl;
11758: long xc = x.cvl;
11759: int o;
11760: long t;
11761: if ((o = xe + 1) < 0 || o == 0 && ((t = xd - 0xc90fdaa22168c234L) < 0L ||
11762: t == 0L && xc >>> 1 <= 0xc4c6629L >>> 1)) {
11763: this.flg = xf;
11764: this.epp = xe;
11765: this.dvl = xd;
11766: this.cvl = xc;
11767: return 0;
11768: }
11769: if ((o = xe - 1) < 0 || o == 0 && ((t = xd - 0x96cbe3f9990e91a7L) < 0L ||
11770: t == 0L && xc >>> 1 <= 0x9394c9fL >>> 1)) {
11771: if (xf >= 0) {
11772: this.inner ().sub (x, PI_2).outer ().sub (PI_2A);
11773: return 1;
11774: } else {
11775: this.inner ().iadd (x, PI_2).outer ().add (PI_2A);
11776: return 3;
11777: }
11778: }
11779:
11780:
11781: long x0 = xd >>> -30;
11782: long x1 = xd >>> 3 & 0x7fffffffL;
11783: long x2 = (xd << 28 | xc >>> -28) & 0x7fffffffL;
11784:
11785:
11786: o = xe * 16913 >>> 19;
11787: long y0 = TWO_PI_ARRAY[o ];
11788: long y1 = TWO_PI_ARRAY[o + 1];
11789: long y2 = TWO_PI_ARRAY[o + 2];
11790: long y3 = TWO_PI_ARRAY[o + 3];
11791: long y4 = TWO_PI_ARRAY[o + 4];
11792: long y5 = TWO_PI_ARRAY[o + 5];
11793: long y6 = TWO_PI_ARRAY[o + 6];
11794: long y7 = TWO_PI_ARRAY[o + 7];
11795: long y8 = TWO_PI_ARRAY[o + 8];
11796:
11797:
11798:
11799:
11800:
11801:
11802:
11803:
11804:
11805:
11806:
11807:
11808:
11809:
11810:
11811:
11812:
11813:
11814:
11815:
11816:
11817:
11818:
11819:
11820:
11821:
11822:
11823:
11824:
11825:
11826:
11827:
11828:
11829: long z3 = (x2 * y8 >>> 31) + x1 * y8 + x2 * y7;
11830: long z2 = (z3 >>> 31) + x0 * y8 + x1 * y7 + x2 * y6;
11831: z3 = (z3 & 0x7fffffffL) + (z2 << 33 >>> 2) << 2;
11832: z2 = (z2 >>> 31) + x0 * y7 + x1 * y6 + x2 * y5;
11833: long z1 = (z2 >>> 31) + x0 * y6 + x1 * y5 + x2 * y4;
11834: z2 = (z2 & 0x7fffffffL) + (z1 << 33 >>> 2) << 2;
11835: z1 = (z1 >>> 31) + x0 * y5 + x1 * y4 + x2 * y3;
11836: long z0 = (z1 >>> 31) + x0 * y4 + x1 * y3 + x2 * y2;
11837: z1 = (z1 & 0x7fffffffL) + (z0 << 33 >>> 2) << 2;
11838: z0 = (z0 >>> 31) + x0 * y3 + x1 * y2 + x2 * y1 + (x0 * y2 + x1 * y1 + x2 * y0 << 31) << 2;
11839:
11840: z0 |= z1 >>> -2;
11841: z1 = z1 << 2 | z2 >>> -4;
11842: z2 = z2 << 4 | z3 >>> -6;
11843: z3 <<= 6;
11844:
11845: o = xe - o * 31;
11846: if (o != 0) {
11847: z0 = z0 << o | z1 >>> -o;
11848: z1 = z1 << o | z2 >>> -o;
11849: z2 = z2 << o | z3 >>> -o;
11850: z3 <<= o;
11851: }
11852:
11853: o = (int) (z0 >>> -2);
11854: if (xf < 0) {
11855: o = -o;
11856: }
11857:
11858: z0 = z0 << 2 | z1 >>> -2;
11859: z1 = z1 << 2 | z2 >>> -2;
11860: z2 = z2 << 2 | z3 >>> -2;
11861: z3 <<= 2;
11862:
11863:
11864: if (z0 < 0L) {
11865: o = xf >= 0 ? o + 1 : o - 1;
11866: t = z3 = -z3;
11867: t |= z2 = t == 0L ? -z2 : ~z2;
11868: t |= z1 = t == 0L ? -z1 : ~z1;
11869: z0 = t == 0L ? -z0 : ~z0;
11870: xf ^= M;
11871: }
11872: o &= 3;
11873:
11874: if (z0 < 0L) {
11875: xe = -1;
11876: } else if (z0 != 0L) {
11877: xe = Long.numberOfLeadingZeros (z0);
11878: z0 = z0 << xe | z1 >>> -xe;
11879: z1 = z1 << xe | z2 >>> -xe;
11880: z2 = z2 << xe | z3 >>> -xe;
11881: z3 <<= xe;
11882: xe = ~xe;
11883: } else if (z1 < 0L) {
11884: xe = -65;
11885: z0 = z1;
11886: z1 = z2;
11887: z2 = z3;
11888: z3 = 0L;
11889: } else if (z1 != 0L) {
11890: xe = Long.numberOfLeadingZeros (z1) + 64;
11891: z0 = z1 << xe | z2 >>> -xe;
11892: z1 = z2 << xe | z3 >>> -xe;
11893: z2 = z3 << xe;
11894: z3 = 0L;
11895: xe = ~xe;
11896: } else if (z2 < 0L) {
11897: xe = -129;
11898: z0 = z2;
11899: z1 = z3;
11900: z2 = 0L;
11901: z3 = 0L;
11902: } else if (z2 != 0L) {
11903: xe = Long.numberOfLeadingZeros (z2) + 128;
11904: z0 = z2 << xe | z3 >>> -xe;
11905: z1 = z3 << xe;
11906: z2 = 0L;
11907: z3 = 0L;
11908: xe = ~xe;
11909: } else if (z3 != 0L) {
11910: xe = Long.numberOfLeadingZeros (z3) + 192;
11911: z0 = z3 << xe;
11912: z1 = 0L;
11913: z2 = 0L;
11914: z3 = 0L;
11915: xe = ~xe;
11916: } else {
11917: this.flg = xf | Z;
11918: return o;
11919: }
11920:
11921: this.ifinish (xf, xe, z0, z1, z2 | z3);
11922:
11923: this.mul (PI_2);
11924:
11925: return o;
11926: }
11927:
11928:
11929:
11930:
11931:
11932:
11933:
11934:
11935:
11936:
11937:
11938:
11939:
11940:
11941:
11942:
11943:
11944:
11945:
11946:
11947:
11948:
11949:
11950:
11951:
11952:
11953:
11954:
11955:
11956:
11957:
11958:
11959:
11960:
11961:
11962:
11963:
11964:
11965:
11966:
11967:
11968:
11969:
11970:
11971:
11972:
11973:
11974:
11975:
11976:
11977:
11978:
11979:
11980: public final EFP inc () {
11981: return this.inc (this);
11982: }
11983: public final EFP inc (EFP x) {
11984:
11985:
11986: int xf = x.flg;
11987: if (xf << 1 != 0) {
11988: if (xf << 1 < 0) {
11989: this.flg = P;
11990: this.epp = 0;
11991: this.dvl = MSB;
11992: this.cvl = 0L;
11993: } else {
11994: this.flg = xf;
11995: }
11996: return this;
11997: }
11998:
11999: int xe = x.epp;
12000: if (xe < -LEN) {
12001:
12002: epbFpsr |= EPB_FPSR_X2;
12003: this.flg = P;
12004: this.epp = 0;
12005: this.dvl = MSB;
12006: this.cvl = 0L;
12007: return this;
12008: }
12009: long xd = x.dvl;
12010: long xc = x.cvl;
12011: if (LEN < xe) {
12012:
12013: epbFpsr |= EPB_FPSR_X2;
12014: return this.finish (xf, xe, xd, xc, 0L);
12015: }
12016: long xb = 0L;
12017: if (xe == 0) {
12018:
12019: if (xf < 0) {
12020:
12021: xd -= MSB;
12022: } else {
12023:
12024: xb = xc << -1;
12025: xc = xd << -1 | xc >>> 1;
12026: xd = (xd >>> 1) + (MSB >>> 1);
12027: xe++;
12028: }
12029: } else if (0 < xe) {
12030:
12031: if (xf < 0) {
12032:
12033: if (xe <= 63) {
12034: xd -= MSB >>> xe;
12035: } else {
12036: if (xc >>> ~xe != 0L) {
12037: xc -= MSB >>> xe;
12038: } else {
12039: xc |= MSB >> xe;
12040: xd--;
12041: }
12042: }
12043: } else {
12044:
12045: if (xe <= 63) {
12046: if ((xd += MSB >>> xe) >>> ~xe == 0L) {
12047: xb = xc << -1;
12048: xc = xd << -1 | xc >>> 1;
12049: xd = MSB | xd >>> 1;
12050: xe++;
12051: }
12052: } else {
12053: if ((xc += MSB >>> xe) >>> ~xe == 0L && ++xd == 0L) {
12054: xb = xc << -1;
12055: xc = xc >>> 1;
12056: xd = MSB;
12057: xe++;
12058: }
12059: }
12060: }
12061: } else {
12062:
12063: if (-63 <= xe) {
12064: xb = xc << xe;
12065: xc = xd << xe | xc >>> -xe;
12066: xd >>>= -xe;
12067: } else if (-64 == xe) {
12068: xb = xc;
12069: xc = xd;
12070: xd = 0L;
12071: } else {
12072: xb = xd << xe | xc >>> -xe;
12073: xc = xd >>> -xe;
12074: xd = 0L;
12075: }
12076: xe = 0;
12077: if (xf < 0) {
12078:
12079: if (xb != 0L) {
12080: xb = -xb;
12081: xc = -1L - xc;
12082: xd = MSB - 1L - xd;
12083: } else if (xc != 0L) {
12084: xc = -xc;
12085: xd = MSB - 1L - xd;
12086: } else {
12087: xd = MSB - xd;
12088: }
12089: xf ^= M;
12090: } else {
12091:
12092: xd |= MSB;
12093: }
12094: }
12095:
12096: if (xd >= 0L) {
12097: if (xd != 0L) {
12098: int o = Long.numberOfLeadingZeros (xd);
12099: xe -= o;
12100: xd = xd << o | xc >>> -o;
12101: xc = xc << o | xb >>> -o;
12102: xb <<= o;
12103: } else if (xc < 0L) {
12104: xe -= 64;
12105: xd = xc;
12106: xc = xb;
12107: xb = 0L;
12108: } else if (xc != 0L) {
12109: int o = 64 + Long.numberOfLeadingZeros (xc);
12110: xe -= o;
12111: xd = xc << o | xb >>> -o;
12112: xc = xb << o;
12113: xb = 0L;
12114: } else if (xb < 0L) {
12115: xe -= 128;
12116: xd = xb;
12117: xc = 0L;
12118: xb = 0L;
12119: } else if (xb != 0L) {
12120: int o = 128 + Long.numberOfLeadingZeros (xb);
12121: xe -= o;
12122: xd = xb << o;
12123: xc = 0L;
12124: xb = 0L;
12125: } else {
12126: this.flg = P | Z;
12127: return this;
12128: }
12129: }
12130: return this.finish (xf, xe, xd, xc, xb);
12131: }
12132:
12133:
12134:
12135:
12136:
12137:
12138:
12139:
12140:
12141: public boolean iseven () {
12142: int xf = this.flg;
12143: int xe = this.epp;
12144: return (xf << 1 != 0 ? xf << 3 >= 0 :
12145: xe < 0 ? false :
12146: xe > LEN - 1 ? true :
12147: xe <= 63 ? this.dvl << xe == 0L && this.cvl == 0L : this.cvl << xe == 0L);
12148: }
12149:
12150:
12151:
12152:
12153:
12154: public boolean isinf () {
12155: return this.flg << 2 < 0;
12156: }
12157:
12158:
12159:
12160:
12161:
12162:
12163:
12164:
12165:
12166: public boolean isint () {
12167: int xf = this.flg;
12168: int xe = this.epp;
12169: return (xf << 1 != 0 ? xf << 3 >= 0 :
12170: xe < 0 ? false :
12171: xe >= LEN - 1 ? true :
12172: xe <= 63 ? this.dvl << 1 << xe == 0L && this.cvl == 0L : this.cvl << xe == 0L);
12173: }
12174:
12175:
12176:
12177:
12178:
12179: public boolean isnan () {
12180: return this.flg << 3 < 0;
12181: }
12182:
12183:
12184:
12185:
12186:
12187:
12188:
12189:
12190:
12191: public boolean isodd () {
12192: int xf = this.flg;
12193: int xe = this.epp;
12194: return (xf << 1 != 0 ? false :
12195: xe < 0 ? false :
12196: xe > LEN - 1 ? false :
12197: xe <= 63 ? this.dvl << xe == MSB && this.cvl == 0L : this.cvl << xe == MSB);
12198: }
12199:
12200:
12201:
12202:
12203:
12204: public boolean isone () {
12205: return (this.flg == P &&
12206: this.epp == 0 &&
12207: this.dvl == MSB &&
12208: this.cvl == 0L);
12209: }
12210:
12211:
12212:
12213:
12214:
12215: public boolean iszero () {
12216: return this.flg << 1 < 0;
12217: }
12218:
12219:
12220:
12221:
12222:
12223:
12224:
12225:
12226:
12227:
12228:
12229: public boolean le (EFP y) {
12230: int xf = this.flg;
12231: int yf = y.flg;
12232: if ((xf | yf) << 1 != 0) {
12233: return EFP_LE_TABLE[xf >>> 28] << (yf >>> 28 - 1) < 0;
12234: }
12235:
12236: if (xf != yf) {
12237: return xf < yf;
12238: }
12239:
12240: int s;
12241: long t;
12242: return (xf >= 0 ? 1 : -1) * ((s = this.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
12243: (t = this.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
12244: (t = (this.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
12245: 0) <= 0;
12246: }
12247:
12248:
12249:
12250:
12251:
12252:
12253:
12254:
12255:
12256:
12257:
12258:
12259:
12260:
12261:
12262:
12263:
12264:
12265:
12266:
12267:
12268:
12269:
12270:
12271:
12272:
12273:
12274:
12275:
12276:
12277:
12278:
12279:
12280:
12281:
12282:
12283:
12284:
12285:
12286:
12287:
12288:
12289:
12290:
12291:
12292:
12293:
12294:
12295:
12296:
12297:
12298:
12299:
12300:
12301:
12302:
12303:
12304:
12305:
12306:
12307:
12308:
12309:
12310:
12311:
12312:
12313:
12314:
12315:
12316:
12317:
12318:
12319:
12320:
12321:
12322:
12323:
12324:
12325:
12326:
12327:
12328:
12329:
12330:
12331:
12332:
12333:
12334:
12335:
12336:
12337:
12338:
12339:
12340:
12341:
12342:
12343:
12344:
12345:
12346:
12347:
12348:
12349:
12350:
12351:
12352:
12353:
12354:
12355:
12356:
12357:
12358:
12359:
12360:
12361:
12362:
12363:
12364:
12365:
12366:
12367:
12368:
12369:
12370:
12371:
12372:
12373:
12374:
12375:
12376:
12377:
12378:
12379:
12380:
12381:
12382:
12383:
12384:
12385:
12386:
12387:
12388:
12389:
12390:
12391:
12392:
12393:
12394:
12395:
12396:
12397:
12398:
12399:
12400:
12401:
12402:
12403:
12404:
12405:
12406:
12407:
12408:
12409:
12410:
12411:
12412:
12413:
12414:
12415:
12416:
12417:
12418:
12419:
12420:
12421:
12422:
12423:
12424:
12425:
12426:
12427:
12428:
12429:
12430:
12431:
12432:
12433:
12434:
12435:
12436:
12437:
12438:
12439:
12440:
12441:
12442:
12443:
12444:
12445:
12446:
12447:
12448:
12449:
12450:
12451:
12452:
12453:
12454:
12455:
12456:
12457:
12458:
12459:
12460:
12461:
12462:
12463:
12464:
12465:
12466:
12467:
12468:
12469:
12470:
12471:
12472:
12473:
12474:
12475:
12476:
12477:
12478:
12479:
12480:
12481:
12482:
12483:
12484:
12485:
12486:
12487:
12488:
12489:
12490:
12491:
12492:
12493:
12494:
12495:
12496:
12497:
12498:
12499:
12500:
12501:
12502:
12503:
12504:
12505:
12506:
12507:
12508:
12509:
12510:
12511:
12512:
12513:
12514:
12515:
12516:
12517:
12518:
12519: public final EFP log () {
12520: return this.log (this);
12521: }
12522: public final EFP log (EFP x) {
12523: int xf = x.flg;
12524: if (xf != 0) {
12525: if (xf << 3 < 0) {
12526: this.flg = N;
12527: } else if (xf << 1 < 0) {
12528: epbFpsr |= EPB_FPSR_DZ;
12529: epbExceptionOperandExponent = xf & M;
12530: epbExceptionOperandMantissa = 0x0000000000000000L;
12531: this.flg = M | I;
12532: } else if (xf >= 0) {
12533: this.flg = P | I;
12534: } else {
12535: epbFpsr |= EPB_FPSR_OE;
12536: if (xf << 2 < 0) {
12537: epbExceptionOperandExponent = M | 0x7fff << 16;
12538: epbExceptionOperandMantissa = 0x0000000000000000L;
12539: } else {
12540: epbExceptionOperandExponent = M | 0x3fff + x.epp << 16;
12541: epbExceptionOperandMantissa = x.dvl;
12542: }
12543: this.flg = N;
12544: }
12545: return this;
12546: }
12547:
12548: if (x.epp == 0 && x.dvl == MSB && x.cvl == 0L) {
12549: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
12550: return this;
12551: }
12552:
12553: this.inner ();
12554: if (true) {
12555:
12556: if ((x.epp == -1 && x.dvl >>> 32 == 0xffffffff00000000L >>> 32) ||
12557: (x.epp == 0 && x.dvl >>> 31 == 0x8000000000000000L >>> 31)) {
12558:
12559:
12560: EFP t = new EFP ().dec (x);
12561: return this.cub (t).div3 ().sub (new EFP ().squ (t).div2 ()).outer ().add (t);
12562: }
12563: }
12564: epbFpsr |= EPB_FPSR_X2;
12565: EFP v = new EFP (x);
12566: v.epp = v.dvl >= 0xb504f333f9de6484L ? -1 : 0;
12567: int k = x.epp - v.epp;
12568: if (true) {
12569: EFP u = new EFP ().dec (v).div (v.inc ());
12570: v.isqu (u);
12571:
12572:
12573:
12574:
12575:
12576:
12577:
12578:
12579:
12580:
12581:
12582:
12583:
12584:
12585:
12586:
12587: this.imul (LOG_C27, v)
12588: .iadd (LOG_C25).imul (v)
12589: .iadd (LOG_C23).imul (v)
12590: .iadd (LOG_C21).imul (v)
12591: .iadd (LOG_C19).imul (v)
12592: .iadd (LOG_C17).imul (v)
12593: .iadd (LOG_C15).imul (v)
12594: .iadd (LOG_C13).imul (v)
12595: .iadd (LOG_C11).imul (v)
12596: .iadd (LOG_C9).imul (v)
12597: .iadd (LOG_C7).imul (v)
12598: .iadd (LOG_C5).imul (v)
12599: .iadd (LOG_C3).imul (v)
12600: .iadd (LOG_C1).imul (u)
12601: .iadd (v.muli (LOG_2, k)).iadd (v.muli (LOG_2A, k));
12602: } else {
12603: EFP vv1 = new EFP ().dec (v);
12604: if (vv1.flg << 1 < 0) {
12605: this.muli (LOG_2, k);
12606: } else {
12607: EFP yy = ZERO;
12608: if (-1023 < vv1.epp) {
12609:
12610: long s = Double.doubleToLongBits (Math.log1p (Double.longBitsToDouble ((long) (vv1.flg | 1023 + vv1.epp << 20) << 32 | vv1.dvl << 1 >>> 12)));
12611: if (s != 0L) {
12612: int sh = (int) (s >>> 32);
12613: yy = new EFP (sh & M, (sh >>> 20 & 2047) - 1023, MSB | s << 12 >>> 1, 0L);
12614: }
12615: }
12616:
12617: vv1.expm1 (yy);
12618:
12619:
12620: v.dec ().sub (vv1);
12621: this.rcp (vv1.inc ()).imul (v).iadd (yy)
12622: .iadd (v.muli (LOG_2, k)).iadd (v.muli (LOG_2A, k));
12623: }
12624: }
12625: return outer ().finish ();
12626: }
12627:
12628:
12629:
12630:
12631:
12632:
12633:
12634:
12635:
12636:
12637:
12638:
12639:
12640:
12641:
12642:
12643:
12644:
12645:
12646:
12647:
12648:
12649:
12650:
12651:
12652:
12653:
12654:
12655:
12656:
12657:
12658:
12659:
12660:
12661:
12662:
12663:
12664:
12665:
12666:
12667:
12668:
12669:
12670:
12671:
12672:
12673:
12674:
12675:
12676:
12677:
12678:
12679:
12680:
12681:
12682:
12683: public final EFP log10 () {
12684: return this.log10 (this);
12685: }
12686: public final EFP log10 (EFP x) {
12687:
12688: int xf = x.flg;
12689: if (xf != 0) {
12690: if (xf << 3 < 0) {
12691: this.flg = N;
12692: } else if (xf << 1 < 0) {
12693: epbFpsr |= EPB_FPSR_DZ;
12694: epbExceptionOperandExponent = xf & M;
12695: epbExceptionOperandMantissa = 0x0000000000000000L;
12696: this.flg = M | I;
12697: } else if (xf >= 0) {
12698: epbExceptionOperandExponent = 0x7fff << 16;
12699: epbExceptionOperandMantissa = 0x0000000000000000L;
12700: this.flg = P | I;
12701: } else {
12702: epbFpsr |= EPB_FPSR_OE;
12703: if (xf << 2 < 0) {
12704: epbExceptionOperandExponent = M | 0x7fff << 16;
12705: epbExceptionOperandMantissa = 0x0000000000000000L;
12706: } else {
12707: epbExceptionOperandExponent = M | 0x3fff + x.epp << 16;
12708: epbExceptionOperandMantissa = x.dvl;
12709: }
12710: this.flg = N;
12711: }
12712: return this;
12713: }
12714:
12715: int xe = x.epp;
12716:
12717: if (xe == 0 && x.dvl == MSB && x.cvl == 0L) {
12718: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
12719: return this;
12720: }
12721:
12722: if (3 <= xe && xe <= 129) {
12723: EFP t = ACCURATE_LOG10_BASE[xe];
12724: if (t != null && x.dvl == t.dvl && x.cvl == t.cvl) {
12725:
12726: epbFpsr |= EPB_FPSR_X2;
12727:
12728:
12729: return this.seti ((xe + 1) * 617 >> 11);
12730: }
12731: }
12732:
12733: this.inner ();
12734: epbFpsr |= EPB_FPSR_X2;
12735: EFP v = new EFP (x);
12736: v.epp = v.dvl >= 0xb504f333f9de6484L ? -1 : 0;
12737: int k = x.epp - v.epp;
12738: EFP u = new EFP ().dec (v).div (v.inc ());
12739: v.isqu (u);
12740: this.imul (LOG10_C27, v)
12741: .iadd (LOG10_C25).imul (v)
12742: .iadd (LOG10_C23).imul (v)
12743: .iadd (LOG10_C21).imul (v)
12744: .iadd (LOG10_C19).imul (v)
12745: .iadd (LOG10_C17).imul (v)
12746: .iadd (LOG10_C15).imul (v)
12747: .iadd (LOG10_C13).imul (v)
12748: .iadd (LOG10_C11).imul (v)
12749: .iadd (LOG10_C9).imul (v)
12750: .iadd (LOG10_C7).imul (v)
12751: .iadd (LOG10_C5).imul (v)
12752: .iadd (LOG10_C3).imul (v)
12753: .iadd (LOG10_C1).imul (u)
12754: .iadd (u.muli (LOG10_2, k));
12755: u.muli (LOG10_2A, k);
12756: return this.outer ().add (u);
12757: }
12758:
12759:
12760:
12761:
12762:
12763:
12764:
12765:
12766:
12767:
12768:
12769:
12770:
12771:
12772:
12773:
12774:
12775:
12776:
12777:
12778:
12779:
12780:
12781:
12782:
12783:
12784:
12785:
12786:
12787:
12788:
12789:
12790:
12791:
12792:
12793:
12794:
12795:
12796:
12797:
12798:
12799:
12800:
12801:
12802:
12803:
12804:
12805:
12806:
12807:
12808:
12809:
12810:
12811:
12812:
12813:
12814:
12815:
12816:
12817:
12818:
12819:
12820:
12821:
12822:
12823:
12824:
12825:
12826:
12827:
12828:
12829:
12830:
12831:
12832:
12833: public final EFP log1p () {
12834: return this.log1p (this);
12835: }
12836: public final EFP log1p (EFP x) {
12837: int xf = x.flg;
12838: if (xf << 1 != 0) {
12839: if (xf << 3 < 0) {
12840: this.flg = N;
12841: } else if (xf << 1 < 0) {
12842: this.flg = xf;
12843: } else if (xf >= 0) {
12844: this.flg = P | I;
12845: } else {
12846: epbFpsr |= EPB_FPSR_OE;
12847: epbExceptionOperandExponent = M | 0x7fff << 16;
12848: epbExceptionOperandMantissa = 0x0000000000000000L;
12849: this.flg = N;
12850: }
12851: return this;
12852: }
12853:
12854: if (xf < 0) {
12855: if (x.epp == 0 && x.dvl == MSB && x.cvl == 0L) {
12856: epbFpsr |= EPB_FPSR_DZ;
12857: epbExceptionOperandExponent = M | 0x3fff << 16;
12858: epbExceptionOperandMantissa = 0x8000000000000000L;
12859: this.flg = M | I;
12860: return this;
12861: } else if (x.epp >= 0) {
12862: epbFpsr |= EPB_FPSR_OE;
12863: epbExceptionOperandExponent = M | 0x3fff + x.epp << 16;
12864: epbExceptionOperandMantissa = x.dvl;
12865: this.flg = N;
12866: return this;
12867: }
12868: }
12869: epbFpsr |= EPB_FPSR_X2;
12870:
12871: if (LOG1P_A.le (x) && x.le (LOG1P_B)) {
12872: int savedFpsr = epbFpsr;
12873: this.inner ();
12874: if (this == x) {
12875: x = new EFP (x);
12876: }
12877: EFP u = new EFP ().iadd (x, TWO).rcpdiv (x);
12878: EFP v = new EFP ().isqu (u);
12879:
12880:
12881:
12882:
12883:
12884:
12885:
12886:
12887:
12888:
12889:
12890:
12891:
12892:
12893:
12894: this.imul (LOG_C27, v)
12895: .iadd (LOG_C25).imul (v)
12896: .iadd (LOG_C23).imul (v)
12897: .iadd (LOG_C21).imul (v)
12898: .iadd (LOG_C19).imul (v)
12899: .iadd (LOG_C17).imul (v)
12900: .iadd (LOG_C15).imul (v)
12901: .iadd (LOG_C13).imul (v)
12902: .iadd (LOG_C11).imul (v)
12903: .iadd (LOG_C9).imul (v)
12904: .iadd (LOG_C7).imul (v)
12905: .iadd (LOG_C5).imul (v)
12906: .iadd (LOG_C3).imul (v)
12907: .iadd (LOG_C1).outer ().mul (u);
12908: return this.originLowerLower (x).correctUnderflow (savedFpsr);
12909: }
12910: return this.inner ().inc (x).outer ().log ();
12911: }
12912:
12913:
12914:
12915:
12916:
12917:
12918:
12919:
12920:
12921:
12922:
12923:
12924:
12925:
12926:
12927:
12928:
12929:
12930:
12931:
12932:
12933:
12934:
12935:
12936:
12937:
12938:
12939:
12940:
12941:
12942:
12943:
12944:
12945:
12946:
12947:
12948:
12949:
12950:
12951:
12952:
12953:
12954:
12955:
12956:
12957:
12958:
12959:
12960:
12961:
12962:
12963:
12964:
12965:
12966:
12967:
12968:
12969:
12970:
12971:
12972:
12973:
12974:
12975:
12976:
12977:
12978:
12979:
12980:
12981:
12982:
12983:
12984:
12985:
12986:
12987:
12988:
12989:
12990:
12991:
12992:
12993:
12994:
12995:
12996:
12997:
12998:
12999:
13000:
13001:
13002:
13003:
13004:
13005:
13006:
13007:
13008:
13009:
13010:
13011:
13012:
13013:
13014:
13015:
13016:
13017:
13018:
13019:
13020:
13021:
13022:
13023:
13024:
13025: public final EFP log2 () {
13026: return this.log2 (this);
13027: }
13028: public final EFP log2 (EFP x) {
13029:
13030: int xf = x.flg;
13031: if (xf != 0) {
13032: if (xf << 3 < 0) {
13033: this.flg = N;
13034: } else if (xf << 1 < 0) {
13035: epbFpsr |= EPB_FPSR_DZ;
13036: epbExceptionOperandExponent = xf & M;
13037: epbExceptionOperandMantissa = 0x0000000000000000L;
13038: this.flg = M | I;
13039: } else if (xf >= 0) {
13040: this.flg = P | I;
13041: } else {
13042: epbFpsr |= EPB_FPSR_OE;
13043: if (xf << 2 < 0) {
13044: epbExceptionOperandExponent = M | 0x7fff << 16;
13045: epbExceptionOperandMantissa = 0x0000000000000000L;
13046: } else {
13047: epbExceptionOperandExponent = M | 0x3fff + x.epp << 16;
13048: epbExceptionOperandMantissa = x.dvl;
13049: }
13050: this.flg = N;
13051: }
13052: return this;
13053: }
13054:
13055:
13056: if (x.dvl == MSB && x.cvl == 0L) {
13057: if (x.epp == 0) {
13058: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
13059: } else {
13060:
13061: epbFpsr |= EPB_FPSR_X2;
13062: this.seti (x.epp);
13063: }
13064: return this;
13065: }
13066:
13067: this.inner ();
13068: epbFpsr |= EPB_FPSR_X2;
13069: EFP v = new EFP (x);
13070: v.epp = v.dvl >= 0xb504f333f9de6484L ? -1 : 0;
13071: int k = x.epp - v.epp;
13072: EFP u = new EFP ().dec (v).div (v.inc ());
13073: v.isqu (u);
13074: this.imul (LOG2_C27, v)
13075: .iadd (LOG2_C25).imul (v)
13076: .iadd (LOG2_C23).imul (v)
13077: .iadd (LOG2_C21).imul (v)
13078: .iadd (LOG2_C19).imul (v)
13079: .iadd (LOG2_C17).imul (v)
13080: .iadd (LOG2_C15).imul (v)
13081: .iadd (LOG2_C13).imul (v)
13082: .iadd (LOG2_C11).imul (v)
13083: .iadd (LOG2_C9).imul (v)
13084: .iadd (LOG2_C7).imul (v)
13085: .iadd (LOG2_C5).imul (v)
13086: .iadd (LOG2_C3).imul (v)
13087: .iadd (LOG2_C1).imul (u);
13088: u.seti (k);
13089: return this.outer ().add (u);
13090: }
13091:
13092:
13093:
13094:
13095:
13096:
13097:
13098:
13099:
13100:
13101:
13102:
13103:
13104:
13105:
13106:
13107:
13108:
13109:
13110:
13111:
13112:
13113:
13114:
13115:
13116:
13117:
13118:
13119:
13120:
13121:
13122:
13123:
13124:
13125:
13126:
13127:
13128:
13129:
13130:
13131:
13132:
13133:
13134:
13135:
13136:
13137:
13138:
13139:
13140:
13141:
13142:
13143:
13144:
13145:
13146:
13147:
13148:
13149:
13150:
13151:
13152:
13153:
13154:
13155:
13156:
13157:
13158:
13159:
13160:
13161:
13162:
13163:
13164:
13165: public final EFP lgamma () {
13166: return this.lgamma (this);
13167: }
13168: public final EFP lgamma (EFP x) {
13169: int xf = x.flg;
13170: if (xf != 0) {
13171: this.flg = (xf == (P | Z) || xf == (P | I) ? P | I :
13172: N);
13173: return this;
13174: }
13175:
13176: this.inner ();
13177: x = new EFP (x);
13178: EFP d = null;
13179: if (x.lt (THIRTEEN)) {
13180: d = new EFP (ONE);
13181: do {
13182: d.mul (x);
13183: x.inc ();
13184: } while (x.lt (THIRTEEN));
13185: }
13186: EFP t = new EFP ().rcp (x);
13187: EFP t2 = new EFP ().squ (t);
13188: this.mul (LGAMMA_C14, t2)
13189: .add (LGAMMA_C13).mul (t2)
13190: .add (LGAMMA_C12).mul (t2)
13191: .add (LGAMMA_C11).mul (t2)
13192: .add (LGAMMA_C10).mul (t2)
13193: .add (LGAMMA_C9).mul (t2)
13194: .add (LGAMMA_C8).mul (t2)
13195: .add (LGAMMA_C7).mul (t2)
13196: .add (LGAMMA_C6).mul (t2)
13197: .add (LGAMMA_C5).mul (t2)
13198: .add (LGAMMA_C4).mul (t2)
13199: .add (LGAMMA_C3).mul (t2)
13200: .add (LGAMMA_C2).mul (t2)
13201: .add (LGAMMA_C1).mul (t)
13202: .add (LOGTWOPI_2).sub (x);
13203: t.sub (x, ONE_2);
13204: this.add (x.log ().mul (t));
13205: if (d != null) {
13206: this.sub (d.log ());
13207: }
13208: return this.outer ().finish ();
13209: }
13210:
13211:
13212:
13213:
13214:
13215:
13216:
13217:
13218:
13219:
13220:
13221: public boolean lt (EFP y) {
13222: int xf = this.flg;
13223: int yf = y.flg;
13224: if ((xf | yf) << 1 != 0) {
13225: return EFP_LT_TABLE[xf >>> 28] << (yf >>> 28 - 1) < 0;
13226: }
13227:
13228: if (xf != yf) {
13229: return xf < yf;
13230: }
13231:
13232: int s;
13233: long t;
13234: return (xf >= 0 ? 1 : -1) * ((s = this.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
13235: (t = this.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
13236: (t = (this.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
13237: 0) < 0;
13238: }
13239:
13240:
13241:
13242:
13243:
13244:
13245:
13246:
13247:
13248:
13249:
13250: public final EFP max (EFP y) {
13251: return this.max (this, y);
13252: }
13253: public final EFP max (EFP x, EFP y) {
13254: if ((x.flg | y.flg) << 3 < 0) {
13255: this.flg = N;
13256: } else if (x.compareTo (y) >= 0) {
13257: this.flg = x.flg;
13258: this.epp = x.epp;
13259: this.dvl = x.dvl;
13260: this.cvl = x.cvl;
13261: } else {
13262: this.flg = y.flg;
13263: this.epp = y.epp;
13264: this.dvl = y.dvl;
13265: this.cvl = y.cvl;
13266: }
13267: return this;
13268: }
13269:
13270:
13271:
13272:
13273:
13274:
13275:
13276:
13277:
13278:
13279:
13280: public final EFP min (EFP y) {
13281: return this.min (this, y);
13282: }
13283: public final EFP min (EFP x, EFP y) {
13284: if ((x.flg | y.flg) << 3 < 0) {
13285: this.flg = N;
13286: } else if (x.compareTo (y) <= 0) {
13287: this.flg = x.flg;
13288: this.epp = x.epp;
13289: this.dvl = x.dvl;
13290: this.cvl = x.cvl;
13291: } else {
13292: this.flg = y.flg;
13293: this.epp = y.epp;
13294: this.dvl = y.dvl;
13295: this.cvl = y.cvl;
13296: }
13297: return this;
13298: }
13299:
13300:
13301:
13302:
13303:
13304:
13305:
13306:
13307:
13308:
13309:
13310:
13311:
13312:
13313:
13314:
13315:
13316:
13317:
13318:
13319:
13320:
13321:
13322:
13323:
13324:
13325:
13326:
13327:
13328:
13329:
13330:
13331:
13332:
13333:
13334:
13335:
13336:
13337:
13338:
13339:
13340:
13341:
13342:
13343:
13344:
13345:
13346:
13347:
13348:
13349:
13350:
13351:
13352:
13353:
13354: public final EFP mul (EFP y) {
13355: int xf = this.flg;
13356: int yf = y.flg;
13357: {
13358: int o;
13359: if ((o = xf | yf) << 1 != 0) {
13360: if (o << 3 < 0) {
13361: this.flg = N;
13362: } else if ((o &= (Z | I)) == (Z | I)) {
13363: epbFpsr |= EPB_FPSR_OE;
13364: if (yf << 1 < 0) {
13365: epbExceptionOperandExponent = yf & M;
13366: epbExceptionOperandMantissa = 0x0000000000000000L;
13367: } else {
13368: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
13369: epbExceptionOperandMantissa = 0x0000000000000000L;
13370: }
13371: this.flg = N;
13372: } else {
13373: this.flg = (xf ^ yf) & M | o;
13374: }
13375: return this;
13376: }
13377: }
13378:
13379: int zf = xf ^ yf;
13380:
13381: int ze = this.epp + y.epp;
13382:
13383:
13384:
13385:
13386:
13387:
13388:
13389: long xh = this.dvl;
13390: long yh = y.dvl;
13391: long xl = (xh << -2 | this.cvl >>> 2) >>> -30;
13392:
13393:
13394:
13395: long yl = (yh << -2 | y.cvl >>> 2) >>> -30;
13396: long xm = xh << 32 >>> -30;
13397:
13398: long ym = yh << 32 >>> -30;
13399: xh >>>= 32;
13400: yh >>>= 32;
13401:
13402:
13403:
13404:
13405:
13406:
13407:
13408:
13409:
13410:
13411:
13412:
13413:
13414:
13415: long zb = xl * yl;
13416: long zc = xl * yh + yl * xh + xm * ym;
13417: long zd = xh * yh;
13418: xl *= ym;
13419: yl *= xm;
13420: xm *= yh;
13421: ym *= xh;
13422: zb += (xl << -30 >>> 4) + (yl << -30 >>> 4);
13423: zc += (xm << -30 >>> 4) + (ym << -30 >>> 4);
13424: zc += (xl >>> 30) + (yl >>> 30) + (zb >>> -4);
13425: zd += (xm >>> 30) + (ym >>> 30) + (zc >>> -4);
13426: zb <<= 4;
13427: zc <<= 4;
13428:
13429:
13430: if (zd < 0L) {
13431: ze++;
13432: } else {
13433: zd = zd << 1 | zc >>> -1;
13434: zc <<= 1;
13435: }
13436: return this.finish2 (zf, ze, zd, zc, zb);
13437: }
13438: public final EFP imul (EFP y) {
13439: int xf = this.flg;
13440: int yf = y.flg;
13441: {
13442: int o;
13443: if ((o = xf | yf) << 1 != 0) {
13444: if (o << 3 < 0) {
13445: this.flg = N;
13446: } else if ((o &= (Z | I)) == (Z | I)) {
13447: epbFpsr |= EPB_FPSR_OE;
13448: if (yf << 1 < 0) {
13449: epbExceptionOperandExponent = yf & M;
13450: epbExceptionOperandMantissa = 0x0000000000000000L;
13451: } else {
13452: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
13453: epbExceptionOperandMantissa = 0x0000000000000000L;
13454: }
13455: this.flg = N;
13456: } else {
13457: this.flg = (xf ^ yf) & M | o;
13458: }
13459: return this;
13460: }
13461: }
13462:
13463: int zf = xf ^ yf;
13464:
13465: int ze = this.epp + y.epp;
13466:
13467:
13468:
13469:
13470:
13471:
13472:
13473: long xh = this.dvl;
13474: long yh = y.dvl;
13475: long xl = (xh << -2 | this.cvl >>> 2) >>> -30;
13476:
13477:
13478:
13479: long yl = (yh << -2 | y.cvl >>> 2) >>> -30;
13480: long xm = xh << 32 >>> -30;
13481:
13482: long ym = yh << 32 >>> -30;
13483: xh >>>= 32;
13484: yh >>>= 32;
13485:
13486:
13487:
13488:
13489:
13490:
13491:
13492:
13493:
13494:
13495:
13496:
13497:
13498:
13499: long zb = xl * yl;
13500: long zc = xl * yh + yl * xh + xm * ym;
13501: long zd = xh * yh;
13502: xl *= ym;
13503: yl *= xm;
13504: xm *= yh;
13505: ym *= xh;
13506: zb += (xl << -30 >>> 4) + (yl << -30 >>> 4);
13507: zc += (xm << -30 >>> 4) + (ym << -30 >>> 4);
13508: zc += (xl >>> 30) + (yl >>> 30) + (zb >>> -4);
13509: zd += (xm >>> 30) + (ym >>> 30) + (zc >>> -4);
13510: zb <<= 4;
13511: zc <<= 4;
13512:
13513:
13514: if (zd < 0L) {
13515: ze++;
13516: } else {
13517: zd = zd << 1 | zc >>> -1;
13518: zc <<= 1;
13519: }
13520: return this.ifinish (zf, ze, zd, zc, zb);
13521: }
13522: public final EFP mul (EFP x, EFP y) {
13523: int xf = x.flg;
13524: int yf = y.flg;
13525: {
13526: int o;
13527: if ((o = xf | yf) << 1 != 0) {
13528: if (o << 3 < 0) {
13529: this.flg = N;
13530: } else if ((o &= (Z | I)) == (Z | I)) {
13531: epbFpsr |= EPB_FPSR_OE;
13532: if (yf << 1 < 0) {
13533: epbExceptionOperandExponent = yf & M;
13534: epbExceptionOperandMantissa = 0x0000000000000000L;
13535: } else {
13536: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
13537: epbExceptionOperandMantissa = 0x0000000000000000L;
13538: }
13539: this.flg = N;
13540: } else {
13541: this.flg = (xf ^ yf) & M | o;
13542: }
13543: return this;
13544: }
13545: }
13546:
13547: int zf = xf ^ yf;
13548:
13549: int ze = x.epp + y.epp;
13550:
13551:
13552:
13553:
13554:
13555:
13556:
13557: long xh = x.dvl;
13558: long yh = y.dvl;
13559: long xl = (xh << -2 | x.cvl >>> 2) >>> -30;
13560:
13561:
13562:
13563: long yl = (yh << -2 | y.cvl >>> 2) >>> -30;
13564: long xm = xh << 32 >>> -30;
13565:
13566: long ym = yh << 32 >>> -30;
13567: xh >>>= 32;
13568: yh >>>= 32;
13569:
13570:
13571:
13572:
13573:
13574:
13575:
13576:
13577:
13578:
13579:
13580:
13581:
13582:
13583: long zb = xl * yl;
13584: long zc = xl * yh + yl * xh + xm * ym;
13585: long zd = xh * yh;
13586: xl *= ym;
13587: yl *= xm;
13588: xm *= yh;
13589: ym *= xh;
13590: zb += (xl << -30 >>> 4) + (yl << -30 >>> 4);
13591: zc += (xm << -30 >>> 4) + (ym << -30 >>> 4);
13592: zc += (xl >>> 30) + (yl >>> 30) + (zb >>> -4);
13593: zd += (xm >>> 30) + (ym >>> 30) + (zc >>> -4);
13594: zb <<= 4;
13595: zc <<= 4;
13596:
13597:
13598: if (zd < 0L) {
13599: ze++;
13600: } else {
13601: zd = zd << 1 | zc >>> -1;
13602: zc <<= 1;
13603: }
13604: return this.finish2 (zf, ze, zd, zc, zb);
13605: }
13606: public final EFP imul (EFP x, EFP y) {
13607: int xf = x.flg;
13608: int yf = y.flg;
13609: {
13610: int o;
13611: if ((o = xf | yf) << 1 != 0) {
13612: if (o << 3 < 0) {
13613: this.flg = N;
13614: } else if ((o &= (Z | I)) == (Z | I)) {
13615: epbFpsr |= EPB_FPSR_OE;
13616: if (yf << 1 < 0) {
13617: epbExceptionOperandExponent = yf & M;
13618: epbExceptionOperandMantissa = 0x0000000000000000L;
13619: } else {
13620: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
13621: epbExceptionOperandMantissa = 0x0000000000000000L;
13622: }
13623: this.flg = N;
13624: } else {
13625: this.flg = (xf ^ yf) & M | o;
13626: }
13627: return this;
13628: }
13629: }
13630:
13631: int zf = xf ^ yf;
13632:
13633: int ze = x.epp + y.epp;
13634:
13635:
13636:
13637:
13638:
13639:
13640:
13641: long xh = x.dvl;
13642: long yh = y.dvl;
13643: long xl = (xh << -2 | x.cvl >>> 2) >>> -30;
13644:
13645:
13646:
13647: long yl = (yh << -2 | y.cvl >>> 2) >>> -30;
13648: long xm = xh << 32 >>> -30;
13649:
13650: long ym = yh << 32 >>> -30;
13651: xh >>>= 32;
13652: yh >>>= 32;
13653:
13654:
13655:
13656:
13657:
13658:
13659:
13660:
13661:
13662:
13663:
13664:
13665:
13666:
13667: long zb = xl * yl;
13668: long zc = xl * yh + yl * xh + xm * ym;
13669: long zd = xh * yh;
13670: xl *= ym;
13671: yl *= xm;
13672: xm *= yh;
13673: ym *= xh;
13674: zb += (xl << -30 >>> 4) + (yl << -30 >>> 4);
13675: zc += (xm << -30 >>> 4) + (ym << -30 >>> 4);
13676: zc += (xl >>> 30) + (yl >>> 30) + (zb >>> -4);
13677: zd += (xm >>> 30) + (ym >>> 30) + (zc >>> -4);
13678: zb <<= 4;
13679: zc <<= 4;
13680:
13681:
13682: if (zd < 0L) {
13683: ze++;
13684: } else {
13685: zd = zd << 1 | zc >>> -1;
13686: zc <<= 1;
13687: }
13688: return this.ifinish (zf, ze, zd, zc, zb);
13689: }
13690:
13691:
13692:
13693:
13694:
13695:
13696:
13697:
13698:
13699:
13700:
13701:
13702:
13703:
13704:
13705:
13706:
13707:
13708:
13709:
13710:
13711:
13712:
13713:
13714:
13715:
13716:
13717:
13718:
13719:
13720:
13721:
13722:
13723:
13724:
13725:
13726:
13727:
13728:
13729:
13730:
13731:
13732:
13733:
13734:
13735:
13736:
13737:
13738:
13739:
13740:
13741:
13742:
13743:
13744:
13745:
13746:
13747:
13748:
13749:
13750:
13751:
13752:
13753:
13754:
13755:
13756:
13757:
13758:
13759:
13760:
13761:
13762:
13763:
13764:
13765:
13766:
13767:
13768:
13769:
13770:
13771:
13772:
13773:
13774:
13775:
13776:
13777:
13778:
13779:
13780:
13781:
13782:
13783:
13784: public final EFP mul2 () {
13785: return this.finish (this.flg, this.epp + 1, this.dvl, this.cvl, 0L);
13786: }
13787: public final EFP imul2 () {
13788: this.epp++;
13789: return this;
13790: }
13791: public final EFP mul2 (EFP x) {
13792: return this.finish (x.flg, x.epp + 1, x.dvl, x.cvl, 0L);
13793: }
13794: public final EFP imul2 (EFP x) {
13795: this.flg = x.flg;
13796: this.epp = x.epp + 1;
13797: this.dvl = x.dvl;
13798: this.cvl = x.cvl;
13799: return this;
13800: }
13801:
13802:
13803:
13804:
13805:
13806:
13807:
13808:
13809:
13810:
13811:
13812:
13813:
13814:
13815:
13816:
13817:
13818:
13819:
13820:
13821:
13822:
13823:
13824:
13825:
13826:
13827:
13828:
13829:
13830:
13831:
13832:
13833:
13834:
13835:
13836:
13837:
13838:
13839:
13840:
13841:
13842:
13843:
13844:
13845:
13846:
13847:
13848:
13849:
13850:
13851:
13852:
13853:
13854: public final EFP mul3 () {
13855: return this.muli (this, 3);
13856: }
13857: public final EFP mul3 (EFP x) {
13858:
13859: int xf = x.flg;
13860: if (xf << 1 != 0) {
13861: this.flg = xf;
13862: return this;
13863: }
13864:
13865: int ze = x.epp + 1;
13866: long zd = x.dvl;
13867: long zc = x.cvl;
13868: long t = zc;
13869: zc += (zc >>> 1);
13870: zd += (zd >>> 1) + ((zc & ~t) >>> -1);
13871: if (zd >= 0L) {
13872: zc = zd << -1 | zc >>> 1;
13873: zd = MSB | zd >>> 1;
13874: ze++;
13875: }
13876: return this.finish (xf, ze, zd, zc, 0L);
13877: }
13878:
13879:
13880:
13881:
13882:
13883:
13884:
13885:
13886: public final EFP muli (int n) {
13887: return this.muli (this, n);
13888: }
13889: public final EFP muli (EFP x, int n) {
13890:
13891: int xf = x.flg;
13892: if (n == 0) {
13893: this.flg = (xf & (I | N)) != 0 ? N : xf | Z;
13894: return this;
13895: }
13896: if (xf << 1 != 0) {
13897: this.flg = xf << 3 < 0 ? N : xf ^ (n & M);
13898: return this;
13899: }
13900:
13901: int ze = x.epp;
13902: long zd = x.dvl;
13903: long zc = x.cvl;
13904: if (n < 0) {
13905: xf ^= M;
13906: if (n == 0x80000000) {
13907: ze += 31;
13908: if ((short) ze != ze) {
13909: epbFpsr |= EPB_FPSR_OF;
13910: epbExceptionOperandExponent = xf;
13911: epbExceptionOperandMantissa = zd;
13912: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
13913: }
13914: this.flg = xf;
13915: this.epp = ze;
13916: this.dvl = zd;
13917: this.cvl = zc;
13918: return this;
13919: }
13920: n = -n;
13921: }
13922: if (n > 1) {
13923: long y = (long) n;
13924:
13925:
13926:
13927:
13928:
13929:
13930:
13931:
13932:
13933: zc = (zc >>> 32) * y;
13934: long t = (zd & 0xffffffffL) * y + (zc >>> 32);
13935: zc = t << 32 | (zc & 0xffffffffL);
13936: zd = (zd >>> 32) * y + (t >>> 32);
13937:
13938: int o = Long.numberOfLeadingZeros (zd);
13939: ze += 32 - o;
13940: if (o > 0) {
13941: zd = zd << o | zc >>> -o;
13942: zc <<= o;
13943: }
13944: }
13945: return this.finish (xf, ze, zd, zc, 0L);
13946: }
13947:
13948:
13949:
13950:
13951:
13952:
13953:
13954:
13955:
13956:
13957:
13958:
13959:
13960:
13961:
13962:
13963:
13964:
13965:
13966:
13967:
13968:
13969:
13970:
13971:
13972:
13973:
13974:
13975:
13976:
13977:
13978:
13979:
13980:
13981:
13982:
13983:
13984:
13985:
13986:
13987:
13988:
13989:
13990:
13991:
13992:
13993:
13994:
13995:
13996:
13997:
13998:
13999:
14000: public final EFP mulpi () {
14001: return this.mul (this, PI);
14002: }
14003: public final EFP mulpi (EFP x) {
14004: return this.mul (x, PI);
14005: }
14006:
14007:
14008:
14009:
14010:
14011:
14012:
14013:
14014:
14015:
14016:
14017: public final EFP imulw (EFP w, EFP x, EFP y) {
14018: int xf = x.flg;
14019: int yf = y.flg;
14020: {
14021: int o;
14022: if ((o = xf | yf) << 1 != 0) {
14023: if (o << 3 < 0) {
14024: this.flg = N;
14025: } else if ((o &= (Z | I)) == (Z | I)) {
14026: epbFpsr |= EPB_FPSR_OE;
14027: if (yf << 1 < 0) {
14028: epbExceptionOperandExponent = yf & M;
14029: epbExceptionOperandMantissa = 0x0000000000000000L;
14030: } else {
14031: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
14032: epbExceptionOperandMantissa = 0x0000000000000000L;
14033: }
14034: this.flg = N;
14035: } else {
14036: this.flg = (xf ^ yf) & M | o;
14037: }
14038: w.flg = this.flg;
14039: return this;
14040: }
14041: }
14042:
14043: int zf = xf ^ yf;
14044:
14045: int ze = x.epp + y.epp;
14046:
14047:
14048:
14049:
14050:
14051:
14052:
14053: long xh = x.dvl;
14054: long yh = y.dvl;
14055: long xl = (xh << -2 | x.cvl >>> 2) >>> -30;
14056:
14057:
14058:
14059: long yl = (yh << -2 | y.cvl >>> 2) >>> -30;
14060: long xm = xh << 32 >>> -30;
14061:
14062: long ym = yh << 32 >>> -30;
14063: xh >>>= 32;
14064: yh >>>= 32;
14065:
14066:
14067:
14068:
14069:
14070:
14071:
14072:
14073:
14074:
14075:
14076:
14077:
14078:
14079: long zb = xl * yl;
14080: long zc = xl * yh + yl * xh + xm * ym;
14081: long zd = xh * yh;
14082: xl *= ym;
14083: yl *= xm;
14084: xm *= yh;
14085: ym *= xh;
14086: zb += (xl << -30 >>> 4) + (yl << -30 >>> 4);
14087: zc += (xm << -30 >>> 4) + (ym << -30 >>> 4);
14088: zc += (xl >>> 30) + (yl >>> 30) + (zb >>> -4);
14089: zd += (xm >>> 30) + (ym >>> 30) + (zc >>> -4);
14090: zb <<= 4;
14091: zc = zc << 4 | zb >>> -4;
14092: zb <<= 4;
14093:
14094:
14095: if (zd < 0L) {
14096: ze++;
14097: } else {
14098: zd = zd << 1 | zc >>> -1;
14099: zc = zc << 1 | zb >>> -1;
14100: zb <<= 1;
14101: }
14102:
14103:
14104:
14105:
14106:
14107:
14108:
14109:
14110:
14111:
14112: int wf = zf;
14113: int we = ze - LEN;
14114: long wd = zc << LEN - 64 | zb >>> -(LEN - 64);
14115: long wc = zb << LEN - 64;
14116: zc &= -LSB;
14117:
14118:
14119: if (wd < 0L && (zc & LSB | wd << 1 | wc) != 0L) {
14120:
14121: wf ^= M;
14122: wc = -(wc >>> 1);
14123: wd = -wd - (wc >>> -1);
14124: wc <<= 1;
14125:
14126: if ((zc += LSB) == 0L && ++zd == 0L) {
14127: zd = MSB;
14128: ze++;
14129: }
14130: }
14131:
14132: if (wd >= 0L) {
14133: if (wd != 0L) {
14134: int o = Long.numberOfLeadingZeros (wd);
14135: we -= o;
14136: wd = wd << o | wc >>> -o;
14137: wc <<= o;
14138: } else if (wc != 0L) {
14139: int o = Long.numberOfLeadingZeros (wc);
14140: we -= 64 + o;
14141: wd = wc << o;
14142: wc = 0L;
14143: } else {
14144: wf |= Z;
14145: }
14146: }
14147:
14148: if (ze > 32767) {
14149: epbFpsr |= EPB_FPSR_OF;
14150: epbExceptionOperandExponent = zf;
14151: epbExceptionOperandMantissa = zd;
14152: return this.sete (w.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | zf >>> 31]));
14153: } else if (ze < -32768 || wf << 1 >= 0 && we < -32768) {
14154: epbFpsr |= EPB_FPSR_UF;
14155: epbExceptionOperandExponent = zf;
14156: epbExceptionOperandMantissa = zd;
14157: return this.sete (w.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | zf >>> 31]));
14158: } else {
14159: this.flg = zf;
14160: this.epp = ze;
14161: this.dvl = zd;
14162: this.cvl = zc;
14163: w.flg = wf;
14164: w.epp = we;
14165: w.dvl = wd;
14166: w.cvl = wc;
14167: return this;
14168: }
14169: }
14170:
14171:
14172:
14173:
14174:
14175:
14176:
14177:
14178:
14179:
14180:
14181: public boolean ne (EFP y) {
14182: int xf = this.flg;
14183: int yf = y.flg;
14184: return ((xf | yf) << 1 != 0 ?
14185: EFP_NE_TABLE[xf >>> 28] << (yf >>> 28 - 1) < 0
14186: :
14187: xf != yf || this.epp != y.epp || this.dvl != y.dvl || this.cvl != y.cvl);
14188: }
14189:
14190:
14191:
14192:
14193:
14194:
14195:
14196:
14197:
14198:
14199:
14200:
14201:
14202:
14203:
14204:
14205:
14206:
14207:
14208:
14209:
14210:
14211:
14212:
14213:
14214:
14215:
14216:
14217:
14218:
14219:
14220:
14221:
14222:
14223:
14224:
14225:
14226:
14227:
14228:
14229:
14230:
14231:
14232:
14233:
14234:
14235:
14236:
14237:
14238:
14239:
14240:
14241:
14242:
14243:
14244:
14245:
14246:
14247: public final EFP neg () {
14248: return this.finish (0 <= this.flg << 3 ? this.flg ^ M : this.flg, this.epp, this.dvl, this.cvl, 0L);
14249: }
14250: public final EFP ineg () {
14251: if (0 <= this.flg << 3) {
14252: this.flg ^= M;
14253: }
14254: return this;
14255: }
14256: public final EFP neg (boolean b) {
14257: return this.finish (b && 0 <= this.flg << 3 ? this.flg ^ M : this.flg, this.epp, this.dvl, this.cvl, 0L);
14258: }
14259: public final EFP ineg (boolean b) {
14260: if (b && 0 <= this.flg << 3) {
14261: this.flg ^= M;
14262: }
14263: return this;
14264: }
14265: public final EFP neg (EFP x) {
14266: return this.finish (0 <= x.flg << 3 ? x.flg ^ M : x.flg, x.epp, x.dvl, x.cvl, 0L);
14267: }
14268: public final EFP ineg (EFP x) {
14269: this.flg = 0 <= x.flg << 3 ? x.flg ^ M : x.flg;
14270: this.epp = x.epp;
14271: this.dvl = x.dvl;
14272: this.cvl = x.cvl;
14273: return this;
14274: }
14275: public final EFP neg (EFP x, boolean b) {
14276: return this.finish (b && 0 <= x.flg << 3 ? x.flg ^ M : x.flg, x.epp, x.dvl, x.cvl, 0L);
14277: }
14278: public final EFP ineg (EFP x, boolean b) {
14279: this.flg = b && 0 <= x.flg << 3 ? x.flg ^ M : x.flg;
14280: this.epp = x.epp;
14281: this.dvl = x.dvl;
14282: this.cvl = x.cvl;
14283: return this;
14284: }
14285:
14286:
14287:
14288:
14289:
14290:
14291:
14292:
14293:
14294:
14295: public final EFP negdec () {
14296: return this.inner ().dec ().outer ().neg (0 <= this.flg << 1);
14297: }
14298: public final EFP negdec (EFP x) {
14299: return this.inner ().dec (x).outer ().neg (0 <= this.flg << 1);
14300: }
14301:
14302:
14303:
14304:
14305:
14306: public final EFP negset0 () {
14307: this.flg = M | Z;
14308:
14309:
14310:
14311: return this;
14312: }
14313:
14314:
14315:
14316:
14317:
14318: public final EFP negset1 () {
14319: this.flg = M;
14320: this.epp = 0;
14321: this.dvl = MSB;
14322: this.cvl = 0L;
14323: return this;
14324: }
14325:
14326:
14327:
14328:
14329:
14330: public final EFP negsetinf () {
14331: this.flg = M | I;
14332:
14333:
14334:
14335: return this;
14336: }
14337:
14338:
14339:
14340:
14341:
14342:
14343:
14344:
14345:
14346: public final EFP negsub (EFP y) {
14347: int xf = y.flg;
14348: int xe = y.epp;
14349: long xd = y.dvl;
14350: long xc = y.cvl;
14351: long xb = 0L;
14352: int yf = this.flg;
14353: if ((xf | yf) << 1 != 0) {
14354: if ((xf | yf) << 3 < 0) {
14355: this.flg = N;
14356: return this;
14357: }
14358: if ((xf & yf) << 2 < 0 && xf == yf) {
14359: epbFpsr |= EPB_FPSR_OE;
14360: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
14361: epbExceptionOperandMantissa = 0x0000000000000000L;
14362: this.flg = N;
14363: return this;
14364: }
14365: if ((xf & yf) << 1 < 0 && xf == yf) {
14366: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
14367: return this;
14368: }
14369: if (xf << 1 < 0 || yf << 2 < 0) {
14370: xf = yf ^ M;
14371: xe = this.epp;
14372: xd = this.dvl;
14373: xc = this.cvl;
14374: }
14375:
14376: } else {
14377:
14378: yf ^= M;
14379: long yd = this.dvl;
14380: long yc = this.cvl;
14381: int o = xe - this.epp;
14382: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
14383:
14384: xf = yf;
14385: xe += o = -o;
14386: xd = yd;
14387: xc = yc;
14388: yf = y.flg;
14389: yd = y.dvl;
14390: yc = y.cvl;
14391: }
14392:
14393:
14394: if (0 < o) {
14395: if (o <= 63) {
14396: xb = yc << -o;
14397: yc = yd << -o | yc >>> o;
14398: yd >>>= o;
14399: } else if (o == 64) {
14400: xb = yc;
14401: yc = yd;
14402: yd = 0L;
14403: } else if (o <= 127) {
14404: xb = yd << -o | yc;
14405: yc = yd >>> o;
14406: yd = 0L;
14407: } else {
14408: xb = yd | yc;
14409: yc = 0L;
14410: yd = 0L;
14411: }
14412: }
14413:
14414: if (xf == yf) {
14415:
14416: xb |= yc << 62;
14417:
14418: xc = xd << 63 | xc >>> 1;
14419: xd >>>= 1;
14420: yc = yd << 63 | yc >>> 1;
14421: yd >>>= 1;
14422:
14423: yc >>>= 1;
14424: xc >>>= 1;
14425:
14426: xc += yc;
14427: xd += yd + (xc >>> 63);
14428:
14429: xc <<= 1;
14430:
14431: if (xd < 0L) {
14432: xe++;
14433: } else {
14434: xd = xd << 1 | xc >>> 63;
14435: xc <<= 1;
14436: }
14437: } else {
14438:
14439: xb |= yc << 63;
14440:
14441: yc >>>= 1;
14442: xc >>>= 1;
14443:
14444:
14445: if (xb != 0L) {
14446: xc--;
14447: }
14448: xc -= yc;
14449: xd -= yd + (xc >>> 63);
14450:
14451: xc <<= 1;
14452:
14453: if (0L <= xd) {
14454: if (xd != 0L) {
14455: xe -= o = Long.numberOfLeadingZeros (xd);
14456: xd = xd << o | xc >>> -o;
14457: xc <<= o;
14458: } else if (xc != 0L) {
14459: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
14460: xd = xc << o;
14461: xc = 0L;
14462: } else {
14463: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
14464: }
14465: }
14466: }
14467: }
14468: return this.finish (xf, xe, xd, xc, xb);
14469: }
14470: public final EFP negsub (EFP x, EFP y) {
14471: int xf = y.flg;
14472: int xe = y.epp;
14473: long xd = y.dvl;
14474: long xc = y.cvl;
14475: long xb = 0L;
14476: int yf = x.flg;
14477: if ((xf | yf) << 1 != 0) {
14478: if ((xf | yf) << 3 < 0) {
14479: this.flg = N;
14480: return this;
14481: }
14482: if ((xf & yf) << 2 < 0 && xf == yf) {
14483: epbFpsr |= EPB_FPSR_OE;
14484: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
14485: epbExceptionOperandMantissa = 0x0000000000000000L;
14486: this.flg = N;
14487: return this;
14488: }
14489: if ((xf & yf) << 1 < 0 && xf == yf) {
14490: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
14491: return this;
14492: }
14493: if (xf << 1 < 0 || yf << 2 < 0) {
14494: xf = yf ^ M;
14495: xe = x.epp;
14496: xd = x.dvl;
14497: xc = x.cvl;
14498: }
14499:
14500: } else {
14501:
14502: yf ^= M;
14503: long yd = x.dvl;
14504: long yc = x.cvl;
14505: int o = xe - x.epp;
14506: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
14507:
14508: xf = yf;
14509: xe += o = -o;
14510: xd = yd;
14511: xc = yc;
14512: yf = y.flg;
14513: yd = y.dvl;
14514: yc = y.cvl;
14515: }
14516:
14517:
14518: if (0 < o) {
14519: if (o <= 63) {
14520: xb = yc << -o;
14521: yc = yd << -o | yc >>> o;
14522: yd >>>= o;
14523: } else if (o == 64) {
14524: xb = yc;
14525: yc = yd;
14526: yd = 0L;
14527: } else if (o <= 127) {
14528: xb = yd << -o | yc;
14529: yc = yd >>> o;
14530: yd = 0L;
14531: } else {
14532: xb = yd | yc;
14533: yc = 0L;
14534: yd = 0L;
14535: }
14536: }
14537:
14538: if (xf == yf) {
14539:
14540: xb |= yc << 62;
14541:
14542: xc = xd << 63 | xc >>> 1;
14543: xd >>>= 1;
14544: yc = yd << 63 | yc >>> 1;
14545: yd >>>= 1;
14546:
14547: yc >>>= 1;
14548: xc >>>= 1;
14549:
14550: xc += yc;
14551: xd += yd + (xc >>> 63);
14552:
14553: xc <<= 1;
14554:
14555: if (xd < 0L) {
14556: xe++;
14557: } else {
14558: xd = xd << 1 | xc >>> 63;
14559: xc <<= 1;
14560: }
14561: } else {
14562:
14563: xb |= yc << 63;
14564:
14565: yc >>>= 1;
14566: xc >>>= 1;
14567:
14568:
14569: if (xb != 0L) {
14570: xc--;
14571: }
14572: xc -= yc;
14573: xd -= yd + (xc >>> 63);
14574:
14575: xc <<= 1;
14576:
14577: if (0L <= xd) {
14578: if (xd != 0L) {
14579: xe -= o = Long.numberOfLeadingZeros (xd);
14580: xd = xd << o | xc >>> -o;
14581: xc <<= o;
14582: } else if (xc != 0L) {
14583: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
14584: xd = xc << o;
14585: xc = 0L;
14586: } else {
14587: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
14588: }
14589: }
14590: }
14591: }
14592: return this.finish (xf, xe, xd, xc, xb);
14593: }
14594:
14595:
14596:
14597:
14598:
14599:
14600:
14601:
14602:
14603:
14604:
14605:
14606:
14607:
14608:
14609:
14610:
14611:
14612:
14613:
14614:
14615:
14616:
14617:
14618:
14619:
14620:
14621: public final EFP nextdowne () {
14622: return this.nextdowne (this);
14623: }
14624: public final EFP nextdowne (EFP x) {
14625: int xf = x.flg;
14626: int xe = x.epp;
14627: long xd = x.dvl;
14628: long xc = x.cvl;
14629: if (xf << 1 != 0) {
14630: if (xf << 1 < 0) {
14631: xf = M;
14632: xe = -32768;
14633: xd = MSB;
14634: xc = 0L;
14635: } else if (xf == (P | I)) {
14636: xf = P;
14637: xe = 32767;
14638: xd = -1L;
14639: xc = -1L << 128 - LEN;
14640: }
14641:
14642: } else if (xf >= 0) {
14643: if (xc != 0L) {
14644: xc -= 1L << 128 - LEN;
14645: } else if (xd != MSB) {
14646: xc = -1L << 128 - LEN;
14647: xd--;
14648: } else if (xe > -32768) {
14649: xc = -1L << 128 - LEN;
14650: xd = -1L;
14651: xe--;
14652: } else {
14653: epbFpsr |= EPB_FPSR_UF;
14654: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
14655: epbExceptionOperandMantissa = xd;
14656: return this.set0 ();
14657: }
14658: } else {
14659: if (xc != -1L << 128 - LEN) {
14660: xc += (1L << 128 - LEN);
14661: } else if (xd != -1L) {
14662: xc = 0L;
14663: xd++;
14664: } else if (xe < 32767) {
14665: xc = 0L;
14666: xd = MSB;
14667: xe++;
14668: } else {
14669: epbFpsr |= EPB_FPSR_OF;
14670: epbExceptionOperandExponent = xf;
14671: epbExceptionOperandMantissa = xd;
14672: return this.negsetinf ();
14673: }
14674: }
14675: this.flg = xf;
14676: this.epp = xe;
14677: this.dvl = xd;
14678: this.cvl = xc;
14679: return this;
14680: }
14681: public final EFP nextdownd () {
14682: return this.nextdowne (this).roundd (EPB_MODE_RM);
14683: }
14684: public final EFP nextdownd (EFP x) {
14685: return this.nextdowne (x).roundd (EPB_MODE_RM);
14686: }
14687: public final EFP nextdownf () {
14688: return this.nextdowne (this).roundf (EPB_MODE_RM);
14689: }
14690: public final EFP nextdownf (EFP x) {
14691: return this.nextdowne (x).roundf (EPB_MODE_RM);
14692: }
14693: public final EFP nextdowng () {
14694: return this.nextdowne (this).roundg (EPB_MODE_RM);
14695: }
14696: public final EFP nextdowng (EFP x) {
14697: return this.nextdowne (x).roundg (EPB_MODE_RM);
14698: }
14699: public final EFP nextdownx () {
14700: return this.nextdowne (this).roundx (EPB_MODE_RM);
14701: }
14702: public final EFP nextdownx (EFP x) {
14703: return this.nextdowne (x).roundx (EPB_MODE_RM);
14704: }
14705: public final EFP nextdowny () {
14706: return this.nextdowne (this).roundy (EPB_MODE_RM);
14707: }
14708: public final EFP nextdowny (EFP x) {
14709: return this.nextdowne (x).roundy (EPB_MODE_RM);
14710: }
14711: public final EFP nextdown (int prec) {
14712: switch (prec) {
14713: case EPB_PREC_EXD:
14714: return this.nextdowne (this).roundx (EPB_MODE_RM);
14715: case EPB_PREC_SGL:
14716: return this.nextdowne (this).roundf (EPB_MODE_RM);
14717: case EPB_PREC_DBL:
14718: case EPB_PREC_DBL3:
14719: return this.nextdowne (this).roundd (EPB_MODE_RM);
14720: case EPB_PREC_TPL:
14721: return this.nextdowne (this).roundy (EPB_MODE_RM);
14722: case EPB_PREC_XSG:
14723: return this.nextdowne (this).roundg (EPB_MODE_RM);
14724: }
14725: return this.nextdowne (this);
14726: }
14727: public final EFP nextdown (EFP x, int prec) {
14728: switch (prec) {
14729: case EPB_PREC_EXD:
14730: return this.nextdowne (x).roundx (EPB_MODE_RM);
14731: case EPB_PREC_SGL:
14732: return this.nextdowne (x).roundf (EPB_MODE_RM);
14733: case EPB_PREC_DBL:
14734: case EPB_PREC_DBL3:
14735: return this.nextdowne (x).roundd (EPB_MODE_RM);
14736: case EPB_PREC_TPL:
14737: return this.nextdowne (x).roundy (EPB_MODE_RM);
14738: case EPB_PREC_XSG:
14739: return this.nextdowne (x).roundg (EPB_MODE_RM);
14740: }
14741: return this.nextdowne (x);
14742: }
14743:
14744:
14745:
14746:
14747:
14748:
14749:
14750:
14751:
14752:
14753:
14754:
14755:
14756:
14757:
14758:
14759:
14760:
14761:
14762:
14763:
14764:
14765:
14766:
14767:
14768:
14769:
14770: public final EFP nextupe () {
14771: return this.nextupe (this);
14772: }
14773: public final EFP nextupe (EFP x) {
14774: int xf = x.flg;
14775: int xe = x.epp;
14776: long xd = x.dvl;
14777: long xc = x.cvl;
14778: if (xf << 1 != 0) {
14779: if (xf << 1 < 0) {
14780: xf = P;
14781: xe = -32768;
14782: xd = MSB;
14783: xc = 0L;
14784: } else if (xf == (M | I)) {
14785: xf = M;
14786: xe = 32767;
14787: xd = -1L;
14788: xc = -1L << 128 - LEN;
14789: }
14790:
14791: } else if (xf >= 0) {
14792: if (xc != -1L << 128 - LEN) {
14793: xc += (1L << 128 - LEN);
14794: } else if (xd != -1L) {
14795: xc = 0L;
14796: xd++;
14797: } else if (xe < 32767) {
14798: xc = 0L;
14799: xd = MSB;
14800: xe++;
14801: } else {
14802: epbFpsr |= EPB_FPSR_OF;
14803: epbExceptionOperandExponent = xf;
14804: epbExceptionOperandMantissa = xd;
14805: return this.setinf ();
14806: }
14807: } else {
14808: if (xc != 0L) {
14809: xc -= 1L << 128 - LEN;
14810: } else if (xd != MSB) {
14811: xc = -1L << 128 - LEN;
14812: xd--;
14813: } else if (xe > -32768) {
14814: xc = -1L << 128 - LEN;
14815: xd = -1L;
14816: xe--;
14817: } else {
14818: epbFpsr |= EPB_FPSR_UF;
14819: epbExceptionOperandExponent = xf;
14820: epbExceptionOperandMantissa = xd;
14821: return this.negset0 ();
14822: }
14823: }
14824: this.flg = xf;
14825: this.epp = xe;
14826: this.dvl = xd;
14827: this.cvl = xc;
14828: return this;
14829: }
14830: public final EFP nextupd () {
14831: return this.nextupe (this).roundd (EPB_MODE_RP);
14832: }
14833: public final EFP nextupd (EFP x) {
14834: return this.nextupe (x).roundd (EPB_MODE_RP);
14835: }
14836: public final EFP nextupf () {
14837: return this.nextupe (this).roundf (EPB_MODE_RP);
14838: }
14839: public final EFP nextupf (EFP x) {
14840: return this.nextupe (x).roundf (EPB_MODE_RP);
14841: }
14842: public final EFP nextupg () {
14843: return this.nextupe (this).roundg (EPB_MODE_RP);
14844: }
14845: public final EFP nextupg (EFP x) {
14846: return this.nextupe (x).roundg (EPB_MODE_RP);
14847: }
14848: public final EFP nextupx () {
14849: return this.nextupe (this).roundx (EPB_MODE_RP);
14850: }
14851: public final EFP nextupx (EFP x) {
14852: return this.nextupe (x).roundx (EPB_MODE_RP);
14853: }
14854: public final EFP nextupy () {
14855: return this.nextupe (this).roundy (EPB_MODE_RP);
14856: }
14857: public final EFP nextupy (EFP x) {
14858: return this.nextupe (x).roundy (EPB_MODE_RP);
14859: }
14860: public final EFP nextup (int prec) {
14861: switch (prec) {
14862: case EPB_PREC_EXD:
14863: return this.nextupe (this).roundx (EPB_MODE_RP);
14864: case EPB_PREC_SGL:
14865: return this.nextupe (this).roundf (EPB_MODE_RP);
14866: case EPB_PREC_DBL:
14867: case EPB_PREC_DBL3:
14868: return this.nextupe (this).roundd (EPB_MODE_RP);
14869: case EPB_PREC_TPL:
14870: return this.nextupe (this).roundy (EPB_MODE_RP);
14871: case EPB_PREC_XSG:
14872: return this.nextupe (this).roundg (EPB_MODE_RP);
14873: }
14874: return this.nextupe (this);
14875: }
14876: public final EFP nextup (EFP x, int prec) {
14877: switch (prec) {
14878: case EPB_PREC_EXD:
14879: return this.nextupe (x).roundx (EPB_MODE_RP);
14880: case EPB_PREC_SGL:
14881: return this.nextupe (x).roundf (EPB_MODE_RP);
14882: case EPB_PREC_DBL:
14883: case EPB_PREC_DBL3:
14884: return this.nextupe (x).roundd (EPB_MODE_RP);
14885: case EPB_PREC_TPL:
14886: return this.nextupe (x).roundy (EPB_MODE_RP);
14887: case EPB_PREC_XSG:
14888: return this.nextupe (x).roundg (EPB_MODE_RP);
14889: }
14890: return this.nextupe (x);
14891: }
14892:
14893:
14894:
14895:
14896:
14897:
14898:
14899:
14900:
14901:
14902:
14903:
14904:
14905: public final EFP parse (String s) {
14906: int i = 0;
14907: int l = s.length ();
14908: char c = i < l ? s.charAt (i++) : '\0';
14909:
14910: int f;
14911: if (c == '-') {
14912: f = M;
14913: c = i < l ? s.charAt (i++) : '\0';
14914: } else {
14915: f = P;
14916: if (c == '+') {
14917: c = i < l ? s.charAt (i++) : '\0';
14918: }
14919: }
14920:
14921: if (i + 1 < l && (c | 0x20) == 'i' && (s.charAt (i) | 0x20) == 'n' && (s.charAt (i + 1) | 0x20) == 'f') {
14922: this.flg = f | I;
14923: return this;
14924: }
14925:
14926: this.inner ();
14927: this.flg = P | Z;
14928: boolean nan = true;
14929:
14930: int r = 10;
14931: if (c == '$') {
14932: c = i < l ? s.charAt (i++) : '\0';
14933: r = 16;
14934: } else if (c == '@') {
14935: c = i < l ? s.charAt (i++) : '\0';
14936: r = 8;
14937: } else if (c == '%') {
14938: c = i < l ? s.charAt (i++) : '\0';
14939: r = 2;
14940: } else if (c == '0') {
14941: nan = false;
14942: c = i < l ? s.charAt (i++) : '\0';
14943: if ((c | 0x20) == 'x') {
14944: c = i < l ? s.charAt (i++) : '\0';
14945: r = 16;
14946: } else if ((c | 0x20) == 'o') {
14947: c = i < l ? s.charAt (i++) : '\0';
14948: r = 8;
14949: } else if ((c | 0x20) == 'b') {
14950: c = i < l ? s.charAt (i++) : '\0';
14951: r = 2;
14952: }
14953: }
14954:
14955: {
14956: int t = Character.digit (c, r);
14957: if (t >= 0) {
14958: nan = false;
14959: do {
14960: this.imul (EFP_DIGIT[r]).iadd (EFP_DIGIT[t]);
14961: c = i < l ? s.charAt (i++) : '\0';
14962: t = Character.digit (c, r);
14963: } while (t >= 0);
14964: }
14965: }
14966:
14967: int o = 0;
14968: if (c == '.') {
14969: c = i < l ? s.charAt (i++) : '\0';
14970: int t = Character.digit (c, r);
14971: if (t >= 0) {
14972: nan = false;
14973: do {
14974: o--;
14975: this.imul (EFP_DIGIT[r]).iadd (EFP_DIGIT[t]);
14976: c = i < l ? s.charAt (i++) : '\0';
14977: t = Character.digit (c, r);
14978: } while (t >= 0);
14979: if (r == 8) {
14980: o *= 3;
14981: } else if (r == 16) {
14982: o <<= 2;
14983: }
14984: }
14985: }
14986:
14987: if (nan) {
14988: this.flg = N;
14989: return this.outer ();
14990: }
14991:
14992: if (this.flg << 1 < 0) {
14993: this.flg = f | Z;
14994: return this.outer ();
14995: }
14996:
14997: if ((c | 0x20) == (r == 10 ? 'e' : 'p')) {
14998: c = i < l ? s.charAt (i++) : '\0';
14999: int m;
15000: if (c == '-') {
15001: m = -1;
15002: c = i < l ? s.charAt (i++) : '\0';
15003: } else {
15004: m = 1;
15005: if (c == '+') {
15006: c = i < l ? s.charAt (i++) : '\0';
15007: }
15008: }
15009: if ('0' <= c && c <= '9') {
15010: int t = 0;
15011: do {
15012: t = t * 10 + (c - '0');
15013: if (t >= 100000000) {
15014: this.outer ();
15015: if (m >= 0) {
15016:
15017: epbFpsr |= EPB_FPSR_OF;
15018: epbExceptionOperandExponent = 0;
15019: epbExceptionOperandMantissa = 0L;
15020: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | f >>> 31]).finish ();
15021: } else {
15022:
15023: epbFpsr |= EPB_FPSR_UF;
15024: epbExceptionOperandExponent = 0;
15025: epbExceptionOperandMantissa = 0L;
15026: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | f >>> 31]).finish ();
15027: }
15028: }
15029: c = i < l ? s.charAt (i++) : '\0';
15030: } while ('0' <= c && c <= '9');
15031: o += m * t;
15032: }
15033: }
15034: if (r != 10) {
15035: this.shl (o);
15036: } else if (o > 0) {
15037:
15038: EFP t = new EFP (ONE);
15039: for (int j = 0, m = o; m != 0; j++, m >>>= 1) {
15040: if ((m & 1) != 0) {
15041: t.imul (EFP_TEN_POWER_P[j]);
15042: }
15043: }
15044: this.imul (t);
15045: } else if (o < 0) {
15046:
15047: EFP t = new EFP (ONE);
15048: for (int j = 0, m = -o; m != 0; j++, m >>>= 1) {
15049: if ((m & 1) != 0) {
15050: t.imul (EFP_TEN_POWER_P[j]);
15051: }
15052: }
15053: this.div (t);
15054: }
15055:
15056: return this.outer ().neg (f < 0);
15057: }
15058:
15059:
15060:
15061:
15062:
15063:
15064:
15065:
15066:
15067:
15068:
15069:
15070:
15071:
15072:
15073:
15074:
15075:
15076:
15077:
15078:
15079:
15080:
15081:
15082: public final EFP pow (EFP y) {
15083: return this.pow (this, y);
15084: }
15085: public final EFP pow (EFP x, EFP y) {
15086: int xf = x.flg;
15087: int yf = y.flg;
15088: if (yf << 1 != 0) {
15089: if (yf << 1 < 0) {
15090: this.flg = P;
15091: this.epp = 0;
15092: this.dvl = MSB;
15093: this.cvl = 0L;
15094: return this;
15095: } else {
15096: int s;
15097: this.flg = (yf << 3 < 0 ||
15098: xf << 3 < 0 ||
15099: (s = x.cmp1abs ()) == 0 ? N :
15100: (s ^ yf) >= 0 ? P | I :
15101: P | Z);
15102: return this;
15103: }
15104: } else if (xf << 1 != 0) {
15105: this.flg = (xf << 3 < 0 ? N :
15106: xf >= 0 ?
15107: (xf << 2 ^ yf) >= 0 ? P | Z :
15108: P | I :
15109:
15110: y.isodd () ?
15111: (xf << 2 ^ yf) >= 0 ? M | Z :
15112: M | I :
15113:
15114:
15115:
15116:
15117: (xf << 2 ^ yf) >= 0 ? P | Z :
15118: P | I);
15119: return this;
15120: } else if (xf < 0) {
15121: this.inner ();
15122: if (y.iseven ()) {
15123: EFP w = new EFP ();
15124: this.imulw (w, new EFP ().ineg (x).log2 (), y);
15125: if (this.epp >= 16) {
15126: this.flg = this.flg >= 0 ? P | I : P | Z;
15127: return this.outer ();
15128: } else {
15129: int k = this.geti ();
15130: return this.frac ().iadd (w).exp2 ().outer ().shl (k);
15131: }
15132: } else if (y.isodd ()) {
15133: EFP w = new EFP ();
15134: this.imulw (w, new EFP ().ineg (x).log2 (), y);
15135: if (this.epp >= 16) {
15136: this.flg = this.flg >= 0 ? M | I : M | Z;
15137: return this.outer ();
15138: } else {
15139: int k = this.geti ();
15140: return this.frac ().iadd (w).exp2 ().shl (k).outer ().neg ();
15141: }
15142: } else {
15143: this.flg = N;
15144: return this.outer ();
15145: }
15146: } else {
15147: this.inner ();
15148: EFP w = new EFP ();
15149: this.imulw (w, new EFP ().log2 (x), y);
15150: if (this.epp >= 16) {
15151: this.flg = this.flg >= 0 ? P | I : P | Z;
15152: return this.outer ();
15153: } else {
15154: int k = this.geti ();
15155: return this.frac ().iadd (w).exp2 ().outer ().shl (k);
15156: }
15157: }
15158: }
15159:
15160:
15161:
15162:
15163:
15164:
15165:
15166:
15167: public final EFP powi (int n) {
15168: return this.powi (this, n);
15169: }
15170: public final EFP powi (EFP x, int n) {
15171: int xf = x.flg;
15172: if (n == 0) {
15173:
15174: this.flg = P;
15175: this.epp = 0;
15176: this.dvl = MSB;
15177: this.cvl = 0L;
15178: return this;
15179: } else if (xf << 1 != 0) {
15180: this.flg = (xf << 3 < 0 ? N :
15181: xf >= 0 ?
15182: (xf << 2 ^ n) >= 0 ? P | Z :
15183: P | I :
15184:
15185: (n & 1) != 0 ?
15186: (xf << 2 ^ n) >= 0 ? M | Z :
15187: M | I :
15188:
15189:
15190:
15191:
15192: (xf << 2 ^ n) >= 0 ? P | Z :
15193: P | I);
15194: return this;
15195: } else {
15196:
15197: int t = n >= 0 ? n : -n;
15198: if (t >>> 16 != 0) {
15199:
15200: int xe = x.epp;
15201: long xd = x.dvl;
15202: if (xe == 0 && xd >>> -16 == 0x8000L ||
15203: xe == -1 && xd >>> -16 == 0xffffL) {
15204: return this.pow (x, new EFP (n));
15205: }
15206: }
15207: this.inner ();
15208: EFP w = new EFP (x);
15209: if ((t & 1) == 0) {
15210:
15211: this.flg = P;
15212: this.epp = 0;
15213: this.dvl = MSB;
15214: this.cvl = 0L;
15215: } else {
15216:
15217: this.flg = xf;
15218: this.epp = x.epp;
15219: this.dvl = x.dvl;
15220: this.cvl = x.cvl;
15221: }
15222: while ((t >>>= 1) != 0) {
15223: w.squ ();
15224: if ((t & 1) != 0) {
15225: this.mul (w);
15226: }
15227: }
15228: if (n < 0) {
15229: this.rcp ();
15230: }
15231: return this.outer ().finish ();
15232: }
15233: }
15234:
15235:
15236:
15237:
15238:
15239:
15240:
15241:
15242: public final EFP quo (EFP y) {
15243: return this.quo (this, y);
15244: }
15245: public final EFP quo (EFP x, EFP y) {
15246: int xf = x.flg;
15247: int yf = y.flg;
15248: if ((xf | yf) << 1 != 0) {
15249: this.flg = ((xf | yf) << 3 != 0 || (xf & yf & (Z | I)) != 0 ? N :
15250: (xf ^ yf) & M | ((xf & Z | yf & I) != 0 ? Z : I));
15251: return this;
15252: }
15253:
15254: int zf = xf ^ yf;
15255: int ze = x.epp - y.epp;
15256: if (ze < 0) {
15257: this.flg = zf | Z;
15258: return this;
15259: }
15260:
15261: long r01 = x.dvl;
15262: long y01 = y.dvl;
15263: long r2 = (r01 << -2 | x.cvl >>> 2) >>> 33;
15264: long y2 = (y01 << -2 | y.cvl >>> 2) >>> 33;
15265: r01 >>>= 2;
15266: y01 >>>= 2;
15267: long y0 = y01 >>> 31;
15268: long y1 = y01 & 0x7fffffffL;
15269:
15270: boolean qq;
15271: if (r01 < y01 || (r01 == y01 && r2 < y2)) {
15272: if (ze == 0) {
15273: this.flg = zf | Z;
15274: return this;
15275: }
15276: qq = false;
15277: } else {
15278: qq = true;
15279: r2 -= y2;
15280: r01 -= y01;
15281: if (r2 < 0L) {
15282: r2 += 0x80000000L;
15283: r01--;
15284: }
15285: }
15286: long q0, q1, q2;
15287:
15288: q0 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
15289: r01 = (r01 - q0 * y0 << 31) + r2 - q0 * y1;
15290: if (r01 < 0L) {
15291: q0--;
15292: r01 += y01;
15293: }
15294: r2 = q0 * y2 + 0x7fffffffL;
15295: r01 -= r2 >> 31;
15296: r2 = ~r2 & 0x7fffffffL;
15297: if (r01 < 0L) {
15298: q0--;
15299: r2 += y2;
15300: r01 += y01 + (r2 >> 31);
15301: r2 &= 0x7fffffffL;
15302: }
15303: if (ze <= 31) {
15304: q0 &= ~0x7fffffffL >> ze;
15305: q1 = q2 = 0L;
15306: } else {
15307:
15308: q1 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
15309: r01 = (r01 - q1 * y0 << 31) + r2 - q1 * y1;
15310: if (r01 < 0L) {
15311: q1--;
15312: r01 += y01;
15313: }
15314: r2 = q1 * y2 + 0x7fffffffL;
15315: r01 -= r2 >> 31;
15316: r2 = ~r2 & 0x7fffffffL;
15317: if (r01 < 0L) {
15318: q1--;
15319: r2 += y2;
15320: r01 += y01 + (r2 >> 31);
15321: r2 &= 0x7fffffffL;
15322: }
15323: if (ze <= 62) {
15324: q1 &= ~0x7fffffffL >> ze - 31;
15325: q2 = 0L;
15326: } else {
15327:
15328: q2 = r01 >> 31 == y0 ? 0x7fffffffL : r01 / y0;
15329: r01 = (r01 - q2 * y0 << 31) + r2 - q2 * y1;
15330: if (r01 < 0L) {
15331: q2--;
15332: r01 += y01;
15333: }
15334: r2 = q2 * y2 + 0x7fffffffL;
15335: r01 -= r2 >> 31;
15336: r2 = ~r2 & 0x7fffffffL;
15337: if (r01 < 0L) {
15338: q2--;
15339:
15340:
15341:
15342: }
15343: if (ze <= 93) {
15344: q2 &= ~0x7fffffffL >> ze - 62;
15345: }
15346: }
15347: }
15348:
15349:
15350: if (qq) {
15351: q0 = MSB | q0 << 32 | q1 << 1 | q2 >>> 30;
15352: q2 <<= -30;
15353: } else {
15354: ze--;
15355: q0 = q0 << -31 | q1 << 2 | q2 >>> 29;
15356: q2 <<= -29;
15357: }
15358: return this.finish (zf, ze, q0, q2, 0L);
15359: }
15360:
15361:
15362:
15363:
15364:
15365:
15366:
15367:
15368:
15369:
15370:
15371:
15372:
15373:
15374:
15375:
15376:
15377:
15378:
15379:
15380:
15381:
15382:
15383:
15384:
15385:
15386:
15387:
15388:
15389:
15390:
15391:
15392:
15393:
15394:
15395:
15396:
15397:
15398:
15399:
15400:
15401:
15402:
15403:
15404:
15405:
15406:
15407:
15408:
15409:
15410:
15411:
15412:
15413: public final EFP rad () {
15414: return this.mul (this, TO_RAD);
15415: }
15416: public final EFP rad (EFP x) {
15417: return this.mul (x, TO_RAD);
15418: }
15419:
15420:
15421:
15422:
15423:
15424:
15425:
15426:
15427:
15428:
15429: public final EFP random () {
15430: int xf = P;
15431: int xe = -1;
15432: long xd = epbRand48 ();
15433: long xc = epbRand48 ();
15434: xd = xd << 16 | xc >>> 32;
15435: xc = xc << 32 & -LSB;
15436: if (xd != 0L) {
15437: int o = Long.numberOfLeadingZeros (xd);
15438: if (o > 0) {
15439: xe -= o;
15440: xd = xd << o | xc >>> -o;
15441: xc <<= o;
15442: }
15443: } else if (xc != 0L) {
15444: int o = Long.numberOfLeadingZeros (xc);
15445: xe -= 64 + o;
15446: xd = xc << o;
15447: xc = 0L;
15448: } else {
15449: xf = P | Z;
15450: }
15451: return this.finish (xf, xe, xd, xc, 0L);
15452: }
15453:
15454:
15455:
15456:
15457:
15458:
15459:
15460:
15461:
15462:
15463:
15464:
15465:
15466:
15467:
15468:
15469:
15470:
15471:
15472:
15473:
15474:
15475:
15476:
15477:
15478:
15479:
15480:
15481:
15482:
15483:
15484:
15485:
15486:
15487:
15488:
15489:
15490:
15491:
15492:
15493:
15494:
15495:
15496:
15497:
15498:
15499:
15500:
15501:
15502:
15503:
15504:
15505:
15506:
15507:
15508:
15509:
15510:
15511:
15512:
15513:
15514: public final EFP rcp () {
15515: return this.div (ONE, this);
15516: }
15517: public final EFP rcp (EFP x) {
15518: if (false) {
15519: return this.div (ONE, x);
15520: } else {
15521: int xf = x.flg;
15522: if (xf << 1 != 0) {
15523: if (xf << 1 < 0) {
15524: epbFpsr |= EPB_FPSR_DZ;
15525: epbExceptionOperandExponent = xf & M;
15526: epbExceptionOperandMantissa = 0x0000000000000000L;
15527: this.flg = xf ^ (Z | I);
15528: } else if (xf << 2 < 0) {
15529: this.flg = xf ^ (Z | I);
15530: } else {
15531: this.flg = N;
15532: }
15533: return this;
15534: }
15535:
15536: this.inner ();
15537: long s = Double.doubleToLongBits (1.0 / Double.longBitsToDouble ((long) 1023 << 52 | x.dvl << 1 >>> 12));
15538: EFP t = new EFP (xf, (int) (s >>> 52) - 1023 - x.epp, MSB | s << 12 >>> 1, 0L);
15539:
15540: this.imul2 (t);
15541: t.isqu ().imul (x);
15542: return this.outer ().sub (t);
15543: }
15544: }
15545:
15546:
15547:
15548:
15549:
15550:
15551:
15552:
15553:
15554: public final EFP rcpdiv (EFP y) {
15555: return this.div (y, this);
15556: }
15557: public final EFP rcpdiv (EFP x, EFP y) {
15558: return this.div (y, x);
15559: }
15560:
15561:
15562:
15563:
15564:
15565:
15566:
15567:
15568:
15569:
15570:
15571:
15572:
15573:
15574:
15575:
15576:
15577:
15578:
15579:
15580:
15581:
15582:
15583:
15584:
15585:
15586:
15587: public final EFP rem (EFP y) {
15588: return this.rem (this, y);
15589: }
15590: public final EFP rem (EFP x, EFP y) {
15591: int xf = x.flg;
15592: int yf = y.flg;
15593: epbFpsr &= 0xff00ffff;
15594: if ((xf | yf) << 1 != 0) {
15595: if ((xf | yf) << 3 < 0) {
15596: this.flg = N;
15597: } else if (xf << 2 < 0 ||
15598: yf << 1 < 0) {
15599:
15600: epbFpsr |= EPB_FPSR_OE;
15601: if (yf << 1 < 0) {
15602: epbExceptionOperandExponent = yf & M;
15603: epbExceptionOperandMantissa = 0x0000000000000000L;
15604: } else if (yf << 2 < 0) {
15605: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
15606: epbExceptionOperandMantissa = 0x0000000000000000L;
15607: } else {
15608: epbExceptionOperandExponent = yf & M | 0x3fff + y.epp << 16;
15609: epbExceptionOperandMantissa = y.dvl;
15610: }
15611: this.flg = N;
15612: } else if (xf << 1 < 0) {
15613: epbFpsr |= ((xf ^ yf) & M) >>> 8;
15614: this.flg = xf;
15615: } else {
15616: epbFpsr |= ((xf ^ yf) & M) >>> 8;
15617: this.finish (xf, x.epp, x.dvl, x.cvl, 0L);
15618: }
15619: return this;
15620: }
15621:
15622: epbFpsr |= ((xf ^ yf) & M) >>> 8;
15623: if (false) {
15624: this.inner ();
15625:
15626: int s;
15627: long t;
15628: if ((s = x.epp - y.epp) < 0 ||
15629: s == 0 && ((t = x.dvl - y.dvl) < 0L ||
15630: t == 0L && (x.cvl >>> 1) - (y.cvl >>> 1) < 0L)) {
15631:
15632: this.flg = xf;
15633: this.epp = x.epp;
15634: this.dvl = x.dvl;
15635: this.cvl = x.cvl;
15636: } else {
15637: EFP xx = x != this ? x : new EFP (x);
15638: EFP yy = y != this ? y : new EFP (y);
15639: this.divrz (xx, yy).trunc ();
15640: epbQuotient = this.geti32abs ();
15641: epbFpsr |= (epbQuotient & 127) << 16;
15642: EFP ww = new EFP ();
15643: this.imulw (ww, this, yy).negsub (xx).sub (ww);
15644: if (this.flg << 1 < 0) {
15645: this.flg = xf | Z;
15646: }
15647: }
15648: return this.outer ().finish ();
15649: } else {
15650: this.inner ();
15651: int ye = y.epp;
15652: long yd = y.dvl;
15653: long yc = y.cvl;
15654: long yc1 = yc >>> 1;
15655: this.epp = x.epp;
15656: this.dvl = x.dvl;
15657: this.cvl = x.cvl;
15658: int i;
15659: long l;
15660: int q = 0;
15661: if ((i = this.epp - ye) > 0 ||
15662: i == 0 && ((l = this.dvl - yd) > 0L ||
15663: l == 0L && this.cvl >>> 1 >= yc1)) {
15664: this.flg = P;
15665: EFP t = new EFP (P, 0, yd, yc);
15666: do {
15667: t.epp = i = (l = this.dvl - yd) > 0L || l == 0L && this.cvl >>> 1 >= yc1 ? this.epp : this.epp - 1;
15668: if ((i -= ye) <= 31) {
15669: q |= 1 << i;
15670: }
15671: this.sub (t);
15672: } while (this.flg == 0 &&
15673: ((i = this.epp - ye) > 0 ||
15674: i == 0 && ((l = this.dvl - yd) > 0L ||
15675: l == 0L && this.cvl >>> 1 >= yc1)));
15676: this.flg |= xf;
15677: } else {
15678: this.flg = xf;
15679: }
15680: epbQuotient = q;
15681: epbFpsr |= (q & 127) << 16;
15682: return this.outer ().finish ();
15683: }
15684: }
15685:
15686:
15687:
15688:
15689:
15690:
15691:
15692:
15693:
15694:
15695:
15696:
15697:
15698:
15699:
15700:
15701:
15702:
15703:
15704:
15705:
15706:
15707:
15708:
15709:
15710:
15711:
15712:
15713:
15714:
15715:
15716:
15717:
15718:
15719:
15720:
15721:
15722:
15723:
15724:
15725:
15726:
15727:
15728:
15729:
15730:
15731:
15732:
15733:
15734:
15735:
15736:
15737:
15738:
15739:
15740:
15741: public final EFP rint () {
15742: return this.rint (this);
15743: }
15744: public final EFP rint (EFP x) {
15745: int xf = x.flg;
15746: if (xf << 1 != 0) {
15747: this.flg = xf;
15748: return this;
15749: }
15750:
15751: int xe = x.epp;
15752: long xd = x.dvl;
15753: long xc = x.cvl;
15754: if (xe < 0) {
15755: epbFpsr |= EPB_FPSR_X2;
15756: if (xe < -1 || xd == MSB && xc == 0L) {
15757: this.flg = xf | Z;
15758: } else {
15759: this.flg = xf;
15760: this.epp = 0;
15761: this.dvl = MSB;
15762: this.cvl = 0L;
15763: }
15764: return this;
15765: }
15766:
15767: long m = MSB >> xe;
15768: if (xe <= 62) {
15769: if ((xd & ~m | xc) != 0L) {
15770: epbFpsr |= EPB_FPSR_X2;
15771: long t = xd;
15772: xd &= m;
15773: if ((t & -(m >> 1)) != 0L && (t & (-m | ~(m >> 1)) | xc) != 0L) {
15774: xd -= m;
15775: if (xd >= 0L) {
15776: xd = MSB;
15777: xe++;
15778: if ((short) xe != xe) {
15779: epbFpsr |= EPB_FPSR_OF;
15780: epbExceptionOperandExponent = xf;
15781: epbExceptionOperandMantissa = xd;
15782: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
15783: }
15784: }
15785: }
15786: xc = 0L;
15787: }
15788: } else if (xe == 63) {
15789: if (xc != 0L) {
15790: epbFpsr |= EPB_FPSR_X2;
15791: if (xc < 0L && (xd << -1 | xc << 1) != 0L) {
15792: xd++;
15793: if (xd >= 0L) {
15794: xd = MSB;
15795: xe++;
15796: if ((short) xe != xe) {
15797: epbFpsr |= EPB_FPSR_OF;
15798: epbExceptionOperandExponent = xf;
15799: epbExceptionOperandMantissa = xd;
15800: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
15801: }
15802: }
15803: }
15804: xc = 0L;
15805: }
15806: } else if (xe <= LEN - 2) {
15807: if ((xc & ~m) != 0L) {
15808: epbFpsr |= EPB_FPSR_X2;
15809: long t = xc;
15810: xc &= m;
15811: if ((t & -(m >> 1)) != 0L && (t & (-m | ~(m >> 1))) != 0L) {
15812: xc -= m;
15813: if ((t ^ xc) < 0L) {
15814: xd++;
15815: if (xd >= 0L) {
15816: xd = MSB;
15817: xe++;
15818: if ((short) xe != xe) {
15819: epbFpsr |= EPB_FPSR_OF;
15820: epbExceptionOperandExponent = xf;
15821: epbExceptionOperandMantissa = xd;
15822: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
15823: }
15824: }
15825: }
15826: }
15827: }
15828: }
15829:
15830: return finish (xf, xe, xd, xc, 0L);
15831: }
15832:
15833:
15834:
15835:
15836:
15837:
15838:
15839:
15840:
15841:
15842: public final EFP round () {
15843: return this.round (this, EPB_MODE_RN);
15844: }
15845: public final EFP round (int roundingMode) {
15846: return this.round (this, roundingMode);
15847: }
15848: public final EFP round (EFP x) {
15849: return this.round (x, EPB_MODE_RN);
15850: }
15851: public final EFP round (EFP x, int roundingMode) {
15852: return (roundingMode == EPB_MODE_RN ? this.rint (x) :
15853: roundingMode == EPB_MODE_RM ? this.floor (x) :
15854: roundingMode == EPB_MODE_RP ? this.ceil (x) :
15855: this.trunc (x));
15856: }
15857:
15858:
15859:
15860:
15861:
15862:
15863:
15864:
15865:
15866:
15867:
15868:
15869: public final EFP roundd () {
15870: return this.roundd (this, EPB_MODE_RN);
15871: }
15872: public final EFP roundd (int roundingMode) {
15873: return this.roundd (this, roundingMode);
15874: }
15875: public final EFP roundd (EFP x) {
15876: return this.roundd (x, EPB_MODE_RN);
15877: }
15878: public final EFP roundd (EFP x, int roundingMode) {
15879: int xf = x.flg;
15880: if (xf << 1 != 0) {
15881: this.flg = xf;
15882: return this;
15883: }
15884:
15885: int xe = x.epp;
15886: long xd = x.dvl;
15887: long xc = x.cvl;
15888: if (xe < -1075) {
15889: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
15890: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
15891: epbExceptionOperandMantissa = xd;
15892: return this.sete (UNFL_RESULTS[EPB_PREC_DBL << 3 | roundingMode << 1 | xf >>> 31]);
15893: }
15894: if (1023 < xe) {
15895: if (true) {
15896: epbFpsr |= EPB_FPSR_OF;
15897: if ((xd << 53 | xc) != 0L) {
15898: epbFpsr |= EPB_FPSR_X2;
15899: }
15900: } else {
15901: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
15902: }
15903: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
15904: epbExceptionOperandMantissa = xd;
15905: return this.sete (OVFL_RESULTS[EPB_PREC_DBL << 3 | roundingMode << 1 | xf >>> 31]);
15906: }
15907: long xb = 0L;
15908: int o = xe <= -1023 ? 11 + -1022 - xe : 11;
15909: if (o < 64) {
15910: xb = xc << -o;
15911: xc = xd << -o | xc >>> o;
15912: xd >>>= o;
15913: } else {
15914: xb = xc;
15915: xc = xd;
15916: xd = 0L;
15917: }
15918: if ((xc | xb) != 0L) {
15919: epbFpsr |= EPB_FPSR_X2;
15920: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
15921: epbExceptionOperandMantissa = x.dvl;
15922: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
15923: roundingMode == EPB_MODE_RM && xf < 0 ||
15924: roundingMode == EPB_MODE_RP && 0 <= xf) {
15925: xd++;
15926: if (xd >>> 53 != 0L) {
15927: xd = 1L << 52;
15928: xe++;
15929: if (1023 < xe) {
15930: epbFpsr |= EPB_FPSR_OF;
15931: return this.sete (OVFL_RESULTS[EPB_PREC_DBL << 3 | roundingMode << 1 | xf >>> 31]);
15932: }
15933: } else if (11 < o) {
15934: if (xd << o - 1 < 0L) {
15935: xe++;
15936:
15937: if (xe == -1022) {
15938:
15939: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
15940: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
15941: epbExceptionOperandMantissa = xd;
15942: }
15943:
15944: }
15945: }
15946: }
15947:
15948: if (xe <= -1023) {
15949: epbFpsr |= EPB_FPSR_UF;
15950: if (xd == 0L) {
15951: return this.sete (UNFL_RESULTS[EPB_PREC_DBL << 3 | roundingMode << 1 | xf >>> 31]);
15952: }
15953: }
15954: } else {
15955: if (xe <= -1023) {
15956: epbFpsr |= EPB_FPSR_UF;
15957: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
15958: epbExceptionOperandMantissa = x.dvl;
15959: if (xd == 0L) {
15960: return this.sete (UNFL_RESULTS[EPB_PREC_DBL << 3 | roundingMode << 1 | xf >>> 31]);
15961: }
15962: }
15963: }
15964: xd <<= Long.numberOfLeadingZeros (xd);
15965:
15966: this.flg = xf;
15967: this.epp = xe;
15968: this.dvl = xd;
15969: this.cvl = 0L;
15970: return this;
15971: }
15972:
15973:
15974:
15975:
15976:
15977:
15978:
15979:
15980:
15981:
15982:
15983:
15984: public final EFP roundf () {
15985: return this.roundf (this, EPB_MODE_RN);
15986: }
15987: public final EFP roundf (int roundingMode) {
15988: return this.roundf (this, roundingMode);
15989: }
15990: public final EFP roundf (EFP x) {
15991: return this.roundf (x, EPB_MODE_RN);
15992: }
15993: public final EFP roundf (EFP x, int roundingMode) {
15994: int xf = x.flg;
15995: if (xf << 1 != 0) {
15996: this.flg = xf;
15997: return this;
15998: }
15999:
16000: int xe = x.epp;
16001: long xd = x.dvl;
16002: long xc = x.cvl;
16003: if (xe < -150) {
16004: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16005: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16006: epbExceptionOperandMantissa = xd;
16007: return this.sete (UNFL_RESULTS[EPB_PREC_SGL << 3 | roundingMode << 1 | xf >>> 31]);
16008: }
16009: if (127 < xe) {
16010: if (true) {
16011: epbFpsr |= EPB_FPSR_OF;
16012: if ((xd << 24 | xc) != 0L) {
16013: epbFpsr |= EPB_FPSR_X2;
16014: }
16015: } else {
16016: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
16017: }
16018: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
16019: epbExceptionOperandMantissa = xd;
16020: return this.sete (OVFL_RESULTS[EPB_PREC_SGL << 3 | roundingMode << 1 | xf >>> 31]);
16021: }
16022: long xb = 0L;
16023: int o = xe <= -127 ? 40 + -126 - xe : 40;
16024: if (o < 64) {
16025: xb = xc << -o;
16026: xc = xd << -o | xc >>> o;
16027: xd >>>= o;
16028: } else {
16029: xb = xc;
16030: xc = xd;
16031: xd = 0L;
16032: }
16033: if ((xc | xb) != 0L) {
16034: epbFpsr |= EPB_FPSR_X2;
16035: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16036: epbExceptionOperandMantissa = x.dvl;
16037: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << -1 | xc << 1 | xb) != 0L ||
16038: roundingMode == EPB_MODE_RM && xf < 0 ||
16039: roundingMode == EPB_MODE_RP && 0 <= xf) {
16040: xd++;
16041: if (xd >>> 24 != 0L) {
16042: xd = 1L << 23;
16043: xe++;
16044: if (127 < xe) {
16045: epbFpsr |= EPB_FPSR_OF;
16046: return this.sete (OVFL_RESULTS[EPB_PREC_SGL << 3 | roundingMode << 1 | xf >>> 31]);
16047: }
16048: } else if (40 < o) {
16049: if (xd << o - 1 < 0L) {
16050: xe++;
16051:
16052: if (xe == -126) {
16053:
16054: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16055: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16056: epbExceptionOperandMantissa = xd;
16057: }
16058:
16059: }
16060: }
16061: }
16062:
16063: if (xe <= -127) {
16064: epbFpsr |= EPB_FPSR_UF;
16065: if (xd == 0L) {
16066: return this.sete (UNFL_RESULTS[EPB_PREC_SGL << 3 | roundingMode << 1 | xf >>> 31]);
16067: }
16068: }
16069: } else {
16070: if (xe <= -127) {
16071: epbFpsr |= EPB_FPSR_UF;
16072: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16073: epbExceptionOperandMantissa = x.dvl;
16074: if (xd == 0L) {
16075: return this.sete (UNFL_RESULTS[EPB_PREC_SGL << 3 | roundingMode << 1 | xf >>> 31]);
16076: }
16077: }
16078: }
16079: xd <<= Long.numberOfLeadingZeros (xd);
16080:
16081: this.flg = xf;
16082: this.epp = xe;
16083: this.dvl = xd;
16084: this.cvl = 0L;
16085: return this;
16086: }
16087:
16088:
16089:
16090:
16091:
16092:
16093:
16094:
16095:
16096:
16097:
16098:
16099: public final EFP roundg () {
16100: return this.roundg (this, EPB_MODE_RN);
16101: }
16102: public final EFP roundg (int roundingMode) {
16103: return this.roundg (this, roundingMode);
16104: }
16105: public final EFP roundg (EFP x) {
16106: return this.roundg (x, EPB_MODE_RN);
16107: }
16108: public final EFP roundg (EFP x, int roundingMode) {
16109: int xf = x.flg;
16110: if (xf << 1 != 0) {
16111: this.flg = xf;
16112: return this;
16113: }
16114:
16115: int xe = x.epp;
16116: long xd = x.dvl;
16117: long xc = x.cvl;
16118: if (xe < -16407) {
16119: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16120: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16121: epbExceptionOperandMantissa = xd;
16122: return this.sete (UNFL_RESULTS[EPB_PREC_XSG << 3 | roundingMode << 1 | xf >>> 31]);
16123: }
16124: if (16383 < xe) {
16125: if (true) {
16126: epbFpsr |= EPB_FPSR_OF;
16127: if ((xd << 24 | xc) != 0L) {
16128: epbFpsr |= EPB_FPSR_X2;
16129: }
16130: } else {
16131: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
16132: }
16133: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
16134: epbExceptionOperandMantissa = xd;
16135: return this.sete (OVFL_RESULTS[EPB_PREC_XSG << 3 | roundingMode << 1 | xf >>> 31]);
16136: }
16137: long xb = 0L;
16138: int o = xe <= -16384 ? 40 + -16383 - xe : 40;
16139: if (o < 64) {
16140: xb = xc << -o;
16141: xc = xd << -o | xc >>> o;
16142: xd >>>= o;
16143: } else {
16144: xb = xc;
16145: xc = xd;
16146: xd = 0L;
16147: }
16148: if ((xc | xb) != 0L) {
16149: epbFpsr |= EPB_FPSR_X2;
16150: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16151: epbExceptionOperandMantissa = x.dvl;
16152: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << -1 | xc << 1 | xb) != 0L ||
16153: roundingMode == EPB_MODE_RM && xf < 0 ||
16154: roundingMode == EPB_MODE_RP && 0 <= xf) {
16155: xd++;
16156: if (xd >>> 24 != 0L) {
16157: xd = 1L << 23;
16158: xe++;
16159: if (16383 < xe) {
16160: epbFpsr |= EPB_FPSR_OF;
16161: return this.sete (OVFL_RESULTS[EPB_PREC_XSG << 3 | roundingMode << 1 | xf >>> 31]);
16162: }
16163: } else if (40 < o) {
16164: if (xd << o - 1 < 0L) {
16165: xe++;
16166:
16167:
16168:
16169:
16170:
16171:
16172:
16173:
16174: }
16175: }
16176: }
16177:
16178: if (xe <= -16384) {
16179: epbFpsr |= EPB_FPSR_UF;
16180: if (xd == 0L) {
16181: return this.sete (UNFL_RESULTS[EPB_PREC_XSG << 3 | roundingMode << 1 | xf >>> 31]);
16182: }
16183: }
16184: } else {
16185: if (xe <= -16384) {
16186: epbFpsr |= EPB_FPSR_UF;
16187: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16188: epbExceptionOperandMantissa = x.dvl;
16189: if (xd == 0L) {
16190: return this.sete (UNFL_RESULTS[EPB_PREC_XSG << 3 | roundingMode << 1 | xf >>> 31]);
16191: }
16192: }
16193: }
16194: xd <<= Long.numberOfLeadingZeros (xd);
16195:
16196: this.flg = xf;
16197: this.epp = xe;
16198: this.dvl = xd;
16199: this.cvl = 0L;
16200: return this;
16201: }
16202:
16203:
16204:
16205:
16206:
16207:
16208:
16209:
16210:
16211:
16212:
16213:
16214: public final EFP roundi () {
16215: return this.roundi (this, EPB_MODE_RN);
16216: }
16217: public final EFP roundi (int roundingMode) {
16218: return this.roundi (this, roundingMode);
16219: }
16220: public final EFP roundi (EFP x) {
16221: return this.roundi (x, EPB_MODE_RN);
16222: }
16223: public final EFP roundi (EFP x, int roundingMode) {
16224: return this.seti (x.geti (roundingMode));
16225: }
16226:
16227:
16228:
16229:
16230:
16231:
16232:
16233:
16234:
16235:
16236:
16237:
16238: public final EFP roundl () {
16239: return this.roundl (this, EPB_MODE_RN);
16240: }
16241: public final EFP roundl (int roundingMode) {
16242: return this.roundl (this, roundingMode);
16243: }
16244: public final EFP roundl (EFP x) {
16245: return this.roundl (x, EPB_MODE_RN);
16246: }
16247: public final EFP roundl (EFP x, int roundingMode) {
16248: return this.setl (x.getl (roundingMode));
16249: }
16250:
16251:
16252:
16253:
16254:
16255:
16256:
16257:
16258:
16259: public final EFP roundmand () {
16260: return this.roundmand (this, EPB_MODE_RN);
16261: }
16262: public final EFP roundmand (int roundingMode) {
16263: return this.roundmand (this, roundingMode);
16264: }
16265: public final EFP roundmand (EFP x) {
16266: return this.roundmand (x, EPB_MODE_RN);
16267: }
16268: public final EFP roundmand (EFP x, int roundingMode) {
16269: int xf = x.flg;
16270: if (xf << 1 != 0) {
16271: this.flg = xf;
16272: return this;
16273: }
16274:
16275: int xe = x.epp;
16276: long xd = x.dvl;
16277: long xc = x.cvl;
16278: long xb = 0L;
16279: xb = xc << -11;
16280: xc = xd << -11 | xc >>> 11;
16281: xd >>>= 11;
16282: if ((xc | xb) != 0L) {
16283: epbFpsr |= EPB_FPSR_X2;
16284: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16285: epbExceptionOperandMantissa = x.dvl;
16286: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
16287: roundingMode == EPB_MODE_RM && xf < 0 ||
16288: roundingMode == EPB_MODE_RP && 0 <= xf) {
16289: xd++;
16290: if (xd >>> 53 != 0L) {
16291: xd = 1L << 52;
16292: xe++;
16293: }
16294: }
16295:
16296: }
16297: xd <<= 11;
16298:
16299: this.flg = xf;
16300: this.epp = xe;
16301: this.dvl = xd;
16302: this.cvl = 0L;
16303: return this;
16304: }
16305:
16306:
16307:
16308:
16309:
16310:
16311:
16312:
16313:
16314: public final EFP roundmanf () {
16315: return this.roundmanf (this, EPB_MODE_RN);
16316: }
16317: public final EFP roundmanf (int roundingMode) {
16318: return this.roundmanf (this, roundingMode);
16319: }
16320: public final EFP roundmanf (EFP x) {
16321: return this.roundmanf (x, EPB_MODE_RN);
16322: }
16323: public final EFP roundmanf (EFP x, int roundingMode) {
16324: int xf = x.flg;
16325: if (xf << 1 != 0) {
16326: this.flg = xf;
16327: return this;
16328: }
16329:
16330: int xe = x.epp;
16331: long xd = x.dvl;
16332: long xc = x.cvl;
16333: long xb = 0L;
16334: xb = xc << -40;
16335: xc = xd << -40 | xc >>> 40;
16336: xd >>>= 40;
16337: if ((xc | xb) != 0L) {
16338: epbFpsr |= EPB_FPSR_X2;
16339: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16340: epbExceptionOperandMantissa = x.dvl;
16341: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
16342: roundingMode == EPB_MODE_RM && xf < 0 ||
16343: roundingMode == EPB_MODE_RP && 0 <= xf) {
16344: xd++;
16345: if (xd >>> 24 != 0L) {
16346: xd = 1L << 23;
16347: xe++;
16348: }
16349: }
16350:
16351: }
16352: xd <<= 40;
16353:
16354: this.flg = xf;
16355: this.epp = xe;
16356: this.dvl = xd;
16357: this.cvl = 0L;
16358: return this;
16359: }
16360:
16361:
16362:
16363:
16364:
16365:
16366:
16367:
16368:
16369: public final EFP roundmanx () {
16370: return this.roundmanx (this, EPB_MODE_RN);
16371: }
16372: public final EFP roundmanx (int roundingMode) {
16373: return this.roundmanx (this, roundingMode);
16374: }
16375: public final EFP roundmanx (EFP x) {
16376: return this.roundmanx (x, EPB_MODE_RN);
16377: }
16378: public final EFP roundmanx (EFP x, int roundingMode) {
16379: int xf = x.flg;
16380: if (xf << 1 != 0) {
16381: this.flg = xf;
16382: return this;
16383: }
16384:
16385: int xe = x.epp;
16386: long xd = x.dvl;
16387: long xc = x.cvl;
16388: long xb = 0L;
16389: if ((xc | xb) != 0L) {
16390: epbFpsr |= EPB_FPSR_X2;
16391: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16392: epbExceptionOperandMantissa = x.dvl;
16393: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
16394: roundingMode == EPB_MODE_RM && xf < 0 ||
16395: roundingMode == EPB_MODE_RP && 0 <= xf) {
16396: xd++;
16397: if (xd == 0L) {
16398: xd = MSB;
16399: xe++;
16400: }
16401: }
16402:
16403: }
16404: xd <<= Long.numberOfLeadingZeros (xd);
16405:
16406: this.flg = xf;
16407: this.epp = xe;
16408: this.dvl = xd;
16409: this.cvl = 0L;
16410: return this;
16411: }
16412:
16413:
16414:
16415:
16416:
16417:
16418:
16419:
16420:
16421: public final EFP roundmany () {
16422: return this.roundmany (this, EPB_MODE_RN);
16423: }
16424: public final EFP roundmany (int roundingMode) {
16425: return this.roundmany (this, roundingMode);
16426: }
16427: public final EFP roundmany (EFP x) {
16428: return this.roundmany (x, EPB_MODE_RN);
16429: }
16430: public final EFP roundmany (EFP x, int roundingMode) {
16431: int xf = x.flg;
16432: if (xf << 1 != 0) {
16433: this.flg = xf;
16434: return this;
16435: }
16436:
16437: int xe = x.epp;
16438: long xd = x.dvl;
16439: long xc = x.cvl;
16440: long xb = 0L;
16441: xb = xc << -48;
16442: xc = xd << -48 | xc >>> 48;
16443: xd >>>= 48;
16444: if (xb != 0L) {
16445: epbFpsr |= EPB_FPSR_X2;
16446: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16447: epbExceptionOperandMantissa = x.dvl;
16448: if (roundingMode == EPB_MODE_RN && xb < 0L && (xc << 63 | xb << 1) != 0L ||
16449: roundingMode == EPB_MODE_RM && xf < 0 ||
16450: roundingMode == EPB_MODE_RP && 0 <= xf) {
16451: xc++;
16452: if (xc == 0L) {
16453: xd++;
16454: if (xd >>> 16 != 0L) {
16455: xd = 1L << 15;
16456: xe++;
16457: }
16458: }
16459: }
16460:
16461: }
16462: xd = xd << 48 | xc >>> -48;
16463: xc <<= 48;
16464:
16465: this.flg = xf;
16466: this.epp = xe;
16467: this.dvl = xd;
16468: this.cvl = xc;
16469: return this;
16470: }
16471:
16472:
16473:
16474:
16475:
16476:
16477:
16478:
16479:
16480:
16481:
16482:
16483: public final EFP roundx () {
16484: return this.roundx (this, EPB_MODE_RN);
16485: }
16486: public final EFP roundx (int roundingMode) {
16487: return this.roundx (this, roundingMode);
16488: }
16489: public final EFP roundx2 (int roundingMode) {
16490: return this.roundx2 (this, roundingMode);
16491: }
16492: public final EFP roundx (EFP x) {
16493: return this.roundx (x, EPB_MODE_RN);
16494: }
16495: public final EFP roundx (EFP x, int roundingMode) {
16496: int xf = x.flg;
16497: if (xf << 1 != 0) {
16498: this.flg = xf;
16499: return this;
16500: }
16501:
16502: int xe = x.epp;
16503: long xd = x.dvl;
16504: long xc = x.cvl;
16505: if (xe < -16447) {
16506: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16507: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16508: epbExceptionOperandMantissa = xd;
16509: return this.sete (UNFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16510: }
16511: if (16383 < xe) {
16512: if (true) {
16513: epbFpsr |= EPB_FPSR_OF;
16514: if (xc != 0L) {
16515: epbFpsr |= EPB_FPSR_X2;
16516: }
16517: } else {
16518: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
16519: }
16520: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
16521: epbExceptionOperandMantissa = xd;
16522: return this.sete (OVFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16523: }
16524: long xb = 0L;
16525: int o = xe <= -16384 ? 0 + -16383 - xe : 0;
16526: if (o == 0) {
16527: } else if (o < 64) {
16528: xb = xc << -o;
16529: xc = xd << -o | xc >>> o;
16530: xd >>>= o;
16531: } else {
16532: xb = xc;
16533: xc = xd;
16534: xd = 0L;
16535: }
16536: if ((xc | xb) != 0L) {
16537: epbFpsr |= EPB_FPSR_X2;
16538: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16539: epbExceptionOperandMantissa = x.dvl;
16540: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
16541: roundingMode == EPB_MODE_RM && xf < 0 ||
16542: roundingMode == EPB_MODE_RP && 0 <= xf) {
16543: xd++;
16544: if (xd == 0L) {
16545: xd = MSB;
16546: xe++;
16547: if (16383 < xe) {
16548: epbFpsr |= EPB_FPSR_OF;
16549: return this.sete (OVFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16550: }
16551: } else if (0 < o) {
16552: if (xd << o - 1 < 0L) {
16553: xe++;
16554:
16555:
16556:
16557:
16558:
16559:
16560:
16561:
16562: }
16563: }
16564: }
16565:
16566: if (xe <= -16384) {
16567: epbFpsr |= EPB_FPSR_UF;
16568: if (xd == 0L) {
16569: return this.sete (UNFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16570: }
16571: }
16572: } else {
16573: if (xe <= -16384) {
16574: epbFpsr |= EPB_FPSR_UF;
16575: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16576: epbExceptionOperandMantissa = x.dvl;
16577: if (xd == 0L) {
16578: return this.sete (UNFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16579: }
16580: }
16581: }
16582: xd <<= Long.numberOfLeadingZeros (xd);
16583:
16584: this.flg = xf;
16585: this.epp = xe;
16586: this.dvl = xd;
16587: this.cvl = 0L;
16588: return this;
16589: }
16590: public final EFP roundx2 (EFP x, int roundingMode) {
16591: int xf = x.flg;
16592: if (xf << 1 != 0) {
16593: this.flg = xf;
16594: return this;
16595: }
16596:
16597: int xe = x.epp;
16598: long xd = x.dvl;
16599: long xc = x.cvl;
16600: if (xe < -16447) {
16601: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16602: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16603: epbExceptionOperandMantissa = xd;
16604: return this.sete (UNFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16605: }
16606: if (16383 < xe) {
16607: if (true) {
16608: epbFpsr |= EPB_FPSR_OF;
16609: if (xc != 0L) {
16610: epbFpsr |= EPB_FPSR_X2;
16611: }
16612: } else {
16613: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
16614: }
16615: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
16616: epbExceptionOperandMantissa = xd;
16617: return this.sete (OVFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16618: }
16619: long xb = 0L;
16620: int o = xe <= -16384 ? 0 + -16383 - xe : 0;
16621: if (o == 0) {
16622: } else if (o < 64) {
16623: xb = xc << -o;
16624: xc = xd << -o | xc >>> o;
16625: xd >>>= o;
16626: } else {
16627: xb = xc;
16628: xc = xd;
16629: xd = 0L;
16630: }
16631: if ((xc | xb) != 0L) {
16632: epbFpsr |= EPB_FPSR_X2;
16633: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16634: epbExceptionOperandMantissa = x.dvl;
16635: if (roundingMode == EPB_MODE_RN && xc < 0L && (xd << 63 | xc << 1 | xb) != 0L ||
16636: roundingMode == EPB_MODE_RM && xf < 0 ||
16637: roundingMode == EPB_MODE_RP && 0 <= xf) {
16638: xd++;
16639: if (xd == 0L) {
16640: xd = MSB;
16641: xe++;
16642: if (16383 < xe) {
16643: epbFpsr |= EPB_FPSR_OF;
16644: return this.sete (OVFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16645: }
16646: } else if (0 < o) {
16647: if (xd << o - 1 < 0L) {
16648: xe++;
16649:
16650: if (xe == -16383) {
16651:
16652: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16653: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16654: epbExceptionOperandMantissa = xd;
16655: }
16656:
16657: }
16658: }
16659: }
16660:
16661: if (xe <= -16384) {
16662: epbFpsr |= EPB_FPSR_UF;
16663: if (xd == 0L) {
16664: return this.sete (UNFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16665: }
16666: }
16667: } else {
16668: if (xe <= -16384) {
16669: epbFpsr |= EPB_FPSR_UF;
16670: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16671: epbExceptionOperandMantissa = x.dvl;
16672: if (xd == 0L) {
16673: return this.sete (UNFL_RESULTS[EPB_PREC_EXD << 3 | roundingMode << 1 | xf >>> 31]);
16674: }
16675: }
16676: }
16677: xd <<= Long.numberOfLeadingZeros (xd);
16678:
16679: this.flg = xf;
16680: this.epp = xe;
16681: this.dvl = xd;
16682: this.cvl = 0L;
16683: return this;
16684: }
16685:
16686:
16687:
16688:
16689:
16690:
16691:
16692:
16693:
16694:
16695:
16696:
16697: public final EFP roundy () {
16698: return this.roundy (this, EPB_MODE_RN);
16699: }
16700: public final EFP roundy (int roundingMode) {
16701: return this.roundy (this, roundingMode);
16702: }
16703: public final EFP roundy2 (int roundingMode) {
16704: return this.roundy2 (this, roundingMode);
16705: }
16706: public final EFP roundy (EFP x) {
16707: return this.roundy (x, EPB_MODE_RN);
16708: }
16709: public final EFP roundy (EFP x, int roundingMode) {
16710: int xf = x.flg;
16711: if (xf << 1 != 0) {
16712: this.flg = xf;
16713: return this;
16714: }
16715:
16716: int xe = x.epp;
16717: long xd = x.dvl;
16718: long xc = x.cvl;
16719: if (xe < -16463) {
16720: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16721: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16722: epbExceptionOperandMantissa = xd;
16723: return this.sete (UNFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16724: }
16725: if (16383 < xe) {
16726: if (true) {
16727: epbFpsr |= EPB_FPSR_OF;
16728: if (xc << 16 != 0L) {
16729: epbFpsr |= EPB_FPSR_X2;
16730: }
16731: } else {
16732: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
16733: }
16734: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
16735: epbExceptionOperandMantissa = xd;
16736: return this.sete (OVFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16737: }
16738: long xb = 0L;
16739: long xa = 0L;
16740: int o = xe <= -16384 ? 48 + -16383 - xe : 48;
16741: if (o < 64) {
16742: xb = xc << -o;
16743: xc = xd << -o | xc >>> o;
16744: xd >>>= o;
16745: } else if (o == 64) {
16746: xb = xc;
16747: xc = xd;
16748: xd = 0L;
16749: } else if (o < 128) {
16750: xa = xc << -o;
16751: xb = xd << -o | xc >>> o;
16752: xc = xd >>> o;
16753: xd = 0L;
16754: } else {
16755: xa = xc;
16756: xb = xd;
16757: xc = 0L;
16758: xd = 0L;
16759: }
16760: if ((xb | xa) != 0L) {
16761: epbFpsr |= EPB_FPSR_X2;
16762: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16763: epbExceptionOperandMantissa = x.dvl;
16764: if (roundingMode == EPB_MODE_RN && xb < 0L && (xc << 63 | xb << 1 | xa) != 0L ||
16765: roundingMode == EPB_MODE_RM && xf < 0 ||
16766: roundingMode == EPB_MODE_RP && 0 <= xf) {
16767: xc++;
16768: if (xc == 0L) {
16769: xd++;
16770: if (xd >>> 16 != 0L) {
16771:
16772: xe++;
16773: if (16383 < xe) {
16774: epbFpsr |= EPB_FPSR_OF;
16775: return this.sete (OVFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16776: }
16777: } else if (48 < o) {
16778: if (xd << o - 1 < 0L) {
16779: xe++;
16780:
16781:
16782:
16783:
16784:
16785:
16786:
16787:
16788: }
16789: }
16790: }
16791: }
16792:
16793: if (xe <= -16384) {
16794: epbFpsr |= EPB_FPSR_UF;
16795: if ((xd | xc) == 0L) {
16796: return this.sete (UNFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16797: }
16798: }
16799: } else {
16800: if (xe <= -16384) {
16801: epbFpsr |= EPB_FPSR_UF;
16802: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16803: epbExceptionOperandMantissa = x.dvl;
16804: if ((xd | xc) == 0L) {
16805: return this.sete (UNFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16806: }
16807: }
16808: }
16809: if (xd != 0L) {
16810: o = Long.numberOfLeadingZeros (xd);
16811: xd = xd << o | xc >>> -o;
16812: xc <<= o;
16813: } else {
16814: xd = xc << Long.numberOfLeadingZeros (xc);
16815: xc = 0L;
16816: }
16817:
16818: this.flg = xf;
16819: this.epp = xe;
16820: this.dvl = xd;
16821: this.cvl = xc;
16822: return this;
16823: }
16824: public final EFP roundy2 (EFP x, int roundingMode) {
16825: int xf = x.flg;
16826: if (xf << 1 != 0) {
16827: this.flg = xf;
16828: return this;
16829: }
16830:
16831: int xe = x.epp;
16832: long xd = x.dvl;
16833: long xc = x.cvl;
16834: if (xe < -16463) {
16835: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16836: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16837: epbExceptionOperandMantissa = xd;
16838: return this.sete (UNFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16839: }
16840: if (16383 < xe) {
16841: if (true) {
16842: epbFpsr |= EPB_FPSR_OF;
16843: if (xc << 16 != 0L) {
16844: epbFpsr |= EPB_FPSR_X2;
16845: }
16846: } else {
16847: epbFpsr |= EPB_FPSR_OF | EPB_FPSR_X2;
16848: }
16849: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + xe << 16;
16850: epbExceptionOperandMantissa = xd;
16851: return this.sete (OVFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16852: }
16853: long xb = 0L;
16854: long xa = 0L;
16855: int o = xe <= -16384 ? 48 + -16383 - xe : 48;
16856: if (o < 64) {
16857: xb = xc << -o;
16858: xc = xd << -o | xc >>> o;
16859: xd >>>= o;
16860: } else if (o == 64) {
16861: xb = xc;
16862: xc = xd;
16863: xd = 0L;
16864: } else if (o < 128) {
16865: xa = xc << -o;
16866: xb = xd << -o | xc >>> o;
16867: xc = xd >>> o;
16868: xd = 0L;
16869: } else {
16870: xa = xc;
16871: xb = xd;
16872: xc = 0L;
16873: xd = 0L;
16874: }
16875: if ((xb | xa) != 0L) {
16876: epbFpsr |= EPB_FPSR_X2;
16877: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16878: epbExceptionOperandMantissa = x.dvl;
16879: if (roundingMode == EPB_MODE_RN && xb < 0L && (xc << 63 | xb << 1 | xa) != 0L ||
16880: roundingMode == EPB_MODE_RM && xf < 0 ||
16881: roundingMode == EPB_MODE_RP && 0 <= xf) {
16882: xc++;
16883: if (xc == 0L) {
16884: xd++;
16885: if (xd >>> 16 != 0L) {
16886:
16887: xe++;
16888: if (16383 < xe) {
16889: epbFpsr |= EPB_FPSR_OF;
16890: return this.sete (OVFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16891: }
16892: } else if (48 < o) {
16893: if (xd << o - 1 < 0L) {
16894: xe++;
16895:
16896: if (xe == -16383) {
16897:
16898: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16899: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + xe << 16;
16900: epbExceptionOperandMantissa = xd;
16901: }
16902:
16903: }
16904: }
16905: }
16906: }
16907:
16908: if (xe <= -16384) {
16909: epbFpsr |= EPB_FPSR_UF;
16910: if ((xd | xc) == 0L) {
16911: return this.sete (UNFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16912: }
16913: }
16914: } else {
16915: if (xe <= -16384) {
16916: epbFpsr |= EPB_FPSR_UF;
16917: epbExceptionOperandExponent = x.flg & M | 0x3fff + 0x6000 + x.epp << 16;
16918: epbExceptionOperandMantissa = x.dvl;
16919: if ((xd | xc) == 0L) {
16920: return this.sete (UNFL_RESULTS[EPB_PREC_TPL << 3 | roundingMode << 1 | xf >>> 31]);
16921: }
16922: }
16923: }
16924: if (xd != 0L) {
16925: o = Long.numberOfLeadingZeros (xd);
16926: xd = xd << o | xc >>> -o;
16927: xc <<= o;
16928: } else {
16929: xd = xc << Long.numberOfLeadingZeros (xc);
16930: xc = 0L;
16931: }
16932:
16933: this.flg = xf;
16934: this.epp = xe;
16935: this.dvl = xd;
16936: this.cvl = xc;
16937: return this;
16938: }
16939:
16940:
16941:
16942:
16943:
16944:
16945:
16946:
16947: public final EFP scale (EFP y) {
16948: return this.scale (this, y);
16949: }
16950: public final EFP scale (EFP x, EFP y) {
16951: int xf = x.flg;
16952: int yf = y.flg;
16953: if ((xf | yf) << 1 != 0) {
16954: if ((xf | yf) << 3 < 0) {
16955: this.flg = N;
16956: } else if (yf << 1 < 0) {
16957: this.finish (x.flg, x.epp, x.dvl, x.cvl, 0L);
16958: } else if (yf << 2 < 0) {
16959: epbFpsr |= EPB_FPSR_OE;
16960: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
16961: epbExceptionOperandMantissa = 0x0000000000000000L;
16962: this.flg = N;
16963: } else if (xf << 1 < 0) {
16964: this.flg = xf;
16965: } else if (xf << 2 < 0) {
16966: this.flg = xf;
16967: }
16968: return this;
16969: }
16970:
16971:
16972:
16973: int i = (16 <= y.epp ? yf < 0 ? -1 << 16 : 1 << 16 :
16974: y.geti ());
16975: if (i <= -1 << 14) {
16976: epbFpsr |= EPB_FPSR_UF | EPB_FPSR_X2;
16977: if (i <= -1 << 16) {
16978: epbExceptionOperandExponent = xf;
16979: epbExceptionOperandMantissa = x.dvl;
16980: } else {
16981: epbExceptionOperandExponent = xf | 0x3fff + 0x6000 + i << 16;
16982: epbExceptionOperandMantissa = x.dvl;
16983: }
16984: return this.sete (UNFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
16985: }
16986: if (1 << 14 <= i) {
16987: epbFpsr |= EPB_FPSR_OF;
16988: if (1 << 16 <= i) {
16989: epbExceptionOperandExponent = xf;
16990: epbExceptionOperandMantissa = x.dvl;
16991: } else {
16992: epbExceptionOperandExponent = xf | 0x3fff - 0x6000 + i << 16;
16993: epbExceptionOperandMantissa = x.dvl;
16994: }
16995: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
16996: }
16997: return this.finish2 (xf, x.epp + i, x.dvl, x.cvl, 0L);
16998: }
16999:
17000:
17001:
17002:
17003:
17004:
17005:
17006:
17007:
17008:
17009:
17010:
17011:
17012:
17013:
17014:
17015:
17016:
17017:
17018:
17019:
17020:
17021:
17022:
17023:
17024:
17025:
17026:
17027:
17028:
17029:
17030:
17031:
17032:
17033:
17034:
17035:
17036:
17037:
17038:
17039:
17040:
17041:
17042:
17043:
17044:
17045:
17046:
17047:
17048:
17049:
17050:
17051:
17052:
17053:
17054:
17055: public final EFP sec () {
17056: return this.sec (this);
17057: }
17058: public final EFP sec (EFP x) {
17059: return this.inner ().cos (x).outer ().rcp ();
17060: }
17061:
17062:
17063:
17064:
17065:
17066:
17067:
17068:
17069:
17070:
17071:
17072:
17073:
17074:
17075:
17076:
17077:
17078:
17079:
17080:
17081:
17082:
17083:
17084:
17085:
17086:
17087:
17088:
17089:
17090:
17091:
17092:
17093:
17094:
17095:
17096:
17097:
17098:
17099:
17100:
17101:
17102:
17103:
17104:
17105:
17106:
17107:
17108:
17109:
17110:
17111:
17112:
17113:
17114:
17115:
17116:
17117:
17118:
17119:
17120:
17121: public final EFP sech () {
17122: return this.sech (this);
17123: }
17124: public final EFP sech (EFP x) {
17125: return this.inner ().cosh (x).outer ().rcp ();
17126: }
17127:
17128:
17129:
17130:
17131:
17132: public final EFP set0 () {
17133: this.flg = P | Z;
17134:
17135:
17136:
17137: return this;
17138: }
17139:
17140:
17141:
17142:
17143:
17144: public final EFP set1 () {
17145: this.flg = P;
17146: this.epp = 0;
17147: this.dvl = MSB;
17148: this.cvl = 0L;
17149: return this;
17150: }
17151:
17152:
17153:
17154:
17155:
17156:
17157:
17158:
17159:
17160:
17161:
17162:
17163:
17164:
17165:
17166:
17167:
17168:
17169:
17170:
17171: public final EFP setapery () {
17172: epbFpsr |= EPB_FPSR_X2;
17173: return this.sete (ROUNDED_APERY[epbRoundingMode]).finish ();
17174: }
17175:
17176:
17177:
17178:
17179:
17180:
17181:
17182:
17183:
17184:
17185:
17186:
17187:
17188:
17189:
17190:
17191:
17192:
17193:
17194: public final EFP setcatalan () {
17195: epbFpsr |= EPB_FPSR_X2;
17196: return this.sete (ROUNDED_CATALAN[epbRoundingMode]).finish ();
17197: }
17198:
17199:
17200:
17201:
17202:
17203:
17204:
17205:
17206: public final EFP setd (double d) {
17207: return this.setd01 (Double.doubleToLongBits (d));
17208: }
17209: public final EFP setd01 (byte[] b, int a) {
17210: return this.setd01 ((long) (b[a ] << 24 | (b[a + 1] & 255) << 16 | (char) (b[a + 2] << 8 | b[a + 3] & 255)) << 32 |
17211: (long) (b[a + 4] << 24 | (b[a + 5] & 255) << 16 | (char) (b[a + 6] << 8 | b[a + 7] & 255)) & 0xffffffffL);
17212: }
17213: public final EFP setd01 (long l) {
17214: int zf = (int) (l >>> 32) & M;
17215: int ze = ((int) (l >>> 52) & 0x7ff) - 1023;
17216: long zd = 0L;
17217: l &= -1L >>> 12;
17218: if (ze == 1024) {
17219: if (l == 0L) {
17220: zf |= I;
17221: } else {
17222: if (l << 12 >= 0L) {
17223: epbFpsr |= EPB_FPSR_SN;
17224: epbExceptionOperandExponent = 0x7fff << 16;
17225: epbExceptionOperandMantissa = 0xbfffffffffffffffL;
17226: }
17227: zf = N;
17228: }
17229: } else if (ze >= -1022) {
17230: zd = MSB | l << 11;
17231: } else if (l == 0L) {
17232: zf |= Z;
17233: } else {
17234: int o = Long.numberOfLeadingZeros (l);
17235: ze -= o - 12;
17236: zd = l << o;
17237: }
17238: this.flg = zf;
17239: this.epp = ze;
17240: this.dvl = zd;
17241: this.cvl = 0L;
17242:
17243:
17244: return this;
17245: }
17246:
17247:
17248:
17249:
17250:
17251:
17252:
17253:
17254: public final EFP sete (EFP x) {
17255: this.flg = x.flg;
17256: this.epp = x.epp;
17257: this.dvl = x.dvl;
17258: this.cvl = x.cvl;
17259: return this;
17260: }
17261:
17262:
17263:
17264:
17265:
17266:
17267:
17268:
17269:
17270:
17271:
17272:
17273:
17274:
17275:
17276:
17277:
17278:
17279: public final EFP seteuler () {
17280: epbFpsr |= EPB_FPSR_X2;
17281: return this.sete (ROUNDED_EULER[epbRoundingMode]).finish ();
17282: }
17283:
17284:
17285:
17286:
17287:
17288:
17289:
17290:
17291: public final EFP setf (float f) {
17292: return this.setf0 (Float.floatToIntBits (f));
17293: }
17294: public final EFP setf0 (byte[] b, int a) {
17295: return this.setf0 (b[a] << 24 | (b[a + 1] & 255) << 16 | (char) (b[a + 2] << 8 | b[a + 3] & 255));
17296: }
17297: public final EFP setf0 (int i) {
17298: int zf = i & M;
17299: int ze = (i >>> 23 & 0xff) - 127;
17300: long zd = 0L;
17301: i &= -1 >>> 9;
17302: if (ze == 128) {
17303: if (i == 0) {
17304: zf |= I;
17305: } else {
17306: if (i << 9 >= 0) {
17307: epbFpsr |= EPB_FPSR_SN;
17308: epbExceptionOperandExponent = 0x7fff << 16;
17309: epbExceptionOperandMantissa = 0xbfffffffffffffffL;
17310: }
17311: zf = N;
17312: }
17313: } else if (ze >= -126) {
17314: zd = (long) (1 << 23 | i) << 32 + 8;
17315: } else if (i == 0) {
17316: zf |= Z;
17317: } else {
17318: int o = Integer.numberOfLeadingZeros (i);
17319: ze -= o - 9;
17320: zd = (long) i << 32 + o;
17321: }
17322: this.flg = zf;
17323: this.epp = ze;
17324: this.dvl = zd;
17325: this.cvl = 0L;
17326:
17327:
17328: return this;
17329: }
17330:
17331:
17332:
17333:
17334:
17335: public final EFP seti (int i) {
17336: if (i == 0) {
17337: this.flg = P | Z;
17338: return this;
17339: }
17340: int zf = P;
17341: if (i < 0) {
17342: zf = M;
17343: i = -i;
17344: }
17345: int ze = 31 - Integer.numberOfLeadingZeros (i);
17346: long zd = (long) i << 63 - ze;
17347: return this.finish (zf, ze, zd, 0L, 0L);
17348: }
17349:
17350:
17351:
17352:
17353:
17354: public final EFP setinf () {
17355: this.flg = P | I;
17356:
17357:
17358:
17359: return this;
17360: }
17361:
17362:
17363:
17364:
17365:
17366: public final EFP setl (long l) {
17367: if (l == 0L) {
17368: this.flg = P | Z;
17369: return this;
17370: }
17371: int zf = P;
17372: if (l < 0L) {
17373: zf = M;
17374: l = -l;
17375: }
17376: int ze = 63 - Long.numberOfLeadingZeros (l);
17377: long zd = l << ~ze;
17378: return this.finish (zf, ze, zd, 0L, 0L);
17379: }
17380:
17381:
17382:
17383:
17384:
17385:
17386:
17387: public final EFP setmax () {
17388: return this.finish (P, 32767, 0xffffffffffffffffL, 0xffffffffffffffffL << 128 - LEN, 0L);
17389: }
17390:
17391:
17392:
17393:
17394:
17395:
17396:
17397: public final EFP setmin () {
17398: return this.finish (M, -32767, MSB, 0L, 0L);
17399: }
17400:
17401:
17402:
17403:
17404:
17405: public final EFP setnan () {
17406: this.flg = N;
17407:
17408:
17409:
17410: return this;
17411: }
17412:
17413:
17414:
17415:
17416:
17417:
17418:
17419:
17420:
17421:
17422:
17423:
17424:
17425:
17426:
17427:
17428:
17429:
17430: public final EFP setnapier () {
17431: epbFpsr |= EPB_FPSR_X2;
17432: return this.sete (ROUNDED_NAPIER[epbRoundingMode]).finish ();
17433: }
17434:
17435:
17436:
17437:
17438:
17439:
17440: public final EFP setp012 (byte[] b, int a) {
17441: return this.setp012 (b[a] << 24 | (b[a + 1] & 255) << 16 | (char) (b[a + 2] << 8 | b[a + 3] & 255),
17442: (long) (b[a + 4] << 24 | (b[a + 5] & 255) << 16 | (char) (b[a + 6] << 8 | b[a + 7] & 255)) << 32 |
17443: (long) (b[a + 8] << 24 | (b[a + 9] & 255) << 16 | (char) (b[a + 10] << 8 | b[a + 11] & 255)) & 0xffffffffL);
17444: }
17445: public final EFP setp012 (int u, long v) {
17446: int zf = u & M;
17447: int e = XEiJ.FMT_DCB4[u >>> 16 & 0xfff];
17448: int m0 = XEiJ.FMT_DCB4[u & 0x000f];
17449: int m1 = XEiJ.FMT_DCB4[(char) (v >>> 48)];
17450: int m2 = XEiJ.FMT_DCB4[(char) (v >>> 32)];
17451: int m3 = XEiJ.FMT_DCB4[(char) (v >>> 16)];
17452: int m4 = XEiJ.FMT_DCB4[(char) v ];
17453: {
17454: int t = m0 | m1 | m2 | m3 | m4;
17455: if ((u & 0x30000000) != 0 ||
17456: (e | t) < 0) {
17457: if (v == 0L) {
17458: this.flg = zf | I;
17459: } else {
17460: if (v << 1 >= 0L) {
17461: epbFpsr |= EPB_FPSR_SN;
17462: epbExceptionOperandExponent = 0x7fff << 16;
17463: epbExceptionOperandMantissa = 0xbfffffffffffffffL;
17464: }
17465: this.flg = N;
17466: }
17467: return this;
17468: }
17469: if (t == 0) {
17470: this.flg = zf | Z;
17471: return this;
17472: }
17473: }
17474:
17475:
17476: int savedMode = epbRoundingMode;
17477: int savedFpsr = epbFpsr;
17478: epbFpsr = 0;
17479:
17480: this.inner ();
17481: EFP t = new EFP ();
17482: this.setl ((long) (m0 * 100000000 + m1 * 10000 + m2)).imul (TENXP3).iadd (t.setl ((long) (m3 * 10000 + m4)));
17483:
17484:
17485: this.flg |= zf;
17486:
17487: if (u << 1 < 0) {
17488: e = -e;
17489: }
17490: e -= 16;
17491: if (e < 0) {
17492: e = -e;
17493: t.set1 ();
17494: for (int i = 0; e != 0; i++, e >>>= 1) {
17495: if ((e & 1) != 0) {
17496: t.imul (EFP_TEN_POWER_P[i]);
17497: }
17498: }
17499: epbRoundingPrec = EPB_PREC_EXD;
17500: epbRoundingMode = savedMode;
17501: this.div (t);
17502: } else {
17503: t.set1 ();
17504: for (int i = 0; e != 0; i++, e >>>= 1) {
17505: if ((e & 1) != 0) {
17506: t.imul (EFP_TEN_POWER_P[i]);
17507: }
17508: }
17509: epbRoundingPrec = EPB_PREC_EXD;
17510: epbRoundingMode = savedMode;
17511: this.mul (t);
17512: }
17513: this.outer ();
17514:
17515: epbFpsr = savedFpsr | epbFpsr >>> 1 & EPB_FPSR_X1;
17516:
17517:
17518: return this.finish ();
17519: }
17520:
17521:
17522:
17523:
17524:
17525:
17526:
17527:
17528:
17529:
17530:
17531:
17532:
17533:
17534:
17535:
17536:
17537:
17538:
17539:
17540:
17541:
17542:
17543:
17544:
17545:
17546:
17547:
17548:
17549:
17550:
17551:
17552:
17553:
17554:
17555:
17556:
17557:
17558:
17559:
17560:
17561:
17562:
17563:
17564:
17565:
17566:
17567:
17568:
17569:
17570:
17571:
17572:
17573:
17574:
17575:
17576:
17577:
17578: public final EFP setpi () {
17579: epbFpsr |= EPB_FPSR_X2;
17580: return this.sete (ROUNDED_PI[epbRoundingMode]).finish ();
17581: }
17582:
17583:
17584:
17585:
17586:
17587:
17588:
17589: public final EFP setx012 (byte[] b, int a) {
17590: return this.setx012 (b[a] << 24 | (b[a + 1] & 255) << 16 | (char) (b[a + 2] << 8 | b[a + 3] & 255),
17591: (long) (b[a + 4] << 24 | (b[a + 5] & 255) << 16 | (char) (b[a + 6] << 8 | b[a + 7] & 255)) << 32 |
17592: (long) (b[a + 8] << 24 | (b[a + 9] & 255) << 16 | (char) (b[a + 10] << 8 | b[a + 11] & 255)) & 0xffffffffL);
17593: }
17594: public final EFP setx012 (int i, long l) {
17595: int zf = i & M;
17596: int ze = (i >>> 16 & 32767) - 16383;
17597: if (ze == 16384) {
17598: if (l == 0L) {
17599: this.flg = zf | I;
17600: } else {
17601: if (l << 1 >= 0L) {
17602: epbFpsr |= EPB_FPSR_SN;
17603: epbExceptionOperandExponent = 0x7fff << 16;
17604: epbExceptionOperandMantissa = 0xbfffffffffffffffL;
17605: }
17606: this.flg = N;
17607: }
17608: return this;
17609: }
17610: if (l == 0L) {
17611: this.flg = zf | Z;
17612: return this;
17613: }
17614: if (l >= 0L) {
17615: int o = Long.numberOfLeadingZeros (l);
17616: ze -= o;
17617: l <<= o;
17618: }
17619: this.flg = zf;
17620: this.epp = ze;
17621: this.dvl = l;
17622: this.cvl = 0L;
17623:
17624:
17625: return this;
17626: }
17627:
17628:
17629:
17630:
17631:
17632:
17633:
17634: public final EFP sety012 (byte[] b, int a) {
17635: return this.sety012 (b[a] << 24 | (b[a + 1] & 255) << 16 | (char) (b[a + 2] << 8 | b[a + 3] & 255),
17636: (long) (b[a + 4] << 24 | (b[a + 5] & 255) << 16 | (char) (b[a + 6] << 8 | b[a + 7] & 255)) << 32 |
17637: (long) (b[a + 8] << 24 | (b[a + 9] & 255) << 16 | (char) (b[a + 10] << 8 | b[a + 11] & 255)) & 0xffffffffL);
17638: }
17639: public final EFP sety012 (int i, long l) {
17640: int zf = i & M;
17641: int ze = (i >>> 16 & 32767) - 16383;
17642: if (ze == 16384) {
17643: if (l == 0L) {
17644: this.flg = zf | I;
17645: } else {
17646: if (l << 1 >= 0L) {
17647: epbFpsr |= EPB_FPSR_SN;
17648: epbExceptionOperandExponent = 0x7fff << 16;
17649: epbExceptionOperandMantissa = 0xbfffffffffffffffL;
17650: }
17651: this.flg = N;
17652: }
17653: return this;
17654: }
17655: long m = (long) i << 48;
17656: if (l == 0L && m == 0L) {
17657: this.flg = zf | Z;
17658: return this;
17659: }
17660: if (l >= 0L) {
17661: if (l != 0L) {
17662: int o = Long.numberOfLeadingZeros (l);
17663: ze -= o;
17664: l = l << o | m >>> -o;
17665: m <<= o;
17666: } else {
17667: int o = 64 + Long.numberOfLeadingZeros (m);
17668: ze -= o;
17669: l = m << o;
17670: m = 0L;
17671: }
17672: }
17673: this.flg = zf;
17674: this.epp = ze;
17675: this.dvl = l;
17676: this.cvl = m;
17677:
17678:
17679: return this;
17680: }
17681:
17682:
17683:
17684:
17685:
17686:
17687:
17688:
17689:
17690:
17691:
17692:
17693:
17694:
17695:
17696:
17697:
17698:
17699:
17700:
17701:
17702:
17703:
17704:
17705:
17706:
17707:
17708:
17709:
17710:
17711:
17712:
17713:
17714:
17715:
17716:
17717:
17718:
17719:
17720:
17721:
17722:
17723:
17724:
17725:
17726:
17727:
17728:
17729:
17730:
17731:
17732:
17733:
17734:
17735:
17736:
17737:
17738:
17739:
17740:
17741:
17742: public final EFP sgn () {
17743: return this.sgn (this);
17744: }
17745: public final EFP sgn (EFP x) {
17746: int xf = x.flg;
17747: if ((xf & (Z | N)) != 0) {
17748: this.flg = xf;
17749: } else {
17750: this.flg = xf & M;
17751: this.epp = 0;
17752: this.dvl = MSB;
17753: this.cvl = 0L;
17754: }
17755: return this;
17756: }
17757:
17758:
17759:
17760:
17761:
17762:
17763:
17764:
17765:
17766:
17767:
17768:
17769:
17770:
17771:
17772:
17773:
17774:
17775:
17776:
17777:
17778:
17779:
17780:
17781:
17782:
17783:
17784:
17785:
17786:
17787:
17788: public final EFP sgnsub (EFP y) {
17789: return this.sgnsub (this, y);
17790: }
17791: public final EFP sgnsub (EFP x, EFP y) {
17792: int xf = x.flg;
17793: int yf = y.flg;
17794: if ((xf | yf) << 1 != 0) {
17795: if ((xf & yf) << 1 < 0 && xf == yf) {
17796: this.flg = P | Z;
17797: } else if ((xf & yf) << 2 < 0 && xf == yf ||
17798: (xf | yf) << 3 < 0) {
17799: this.flg = N;
17800: } else if ((xf << 1 | yf << 2) < 0) {
17801: if (yf << 1 < 0) {
17802: this.flg = yf ^ M;
17803: } else {
17804: this.flg = yf & M ^ M;
17805: this.epp = 0;
17806: this.dvl = MSB;
17807: this.cvl = 0L;
17808: }
17809: } else {
17810: this.flg = xf & M;
17811: this.epp = 0;
17812: this.dvl = MSB;
17813: this.cvl = 0L;
17814: }
17815: } else if (xf != yf) {
17816: this.flg = xf >= 0 ? P : M;
17817: this.epp = 0;
17818: this.dvl = MSB;
17819: this.cvl = 0L;
17820: } else {
17821: int s;
17822: long t;
17823: s = (xf >= 0 ? 1 : -1) * ((s = x.epp - y.epp) != 0 ? s >= 0 ? 1 : -1 :
17824: (t = x.dvl - y.dvl) != 0L ? t >= 0L ? 1 : -1 :
17825: (t = (x.cvl >>> 1) - (y.cvl >>> 1)) != 0L ? t >= 0L ? 1 : -1 :
17826: 0);
17827: if (s != 0) {
17828: this.flg = s >= 0 ? P : M;
17829: this.epp = 0;
17830: this.dvl = MSB;
17831: this.cvl = 0L;
17832: } else {
17833: this.flg = P | Z;
17834: }
17835: }
17836: return this;
17837: }
17838:
17839:
17840:
17841:
17842:
17843:
17844:
17845:
17846: public final EFP shl (int n) {
17847:
17848: n = Math.max (-65536, Math.min (65536, n));
17849: return this.finish (this.flg, this.epp + n, this.dvl, this.cvl, 0L);
17850: }
17851: public final EFP shl (EFP x, int n) {
17852:
17853: n = Math.max (-65536, Math.min (65536, n));
17854: return this.finish (x.flg, x.epp + n, x.dvl, x.cvl, 0L);
17855: }
17856:
17857:
17858:
17859:
17860:
17861:
17862:
17863:
17864: public final EFP shr (int n) {
17865:
17866: n = Math.max (-65536, Math.min (65536, n));
17867: return this.finish (this.flg, this.epp - n, this.dvl, this.cvl, 0L);
17868: }
17869: public final EFP shr (EFP x, int n) {
17870:
17871: n = Math.max (-65536, Math.min (65536, n));
17872: return this.finish (x.flg, x.epp - n, x.dvl, x.cvl, 0L);
17873: }
17874:
17875:
17876:
17877:
17878:
17879:
17880:
17881:
17882:
17883:
17884:
17885:
17886:
17887:
17888:
17889:
17890:
17891:
17892:
17893:
17894:
17895:
17896:
17897:
17898:
17899:
17900:
17901:
17902:
17903:
17904:
17905:
17906:
17907:
17908:
17909:
17910:
17911:
17912:
17913:
17914:
17915:
17916:
17917:
17918:
17919:
17920:
17921:
17922:
17923:
17924:
17925:
17926:
17927:
17928:
17929:
17930:
17931:
17932:
17933:
17934:
17935:
17936:
17937:
17938:
17939:
17940:
17941:
17942:
17943:
17944:
17945:
17946:
17947:
17948:
17949:
17950:
17951:
17952:
17953:
17954:
17955:
17956:
17957:
17958:
17959:
17960:
17961:
17962:
17963:
17964:
17965:
17966:
17967:
17968:
17969:
17970:
17971:
17972:
17973:
17974:
17975:
17976:
17977:
17978:
17979:
17980:
17981: public final EFP sin () {
17982: return this.sin (this);
17983: }
17984: public final EFP sin (EFP x) {
17985: int xf = x.flg;
17986: if (xf << 1 != 0) {
17987: if (xf << 1 < 0) {
17988: this.flg = xf;
17989: } else if (xf << 2 < 0) {
17990: epbFpsr |= EPB_FPSR_OE;
17991: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
17992: epbExceptionOperandMantissa = 0x0000000000000000L;
17993: this.flg = N;
17994: } else {
17995: this.flg = N;
17996: }
17997: return this;
17998: }
17999:
18000: int savedFpsr = epbFpsr;
18001: this.inner ();
18002: if (this == x) {
18003: x = new EFP (x);
18004: }
18005: EFP u = new EFP ();
18006: EFP u2 = new EFP ();
18007: int k = u.ieeerempi2 (x);
18008: if (false) {
18009: EFP s = new EFP ();
18010: EFP t = new EFP ();
18011: u2.isqu (u);
18012: if ((k & 1) == 0) {
18013:
18014: s.flg = u.flg;
18015: s.epp = u.epp;
18016: s.dvl = u.dvl;
18017: s.cvl = u.cvl;
18018:
18019: t.flg = P | Z;
18020:
18021: this.flg = s.flg;
18022: this.epp = s.epp;
18023: this.dvl = s.dvl;
18024: this.cvl = s.cvl;
18025: for (int twok1 = 3; this.ne (t); twok1 += 2) {
18026: s.imul (u2).divi ((1 - twok1) * twok1);
18027:
18028: t.flg = this.flg;
18029: t.epp = this.epp;
18030: t.dvl = this.dvl;
18031: t.cvl = this.cvl;
18032: this.iadd (s);
18033: }
18034: } else {
18035:
18036: s.flg = P;
18037: s.epp = 0;
18038: s.dvl = MSB;
18039: s.cvl = 0L;
18040:
18041: t.flg = P | Z;
18042:
18043: this.flg = s.flg;
18044: this.epp = s.epp;
18045: this.dvl = s.dvl;
18046: this.cvl = s.cvl;
18047: for (int twok = 2; this.ne (t); twok += 2) {
18048: s.imul (u2).divi ((1 - twok) * twok);
18049:
18050: t.flg = this.flg;
18051: t.epp = this.epp;
18052: t.dvl = this.dvl;
18053: t.cvl = this.cvl;
18054: this.iadd (s);
18055: }
18056: }
18057: } else {
18058: if ((k & 1) == 0) {
18059: u2.isqu (u);
18060: this.imul (SIN_C21, u2)
18061: .iadd (SIN_C19).imul (u2)
18062: .iadd (SIN_C17).imul (u2)
18063: .iadd (SIN_C15).imul (u2)
18064: .iadd (SIN_C13).imul (u2)
18065: .iadd (SIN_C11).imul (u2)
18066: .iadd (SIN_C9).imul (u2)
18067: .iadd (SIN_C7).imul (u2)
18068: .iadd (SIN_C5).imul (u2)
18069: .iadd (SIN_C3).imul (u2)
18070: .iadd (SIN_C1).imul (u);
18071: } else {
18072: u2.isqu (u);
18073: this.imul (COS_C20, u2)
18074: .iadd (COS_C18).imul (u2)
18075: .iadd (COS_C16).imul (u2)
18076: .iadd (COS_C14).imul (u2)
18077: .iadd (COS_C12).imul (u2)
18078: .iadd (COS_C10).imul (u2)
18079: .iadd (COS_C8).imul (u2)
18080: .iadd (COS_C6).imul (u2)
18081: .iadd (COS_C4).imul (u2)
18082: .iadd (COS_C2).imul (u2)
18083: .iadd (COS_C0);
18084: }
18085: }
18086: this.outer ().neg (k << 30 < 0);
18087:
18088:
18089:
18090: if (this.flg << 1 == 0 && this.epp == 0) {
18091: if (this.flg < 0) {
18092: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
18093: this.sete (NEXTUP_MINUSONE[epbRoundingPrec]);
18094: }
18095: } else {
18096: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
18097: this.sete (NEXTDOWN_PLUSONE[epbRoundingPrec]);
18098: }
18099: }
18100: }
18101: return this.originUpperLower (x).correctUnderflow (savedFpsr);
18102: }
18103:
18104:
18105:
18106:
18107:
18108:
18109:
18110:
18111:
18112:
18113:
18114:
18115:
18116:
18117:
18118:
18119:
18120:
18121:
18122:
18123:
18124:
18125:
18126:
18127:
18128:
18129:
18130:
18131:
18132:
18133:
18134:
18135:
18136:
18137:
18138:
18139:
18140:
18141:
18142:
18143:
18144:
18145:
18146:
18147:
18148:
18149:
18150:
18151:
18152:
18153:
18154:
18155:
18156:
18157:
18158:
18159:
18160:
18161:
18162:
18163:
18164:
18165:
18166:
18167:
18168:
18169:
18170:
18171:
18172:
18173:
18174:
18175:
18176:
18177:
18178:
18179:
18180:
18181:
18182: public final EFP sinh () {
18183: return this.sinh (this);
18184: }
18185: public final EFP sinh (EFP x) {
18186: int xf = x.flg;
18187: if (xf << 1 != 0) {
18188: this.flg = xf;
18189: return this;
18190: }
18191:
18192: epbFpsr |= EPB_FPSR_X2;
18193: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
18194: epbExceptionOperandMantissa = x.dvl;
18195: if (15 <= x.epp) {
18196: epbFpsr |= EPB_FPSR_OF;
18197: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | xf >>> 31]).finish ();
18198: }
18199: if (x.epp < -3) {
18200: int savedFpsr = epbFpsr;
18201: this.inner ();
18202: if (this == x) {
18203: x = new EFP (x);
18204: }
18205: EFP x2 = new EFP ().isqu (x);
18206: this.imul (SINH_C13, x2)
18207: .iadd (SINH_C11).imul (x2)
18208: .iadd (SINH_C9).imul (x2)
18209: .iadd (SINH_C7).imul (x2)
18210: .iadd (SINH_C5).imul (x2)
18211: .iadd (SINH_C3).imul (x2)
18212: .iadd (SINH_C1).outer ().mul (x);
18213: return this.originLowerUpper (x).correctUnderflow (savedFpsr);
18214: }
18215:
18216:
18217:
18218:
18219: this.inner ().abs (x).exp ();
18220: this.sub (new EFP ().rcp (this)).div2 ().outer ().neg (xf < 0);
18221: if (this.flg << 2 < 0) {
18222: epbFpsr |= EPB_FPSR_OF;
18223: return this.sete (OVFL_RESULTS[epbRoundingPrec << 3 | epbRoundingMode << 1 | this.flg >>> 31]).finish ();
18224: }
18225: return this;
18226: }
18227:
18228:
18229:
18230:
18231:
18232:
18233:
18234:
18235:
18236:
18237:
18238:
18239:
18240:
18241:
18242:
18243:
18244:
18245:
18246:
18247:
18248:
18249:
18250:
18251:
18252:
18253:
18254:
18255:
18256:
18257:
18258:
18259:
18260:
18261:
18262:
18263:
18264:
18265:
18266:
18267:
18268:
18269:
18270:
18271:
18272:
18273:
18274:
18275:
18276:
18277:
18278:
18279:
18280:
18281:
18282:
18283:
18284:
18285:
18286:
18287:
18288:
18289:
18290:
18291:
18292:
18293:
18294:
18295:
18296:
18297:
18298:
18299:
18300:
18301:
18302:
18303:
18304:
18305:
18306:
18307:
18308:
18309:
18310:
18311:
18312:
18313:
18314:
18315:
18316:
18317:
18318:
18319:
18320:
18321:
18322:
18323:
18324:
18325:
18326:
18327:
18328:
18329:
18330:
18331:
18332:
18333:
18334:
18335:
18336:
18337:
18338:
18339:
18340:
18341:
18342:
18343:
18344:
18345:
18346:
18347:
18348:
18349:
18350:
18351:
18352:
18353:
18354:
18355:
18356:
18357:
18358:
18359:
18360:
18361:
18362:
18363:
18364:
18365:
18366:
18367:
18368:
18369:
18370:
18371:
18372:
18373:
18374:
18375: public final EFP sqrt () {
18376: return this.sqrt (this);
18377: }
18378: public final EFP sqrt (EFP x) {
18379: int xf = x.flg;
18380: if (xf != 0) {
18381: if (xf == M || xf == (M | I)) {
18382: epbFpsr |= EPB_FPSR_OE;
18383: if (xf << 2 < 0) {
18384: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
18385: epbExceptionOperandMantissa = 0x0000000000000000L;
18386: } else {
18387: epbExceptionOperandExponent = xf & M | 0x3fff + x.epp << 16;
18388: epbExceptionOperandMantissa = x.dvl;
18389: }
18390: this.flg = N;
18391: } else {
18392: this.flg = xf;
18393: }
18394: return this;
18395: }
18396:
18397: if (false) {
18398: this.inner ();
18399: EFP t = new EFP (ONE).max (x);
18400: EFP u = new EFP (x);
18401: EFP w = new EFP ();
18402: do {
18403:
18404: this.flg = t.flg;
18405: this.epp = t.epp;
18406: this.dvl = t.dvl;
18407: this.cvl = t.cvl;
18408: t.iadd (w.sete (u).div (t)).idiv2 ();
18409: } while (this.gt (t));
18410: return this.outer ().finish ();
18411: } else {
18412: if (this == x) {
18413: x = new EFP (x);
18414: }
18415: int xe = x.epp;
18416: if ((xe & 1) != 0 ? (x.dvl >>> -8) == 0xFF : (x.dvl >>> -9) == 0x100) {
18417:
18418:
18419: this.inner ();
18420: x.epp = -(xe & 1);
18421: x.dec ();
18422: this.imul (x, SQRT1PM1_C11).
18423: iadd (SQRT1PM1_C10).imul (x).
18424: iadd (SQRT1PM1_C9).imul (x).
18425: iadd (SQRT1PM1_C8).imul (x).
18426: iadd (SQRT1PM1_C7).imul (x).
18427: iadd (SQRT1PM1_C6).imul (x).
18428: iadd (SQRT1PM1_C5).imul (x).
18429: iadd (SQRT1PM1_C4).imul (x).
18430: iadd (SQRT1PM1_C3).imul (x).
18431: iadd (SQRT1PM1_C2).imul (x).
18432: iadd (SQRT1PM1_C1).imul (x);
18433: this.outer ().inc ();
18434: if (this.flg << 1 == 0) {
18435:
18436:
18437:
18438:
18439:
18440:
18441:
18442:
18443:
18444:
18445:
18446:
18447:
18448:
18449:
18450:
18451:
18452: this.epp += xe + 1 >> 1;
18453: this.finish ();
18454: }
18455: return this;
18456: }
18457:
18458:
18459:
18460:
18461:
18462:
18463:
18464:
18465:
18466:
18467:
18468: long s = Double.doubleToLongBits (Math.sqrt (Double.longBitsToDouble ((long) (1023 + (xe & 1)) << 52 | x.dvl << 1 >>> 12)));
18469: EFP t = new EFP (P, (int) (s >>> 52) - 1023 + (xe >> 1), MSB | s << 12 >>> 1, 0L);
18470: int savedFpsr = epbFpsr;
18471: this.inner ().div (x, t).iadd (t).outer ();
18472: this.epp--;
18473: epbFpsr = 0;
18474: this.finish ();
18475: savedFpsr |= epbFpsr & (EPB_FPSR_OF | EPB_FPSR_UF);
18476: this.inner ();
18477: t.squ (this);
18478: this.outer ();
18479: if ((epbFpsr & EPB_FPSR_X2) != 0 || !t.eq (x)) {
18480: savedFpsr |= EPB_FPSR_X2;
18481: epbExceptionOperandExponent = xf | 0x3fff + x.epp << 16;
18482: epbExceptionOperandMantissa = x.dvl;
18483: }
18484: epbFpsr = savedFpsr;
18485: return this;
18486: }
18487: }
18488:
18489:
18490:
18491:
18492:
18493:
18494:
18495:
18496:
18497:
18498:
18499:
18500:
18501:
18502:
18503:
18504:
18505:
18506:
18507:
18508:
18509:
18510:
18511:
18512:
18513:
18514:
18515:
18516:
18517:
18518:
18519:
18520:
18521:
18522:
18523:
18524:
18525:
18526:
18527:
18528:
18529:
18530:
18531:
18532:
18533:
18534:
18535:
18536:
18537:
18538:
18539:
18540:
18541: public final EFP squ () {
18542: int xf = this.flg;
18543: if (xf << 1 != 0) {
18544: this.flg = xf << 3 < 0 ? N : xf & ~M;
18545: return this;
18546: }
18547:
18548:
18549: long zd = this.dvl;
18550: long zc = this.cvl;
18551: long zb = (zd << -2 | zc >>> 2) >>> -30;
18552: zc = zd << 32 >>> -30;
18553: zd >>>= 32;
18554:
18555:
18556: long t = zb * zb;
18557: long s = t & 0xffffffffL;
18558: t = (t >>> 30) + (zc * zb << 1);
18559: s |= t & 0xffffffffL;
18560: t = (t >>> 30) + (zd * zb << 1) + zc * zc;
18561: s |= t & 0xffffffffL;
18562: t = (t >>> 30) + (zd * zc << 1);
18563: zd = (t >>> 30) + zd * zd;
18564: zc = t << -30 | s;
18565: int ze = this.epp << 1;
18566: if (zd < 0L) {
18567: ze++;
18568: } else {
18569: zd = zd << 1 | zc >>> -1;
18570: zc <<= 1;
18571: }
18572: return this.finish (P, ze, zd, zc, 0L);
18573: }
18574: public final EFP isqu () {
18575: int xf = this.flg;
18576: if (xf << 1 != 0) {
18577: this.flg = xf << 3 < 0 ? N : xf & ~M;
18578: return this;
18579: }
18580:
18581:
18582: long zd = this.dvl;
18583: long zc = this.cvl;
18584: long zb = (zd << -2 | zc >>> 2) >>> -30;
18585: zc = zd << 32 >>> -30;
18586: zd >>>= 32;
18587:
18588:
18589: long t = zb * zb;
18590: long s = t & 0xffffffffL;
18591: t = (t >>> 30) + (zc * zb << 1);
18592: s |= t & 0xffffffffL;
18593: t = (t >>> 30) + (zd * zb << 1) + zc * zc;
18594: s |= t & 0xffffffffL;
18595: t = (t >>> 30) + (zd * zc << 1);
18596: zd = (t >>> 30) + zd * zd;
18597: zc = t << -30 | s;
18598: int ze = this.epp << 1;
18599: if (zd < 0L) {
18600: ze++;
18601: } else {
18602: zd = zd << 1 | zc >>> -1;
18603: zc <<= 1;
18604: }
18605: return this.ifinish (P, ze, zd, zc, 0L);
18606: }
18607: public final EFP squ (EFP x) {
18608:
18609:
18610: int xf = x.flg;
18611: if (xf << 1 != 0) {
18612: this.flg = xf << 3 < 0 ? N : xf & ~M;
18613: return this;
18614: }
18615:
18616:
18617: long zd = x.dvl;
18618: long zc = x.cvl;
18619: long zb = (zd << -2 | zc >>> 2) >>> -30;
18620: zc = zd << 32 >>> -30;
18621: zd >>>= 32;
18622:
18623:
18624: long t = zb * zb;
18625: long s = t & 0xffffffffL;
18626: t = (t >>> 30) + (zc * zb << 1);
18627: s |= t & 0xffffffffL;
18628: t = (t >>> 30) + (zd * zb << 1) + zc * zc;
18629: s |= t & 0xffffffffL;
18630: t = (t >>> 30) + (zd * zc << 1);
18631: zd = (t >>> 30) + zd * zd;
18632: zc = t << -30 | s;
18633: int ze = x.epp << 1;
18634: if (zd < 0L) {
18635: ze++;
18636: } else {
18637: zd = zd << 1 | zc >>> -1;
18638: zc <<= 1;
18639: }
18640: return this.finish (P, ze, zd, zc, 0L);
18641: }
18642: public final EFP isqu (EFP x) {
18643:
18644:
18645: int xf = x.flg;
18646: if (xf << 1 != 0) {
18647: this.flg = xf << 3 < 0 ? N : xf & ~M;
18648: return this;
18649: }
18650:
18651:
18652: long zd = x.dvl;
18653: long zc = x.cvl;
18654: long zb = (zd << -2 | zc >>> 2) >>> -30;
18655: zc = zd << 32 >>> -30;
18656: zd >>>= 32;
18657:
18658:
18659: long t = zb * zb;
18660: long s = t & 0xffffffffL;
18661: t = (t >>> 30) + (zc * zb << 1);
18662: s |= t & 0xffffffffL;
18663: t = (t >>> 30) + (zd * zb << 1) + zc * zc;
18664: s |= t & 0xffffffffL;
18665: t = (t >>> 30) + (zd * zc << 1);
18666: zd = (t >>> 30) + zd * zd;
18667: zc = t << -30 | s;
18668: int ze = x.epp << 1;
18669: if (zd < 0L) {
18670: ze++;
18671: } else {
18672: zd = zd << 1 | zc >>> -1;
18673: zc <<= 1;
18674: }
18675: return this.ifinish (P, ze, zd, zc, 0L);
18676: }
18677:
18678:
18679:
18680:
18681:
18682:
18683:
18684:
18685:
18686:
18687:
18688:
18689: public final EFP sub (EFP y) {
18690: int xf = this.flg;
18691: int xe = this.epp;
18692: long xd = this.dvl;
18693: long xc = this.cvl;
18694: long xb = 0L;
18695: int yf = y.flg;
18696: if ((xf | yf) << 1 != 0) {
18697: if ((xf | yf) << 3 < 0) {
18698: this.flg = N;
18699: return this;
18700: }
18701: if ((xf & yf) << 2 < 0 && xf == yf) {
18702: epbFpsr |= EPB_FPSR_OE;
18703: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
18704: epbExceptionOperandMantissa = 0x0000000000000000L;
18705: this.flg = N;
18706: return this;
18707: }
18708: if ((xf & yf) << 1 < 0 && xf == yf) {
18709: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
18710: return this;
18711: }
18712: if (xf << 1 < 0 || yf << 2 < 0) {
18713: xf = yf ^ M;
18714: xe = y.epp;
18715: xd = y.dvl;
18716: xc = y.cvl;
18717: }
18718:
18719: } else {
18720:
18721: yf ^= M;
18722: long yd = y.dvl;
18723: long yc = y.cvl;
18724: int o = xe - y.epp;
18725: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
18726:
18727: xf = yf;
18728: xe += o = -o;
18729: xd = yd;
18730: xc = yc;
18731: yf = this.flg;
18732: yd = this.dvl;
18733: yc = this.cvl;
18734: }
18735:
18736:
18737: if (0 < o) {
18738: if (o <= 63) {
18739: xb = yc << -o;
18740: yc = yd << -o | yc >>> o;
18741: yd >>>= o;
18742: } else if (o == 64) {
18743: xb = yc;
18744: yc = yd;
18745: yd = 0L;
18746: } else if (o <= 127) {
18747: xb = yd << -o | yc;
18748: yc = yd >>> o;
18749: yd = 0L;
18750: } else {
18751: xb = yd | yc;
18752: yc = 0L;
18753: yd = 0L;
18754: }
18755: }
18756:
18757: if (xf == yf) {
18758:
18759: xb |= yc << 62;
18760:
18761: xc = xd << 63 | xc >>> 1;
18762: xd >>>= 1;
18763: yc = yd << 63 | yc >>> 1;
18764: yd >>>= 1;
18765:
18766: yc >>>= 1;
18767: xc >>>= 1;
18768:
18769: xc += yc;
18770: xd += yd + (xc >>> 63);
18771:
18772: xc <<= 1;
18773:
18774: if (xd < 0L) {
18775: xe++;
18776: } else {
18777: xd = xd << 1 | xc >>> 63;
18778: xc <<= 1;
18779: }
18780: } else {
18781:
18782: xb |= yc << 63;
18783:
18784: yc >>>= 1;
18785: xc >>>= 1;
18786:
18787:
18788: if (xb != 0L) {
18789: xc--;
18790: }
18791: xc -= yc;
18792: xd -= yd + (xc >>> 63);
18793:
18794: xc <<= 1;
18795:
18796: if (0L <= xd) {
18797: if (xd != 0L) {
18798: xe -= o = Long.numberOfLeadingZeros (xd);
18799: xd = xd << o | xc >>> -o;
18800: xc <<= o;
18801: } else if (xc != 0L) {
18802: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
18803: xd = xc << o;
18804: xc = 0L;
18805: } else {
18806: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
18807: }
18808: }
18809: }
18810: }
18811: return this.finish (xf, xe, xd, xc, xb);
18812: }
18813: public final EFP sub (EFP x, EFP y) {
18814: int xf = x.flg;
18815: int xe = x.epp;
18816: long xd = x.dvl;
18817: long xc = x.cvl;
18818: long xb = 0L;
18819: int yf = y.flg;
18820: if ((xf | yf) << 1 != 0) {
18821: if ((xf | yf) << 3 < 0) {
18822: this.flg = N;
18823: return this;
18824: }
18825: if ((xf & yf) << 2 < 0 && xf == yf) {
18826: epbFpsr |= EPB_FPSR_OE;
18827: epbExceptionOperandExponent = yf & M | 0x7fff << 16;
18828: epbExceptionOperandMantissa = 0x0000000000000000L;
18829: this.flg = N;
18830: return this;
18831: }
18832: if ((xf & yf) << 1 < 0 && xf == yf) {
18833: this.flg = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
18834: return this;
18835: }
18836: if (xf << 1 < 0 || yf << 2 < 0) {
18837: xf = yf ^ M;
18838: xe = y.epp;
18839: xd = y.dvl;
18840: xc = y.cvl;
18841: }
18842:
18843: } else {
18844:
18845: yf ^= M;
18846: long yd = y.dvl;
18847: long yc = y.cvl;
18848: int o = xe - y.epp;
18849: if (o < 0 || o == 0 && (xd < yd || xd == yd && xc >>> 1 < yc >>> 1)) {
18850:
18851: xf = yf;
18852: xe += o = -o;
18853: xd = yd;
18854: xc = yc;
18855: yf = x.flg;
18856: yd = x.dvl;
18857: yc = x.cvl;
18858: }
18859:
18860:
18861: if (0 < o) {
18862: if (o <= 63) {
18863: xb = yc << -o;
18864: yc = yd << -o | yc >>> o;
18865: yd >>>= o;
18866: } else if (o == 64) {
18867: xb = yc;
18868: yc = yd;
18869: yd = 0L;
18870: } else if (o <= 127) {
18871: xb = yd << -o | yc;
18872: yc = yd >>> o;
18873: yd = 0L;
18874: } else {
18875: xb = yd | yc;
18876: yc = 0L;
18877: yd = 0L;
18878: }
18879: }
18880:
18881: if (xf == yf) {
18882:
18883: xb |= yc << 62;
18884:
18885: xc = xd << 63 | xc >>> 1;
18886: xd >>>= 1;
18887: yc = yd << 63 | yc >>> 1;
18888: yd >>>= 1;
18889:
18890: yc >>>= 1;
18891: xc >>>= 1;
18892:
18893: xc += yc;
18894: xd += yd + (xc >>> 63);
18895:
18896: xc <<= 1;
18897:
18898: if (xd < 0L) {
18899: xe++;
18900: } else {
18901: xd = xd << 1 | xc >>> 63;
18902: xc <<= 1;
18903: }
18904: } else {
18905:
18906: xb |= yc << 63;
18907:
18908: yc >>>= 1;
18909: xc >>>= 1;
18910:
18911:
18912: if (xb != 0L) {
18913: xc--;
18914: }
18915: xc -= yc;
18916: xd -= yd + (xc >>> 63);
18917:
18918: xc <<= 1;
18919:
18920: if (0L <= xd) {
18921: if (xd != 0L) {
18922: xe -= o = Long.numberOfLeadingZeros (xd);
18923: xd = xd << o | xc >>> -o;
18924: xc <<= o;
18925: } else if (xc != 0L) {
18926: xe -= o = 64 + Long.numberOfLeadingZeros (xc);
18927: xd = xc << o;
18928: xc = 0L;
18929: } else {
18930: xf = epbRoundingMode == EPB_MODE_RM ? M | Z : P | Z;
18931: }
18932: }
18933: }
18934: }
18935: return this.finish (xf, xe, xd, xc, xb);
18936: }
18937:
18938:
18939:
18940:
18941:
18942:
18943:
18944:
18945:
18946:
18947:
18948:
18949:
18950:
18951:
18952:
18953:
18954:
18955:
18956:
18957:
18958:
18959:
18960:
18961:
18962:
18963:
18964:
18965:
18966:
18967:
18968:
18969:
18970:
18971:
18972:
18973:
18974:
18975:
18976:
18977:
18978:
18979:
18980:
18981:
18982:
18983:
18984:
18985:
18986:
18987:
18988:
18989:
18990:
18991:
18992:
18993:
18994:
18995:
18996:
18997:
18998:
18999:
19000:
19001:
19002:
19003:
19004:
19005:
19006:
19007:
19008:
19009:
19010:
19011:
19012:
19013:
19014:
19015:
19016:
19017:
19018:
19019:
19020:
19021:
19022:
19023:
19024:
19025:
19026:
19027:
19028:
19029:
19030:
19031:
19032:
19033:
19034:
19035:
19036:
19037:
19038:
19039:
19040:
19041:
19042:
19043:
19044:
19045:
19046:
19047:
19048:
19049:
19050:
19051:
19052:
19053:
19054:
19055:
19056:
19057:
19058:
19059:
19060:
19061:
19062:
19063:
19064:
19065:
19066:
19067:
19068:
19069:
19070:
19071:
19072:
19073:
19074:
19075:
19076: public final EFP tan () {
19077: return this.tan (this);
19078: }
19079: public final EFP tan (EFP x) {
19080: int xf = x.flg;
19081: if (xf << 1 != 0) {
19082: if (xf << 1 < 0) {
19083: this.flg = xf;
19084: } else if (xf << 2 < 0) {
19085: epbFpsr |= EPB_FPSR_OE;
19086: epbExceptionOperandExponent = xf & M | 0x7fff << 16;
19087: epbExceptionOperandMantissa = 0x0000000000000000L;
19088: this.flg = N;
19089: } else {
19090: this.flg = N;
19091: }
19092: return this;
19093: }
19094:
19095: if (false) {
19096: EFP c = new EFP ().inner ().cos (x);
19097: return this.sin (x).outer ().div (c);
19098: } else if (false) {
19099: this.inner ();
19100: EFP s = new EFP ();
19101: EFP t = new EFP ();
19102: EFP u = new EFP ().iabs (x);
19103: EFP u2 = new EFP ();
19104: int k = 0;
19105:
19106: if (u.epp >= -1 || (u.epp == -2 && u.dvl >= 0xc90fdaa22168c234L)) {
19107:
19108: s.iadd (u, PI_8).imul (FOUR_PI).trunc ();
19109:
19110: u.sub (t.imulw (u2, s, PI_4)).sub (u2).sub (t.imul (s, PI_4A));
19111: k = s.geti () & 3;
19112: }
19113: u2.isqu (u);
19114: this.imul (TAN_C33, u2)
19115: .iadd (TAN_C31).imul (u2)
19116: .iadd (TAN_C29).imul (u2)
19117: .iadd (TAN_C27).imul (u2)
19118: .iadd (TAN_C25).imul (u2)
19119: .iadd (TAN_C23).imul (u2)
19120: .iadd (TAN_C21).imul (u2)
19121: .iadd (TAN_C19).imul (u2)
19122: .iadd (TAN_C17).imul (u2)
19123: .iadd (TAN_C15).imul (u2)
19124: .iadd (TAN_C13).imul (u2)
19125: .iadd (TAN_C11).imul (u2)
19126: .iadd (TAN_C9).imul (u2)
19127: .iadd (TAN_C7).imul (u2)
19128: .iadd (TAN_C5).imul (u2)
19129: .iadd (TAN_C3).imul (u2)
19130: .iadd (TAN_C1).imul (u);
19131: if (k == 1) {
19132: t.negdec (this);
19133: this.inc ().div (t);
19134: } else if (k == 2) {
19135: this.rcp ().ineg ();
19136: } else if (k == 3) {
19137: t.inc (this);
19138: this.dec ().div (t);
19139: }
19140: return this.outer ().neg (xf < 0);
19141: } else {
19142: if (x.epp >= 16) {
19143: EFP c = new EFP ().inner ().cos (x);
19144: return this.sin (x).outer ().div (c);
19145: }
19146: int savedFpsr = epbFpsr;
19147: this.inner ();
19148: if (this == x) {
19149: x = new EFP (x);
19150: }
19151: if (x.epp < -3) {
19152: EFP x2 = new EFP ().isqu (x);
19153: this.imul (TAN8_C21, x2)
19154: .iadd (TAN8_C19).imul (x2)
19155: .iadd (TAN8_C17).imul (x2)
19156: .iadd (TAN8_C15).imul (x2)
19157: .iadd (TAN8_C13).imul (x2)
19158: .iadd (TAN8_C11).imul (x2)
19159: .iadd (TAN8_C9).imul (x2)
19160: .iadd (TAN8_C7).imul (x2)
19161: .iadd (TAN8_C5).imul (x2)
19162: .iadd (TAN8_C3).imul (x2)
19163: .iadd (TAN8_C1).outer ().mul (x);
19164: return this.originLowerUpper (x).correctUnderflow (savedFpsr);
19165: }
19166: EFP s = new EFP ();
19167: EFP t = new EFP ();
19168: EFP u = new EFP ().iabs (x);
19169: EFP u2 = new EFP ();
19170: s.iadd (u, TAN7_X).imul (TAN7_Y).trunc ();
19171:
19172: u.sub (t.imulw (u2, s, TAN7_Z)).sub (u2).sub (t.imul (s, TAN7_ZA));
19173: int k = s.geti () & 127;
19174: u2.isqu (u);
19175: this.imul (TAN7_C11, u2)
19176: .iadd (TAN7_C9).imul (u2)
19177: .iadd (TAN7_C7).imul (u2)
19178: .iadd (TAN7_C5).imul (u2)
19179: .iadd (TAN7_C3).imul (u2)
19180: .iadd (TAN7_C1).imul (u);
19181: if (k != 0) {
19182: if (k <= 63) {
19183: t = TAN7_T[k];
19184: s.imul (this, t).negdec ();
19185: this.iadd (t).div (s);
19186: } else if (k == 64) {
19187: this.rcp ().ineg ();
19188: } else {
19189: t = TAN7_T[128 - k];
19190: s.imul (this, t).inc ();
19191: this.sub (t).div (s);
19192: }
19193: }
19194: return this.outer ().neg (xf < 0);
19195: }
19196: }
19197:
19198:
19199:
19200:
19201:
19202:
19203:
19204:
19205:
19206:
19207:
19208:
19209:
19210:
19211:
19212:
19213:
19214:
19215:
19216:
19217:
19218:
19219:
19220:
19221:
19222:
19223:
19224:
19225:
19226:
19227:
19228:
19229:
19230:
19231:
19232:
19233:
19234:
19235:
19236:
19237:
19238:
19239:
19240:
19241:
19242:
19243:
19244:
19245:
19246:
19247:
19248:
19249:
19250:
19251:
19252:
19253:
19254:
19255:
19256:
19257:
19258:
19259:
19260:
19261:
19262:
19263:
19264:
19265:
19266:
19267:
19268:
19269:
19270:
19271:
19272:
19273:
19274:
19275:
19276:
19277:
19278:
19279:
19280:
19281:
19282:
19283:
19284:
19285:
19286:
19287:
19288:
19289:
19290:
19291:
19292:
19293:
19294:
19295:
19296:
19297:
19298:
19299:
19300:
19301:
19302:
19303:
19304:
19305:
19306:
19307:
19308:
19309:
19310:
19311:
19312:
19313:
19314:
19315:
19316:
19317:
19318:
19319:
19320:
19321:
19322:
19323:
19324:
19325:
19326:
19327:
19328:
19329:
19330:
19331:
19332:
19333:
19334:
19335:
19336:
19337:
19338:
19339:
19340:
19341: public final EFP tanh () {
19342: return this.tanh (this);
19343: }
19344: public final EFP tanh (EFP x) {
19345: int xf = x.flg;
19346: if (xf << 1 != 0) {
19347: if (xf << 2 < 0) {
19348: this.flg = xf & M;
19349: this.epp = 0;
19350: this.dvl = MSB;
19351: this.cvl = 0L;
19352: } else {
19353: this.flg = xf;
19354: }
19355: return this;
19356: }
19357:
19358:
19359: int xe = x.epp;
19360: if (xe < -2) {
19361: int savedFpsr = epbFpsr;
19362: this.inner ();
19363: if (this == x) {
19364: x = new EFP (x);
19365: }
19366: EFP x2 = new EFP ().isqu (x);
19367: this.imul (TANH_C27, x2)
19368: .iadd (TANH_C25).imul (x2)
19369: .iadd (TANH_C23).imul (x2)
19370: .iadd (TANH_C21).imul (x2)
19371: .iadd (TANH_C19).imul (x2)
19372: .iadd (TANH_C17).imul (x2)
19373: .iadd (TANH_C15).imul (x2)
19374: .iadd (TANH_C13).imul (x2)
19375: .iadd (TANH_C11).imul (x2)
19376: .iadd (TANH_C9).imul (x2)
19377: .iadd (TANH_C7).imul (x2)
19378: .iadd (TANH_C5).imul (x2)
19379: .iadd (TANH_C3).imul (x2)
19380: .iadd (TANH_C1).outer ().mul (x);
19381: return this.originUpperLower (x).correctUnderflow (savedFpsr);
19382: }
19383:
19384: if (false) {
19385: EFP c = new EFP ().inner ().cosh (x);
19386: return this.sinh (x).outer ().div (c);
19387: } else if (6 <= xe) {
19388:
19389:
19390:
19391:
19392:
19393:
19394:
19395:
19396: epbFpsr |= EPB_FPSR_X2;
19397: this.flg = xf & M;
19398: this.epp = 0;
19399: this.dvl = MSB;
19400: this.cvl = 0L;
19401: if (xf < 0) {
19402: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RP) {
19403: this.nextup (epbRoundingPrec);
19404: }
19405: } else {
19406: if (epbRoundingMode == EPB_MODE_RZ || epbRoundingMode == EPB_MODE_RM) {
19407: this.nextdown (epbRoundingPrec);
19408: }
19409: }
19410: return this;
19411: } else {
19412: EFP t = new EFP ().inner ().imul2 (x).exp ();
19413: this.dec (t);
19414: t.inc ();
19415: return this.outer ().div (t);
19416: }
19417: }
19418:
19419:
19420:
19421:
19422:
19423:
19424:
19425:
19426:
19427:
19428:
19429:
19430:
19431:
19432:
19433:
19434:
19435:
19436:
19437:
19438:
19439:
19440:
19441:
19442:
19443:
19444:
19445:
19446:
19447:
19448:
19449:
19450:
19451:
19452:
19453:
19454:
19455:
19456:
19457:
19458:
19459:
19460:
19461:
19462:
19463:
19464:
19465:
19466:
19467:
19468:
19469:
19470:
19471:
19472:
19473:
19474:
19475:
19476:
19477:
19478:
19479:
19480:
19481:
19482:
19483:
19484:
19485:
19486:
19487:
19488:
19489:
19490: public final EFP tgamma () {
19491: return this.tgamma (this);
19492: }
19493: public final EFP tgamma (EFP x) {
19494: int xf = x.flg;
19495: if (xf << 1 != 0) {
19496: this.flg = (xf == (P | Z) || xf == (P | I) ? P | I :
19497: xf == (M | Z) ? M | I :
19498: N);
19499: return this;
19500: }
19501:
19502: this.inner ();
19503: if (xf < 0) {
19504: EFP t = new EFP ().mul (PI, x).sin ();
19505: this.negdec (x).lgamma ().exp ().mul (t).rcpdiv (PI);
19506: } else {
19507: this.lgamma (x).exp ();
19508: }
19509: return this.outer ().finish ();
19510: }
19511:
19512:
19513:
19514:
19515:
19516:
19517:
19518:
19519:
19520:
19521:
19522:
19523:
19524:
19525:
19526: @Override public String toString () {
19527: int xf = this.flg;
19528: if (xf << 1 != 0) {
19529: return (xf == (P | Z) ? "0" :
19530: xf == (M | Z) ? "-0" :
19531: xf == (P | I) ? "Infinity" :
19532: xf == (M | I) ? "-Infinity" :
19533: xf << 3 < 0 ? "NaN" : "???");
19534: }
19535:
19536: this.inner ();
19537: EFP x = new EFP ().iabs (this);
19538:
19539:
19540: int e = (int) Math.floor ((double) x.epp * 0.30102999566398119521373889472);
19541:
19542:
19543:
19544: if (0 < e) {
19545: x.imul (EFP_TEN_M16QR[e & 15]);
19546: if (16 <= e) {
19547: x.imul (EFP_TEN_M16QR[16 + (e >> 4 & 15)]);
19548: if (256 <= e) {
19549: x.imul (EFP_TEN_M16QR[32 + (e >> 8 & 15)]);
19550: if (4096 <= e) {
19551: x.imul (EFP_TEN_M16QR[48 + (e >> 12)]);
19552: }
19553: }
19554: }
19555: } else if (e < 0) {
19556: x.imul (EFP_TEN_P16QR[-e & 15]);
19557: if (e <= -16) {
19558: x.imul (EFP_TEN_P16QR[16 + (-e >> 4 & 15)]);
19559: if (e <= -256) {
19560: x.imul (EFP_TEN_P16QR[32 + (-e >> 8 & 15)]);
19561: if (e <= -4096) {
19562: x.imul (EFP_TEN_P16QR[48 + (-e >> 12)]);
19563: }
19564: }
19565: }
19566: }
19567: this.outer ();
19568:
19569:
19570:
19571:
19572: int[] w = new int[2 + (EFP_DECIMAL_PREC + 4 & -4)];
19573: {
19574: int t = 31 - x.epp;
19575: long x1 = x.dvl >>> t;
19576: long x2 = x.dvl << -t | x.cvl >>> t;
19577: long x3 = x2 & 0xffffffffL;
19578: x2 >>>= 32;
19579: t = XEiJ.FMT_BCD4[(int) (x1 >>> 32)];
19580: w[0] = t >> 4;
19581: w[1] = t & 15;
19582: for (int i = 2; i < 2 + (EFP_DECIMAL_PREC + 4 & -4); i += 4) {
19583: x3 *= 10000L;
19584: x2 = x2 * 10000L + (x3 >>> 32);
19585: x3 &= 0xffffffffL;
19586: x1 = (x1 & 0xffffffffL) * 10000L + (x2 >>> 32);
19587: x2 &= 0xffffffffL;
19588: t = XEiJ.FMT_BCD4[(int) (x1 >>> 32)];
19589: w[i ] = t >> 12;
19590: w[i + 1] = t >> 8 & 15;
19591: w[i + 2] = t >> 4 & 15;
19592: w[i + 3] = t & 15;
19593: }
19594: }
19595:
19596:
19597: int h = w[0] != 0 ? 0 : w[1] != 0 ? 1 : 2;
19598:
19599: int o = h + EFP_DECIMAL_PREC;
19600: if (5 <= w[o]) {
19601: int i = o;
19602: while (10 <= ++w[--i]) {
19603: w[i] = 0;
19604: }
19605: if (i < h) {
19606: h--;
19607: o--;
19608: }
19609: }
19610:
19611:
19612: e -= h - 1;
19613:
19614:
19615: while (w[o - 1] == 0) {
19616: o--;
19617: }
19618:
19619: StringBuilder sb = new StringBuilder ();
19620:
19621: if (xf < 0) {
19622: sb.append ('-');
19623: }
19624:
19625: if (0 <= e && e < EFP_DECIMAL_PREC) {
19626: do {
19627: sb.append ((char) ('0' + w[h++]));
19628: } while (0 <= --e);
19629: if (h < o) {
19630: sb.append ('.');
19631: do {
19632: sb.append ((char) ('0' + w[h++]));
19633: } while (h < o);
19634: }
19635: } else if (-4 <= e && e < 0) {
19636: sb.append ('0');
19637: sb.append ('.');
19638: while (++e < 0) {
19639: sb.append ('0');
19640: }
19641: do {
19642: sb.append ((char) ('0' + w[h++]));
19643: } while (h < o);
19644: } else {
19645: sb.append ((char) ('0' + w[h++]));
19646: if (h < o) {
19647: sb.append ('.');
19648: do {
19649: sb.append ((char) ('0' + w[h++]));
19650: } while (h < o);
19651: }
19652: sb.append ('e');
19653: if (false) {
19654: sb.append (e);
19655: } else {
19656: if (e < 0) {
19657: sb.append ('-');
19658: e = -e;
19659: } else {
19660: sb.append ('+');
19661: }
19662: e = XEiJ.fmtBcd8 (e);
19663: int t = Integer.numberOfLeadingZeros (e);
19664: if (t <= 27) {
19665: if (t <= 23) {
19666: if (t <= 19) {
19667: if (t <= 15) {
19668: sb.append ((char) ('0' + (e >>> 16 & 15)));
19669: }
19670: sb.append ((char) ('0' + (e >>> 12 & 15)));
19671: }
19672: sb.append ((char) ('0' + (e >>> 8 & 15)));
19673: }
19674: sb.append ((char) ('0' + (e >>> 4 & 15)));
19675: }
19676: sb.append ((char) ('0' + (e & 15)));
19677: }
19678: }
19679: return sb.toString ();
19680: }
19681:
19682:
19683:
19684:
19685:
19686:
19687:
19688:
19689:
19690:
19691:
19692:
19693:
19694:
19695:
19696:
19697:
19698:
19699:
19700:
19701:
19702:
19703:
19704:
19705:
19706:
19707:
19708:
19709:
19710:
19711:
19712:
19713:
19714:
19715:
19716:
19717:
19718:
19719:
19720:
19721:
19722:
19723:
19724:
19725:
19726:
19727:
19728:
19729:
19730:
19731:
19732:
19733:
19734:
19735:
19736:
19737:
19738:
19739: public final EFP trunc () {
19740: return trunc (this);
19741: }
19742: public final EFP trunc (EFP x) {
19743: int xf = x.flg;
19744: if (xf << 1 != 0) {
19745: this.flg = xf;
19746: return this;
19747: }
19748:
19749: int xe = x.epp;
19750: if (xe < 0) {
19751: epbFpsr |= EPB_FPSR_X2;
19752: this.flg = xf | Z;
19753: return this;
19754: }
19755: long xd = x.dvl;
19756: long xc = x.cvl;
19757: if (xe <= 63) {
19758: long m = MSB >> xe;
19759: if ((xd & ~m | xc) != 0L) {
19760: epbFpsr |= EPB_FPSR_X2;
19761: xd &= m;
19762: xc = 0L;
19763: }
19764: } else if (xe <= LEN - 2) {
19765: long m = MSB >> xe;
19766: if ((xc & ~m) != 0L) {
19767: epbFpsr |= EPB_FPSR_X2;
19768: xc &= m;
19769: }
19770: }
19771:
19772: return this.finish (xf, xe, xd, xc, 0L);
19773: }
19774:
19775:
19776:
19777:
19778:
19779:
19780:
19781:
19782:
19783:
19784:
19785:
19786: public final EFP ulp () {
19787: return this.ulp (this);
19788: };
19789: public final EFP ulp (EFP x) {
19790: int xf = x.flg;
19791: if (xf << 1 != 0) {
19792: if (xf << 1 < 0) {
19793: this.flg = P;
19794: this.epp = -32768;
19795: this.dvl = MSB;
19796: this.cvl = 0L;
19797: } else {
19798: this.flg = xf & ~M;
19799: }
19800: return this;
19801: }
19802:
19803: this.flg = P;
19804: this.epp = x.epp - (LEN - 1);
19805: this.dvl = MSB;
19806: this.cvl = 0L;
19807: return this;
19808: };
19809:
19810: }
19811:
19812:
19813:
19814:
19815:
19816:
19817:
19818:
19819:
19820:
19821:
19822:
19823:
19824:
19825:
19826:
19827:
19828:
19829:
19830:
19831:
19832:
19833:
19834:
19835:
19836:
19837:
19838:
19839:
19840:
19841:
19842:
19843:
19844:
19845:
19846:
19847:
19848:
19849:
19850:
19851:
19852:
19853:
19854:
19855:
19856:
19857:
19858:
19859:
19860:
19861:
19862:
19863:
19864:
19865:
19866:
19867:
19868:
19869:
19870:
19871:
19872:
19873:
19874:
19875:
19876:
19877:
19878:
19879:
19880:
19881:
19882:
19883:
19884:
19885:
19886:
19887:
19888:
19889:
19890:
19891:
19892:
19893:
19894:
19895:
19896:
19897:
19898: public static final boolean CIR_DEBUG_TRACE = false;
19899:
19900:
19901:
19902:
19903:
19904:
19905:
19906:
19907:
19908:
19909:
19910:
19911:
19912:
19913:
19914: public int cirResponse;
19915: public int cirFormatWord;
19916: public int cirOperationWord;
19917: public int cirCommand;
19918: public int cirRegisterList;
19919: public int cirOperandAddress;
19920:
19921:
19922: public final int[] cirOperandBuffer = new int[212];
19923: public int cirOperandLength;
19924: public int cirOperandIndex;
19925:
19926:
19927:
19928:
19929:
19930:
19931: public static final int CIR_INPUT_MASK = 16;
19932: public static final int CIR_OUTPUT_MASK = 32;
19933: public static final int CIR_IDLE = 0;
19934: public static final int CIR_PROGRAM_COUNTER = 1;
19935: public static final int CIR_DYNAMIC_K_FACTOR = CIR_INPUT_MASK | 2;
19936: public static final int CIR_DYNAMIC_REGISTER_LIST = CIR_INPUT_MASK | 3;
19937: public static final int CIR_REGISTER_SELECT = 4;
19938: public static final int CIR_SOURCE_OPERAND = CIR_INPUT_MASK | 5;
19939: public static final int CIR_DESTINATION_OPERAND = CIR_OUTPUT_MASK | 6;
19940: public static final int CIR_FSAVE_STATE_FRAME = CIR_OUTPUT_MASK | 7;
19941: public static final int CIR_FRESTORE_STATE_FRAME = CIR_INPUT_MASK | 8;
19942: public static final int CIR_EXCEPTION_PROCESSING = 9;
19943: public static final String[] cirNameOfStage = {
19944: "idle",
19945: "input program counter into the instruction address CIR",
19946: "input dynamic k-factor into the operand CIR",
19947: "input dynamic register list into the operand CIR",
19948: "output register select from the register select CIR",
19949: "input source operand into the operand CIR",
19950: "output destination operand from the operand CIR",
19951: "output FSAVE state frame from the operand CIR",
19952: "input FRESTORE state from into the operand CIR",
19953: "exception processing",
19954: };
19955: public int cirStage;
19956:
19957:
19958:
19959: public final void cirInit () {
19960:
19961: Arrays.fill (cirOperandBuffer, 0);
19962: cirReset ();
19963: }
19964:
19965:
19966:
19967: public final void cirReset () {
19968: cirIdle (0x0802);
19969: }
19970:
19971:
19972:
19973: public final void cirIdle (int response) {
19974: if (CIR_DEBUG_TRACE) {
19975: System.out.printf ("%08x cirIdle(0x%08x)\n", XEiJ.regPC0, response);
19976: }
19977: cirResponse = response;
19978: cirOperationWord = 0;
19979: cirCommand = 0;
19980: cirRegisterList = 0;
19981: cirOperandAddress = 0;
19982: Arrays.fill (cirOperandBuffer, 0);
19983: cirOperandLength = 0;
19984: cirOperandIndex = 0;
19985: cirStage = CIR_IDLE;
19986: }
19987:
19988:
19989:
19990:
19991:
19992:
19993:
19994:
19995:
19996:
19997:
19998:
19999:
20000:
20001:
20002:
20003:
20004:
20005:
20006:
20007:
20008:
20009:
20010:
20011:
20012:
20013:
20014:
20015:
20016:
20017:
20018:
20019:
20020:
20021:
20022:
20023:
20024:
20025:
20026:
20027:
20028:
20029:
20030:
20031:
20032:
20033:
20034:
20035:
20036:
20037:
20038:
20039:
20040:
20041:
20042:
20043:
20044:
20045:
20046:
20047:
20048:
20049:
20050:
20051:
20052:
20053:
20054:
20055:
20056:
20057:
20058:
20059:
20060:
20061:
20062:
20063:
20064:
20065:
20066:
20067:
20068:
20069:
20070:
20071:
20072:
20073:
20074:
20075:
20076:
20077:
20078:
20079:
20080:
20081:
20082:
20083:
20084:
20085:
20086:
20087:
20088:
20089:
20090:
20091:
20092:
20093:
20094:
20095:
20096:
20097:
20098:
20099:
20100:
20101:
20102:
20103:
20104:
20105:
20106:
20107:
20108:
20109:
20110:
20111:
20112:
20113:
20114:
20115:
20116:
20117:
20118:
20119:
20120:
20121:
20122:
20123:
20124:
20125:
20126:
20127:
20128:
20129:
20130:
20131:
20132:
20133:
20134:
20135:
20136:
20137:
20138:
20139:
20140:
20141:
20142:
20143:
20144:
20145:
20146:
20147:
20148:
20149:
20150:
20151:
20152:
20153:
20154:
20155:
20156:
20157:
20158:
20159:
20160:
20161:
20162:
20163:
20164:
20165:
20166:
20167:
20168:
20169:
20170:
20171:
20172:
20173:
20174:
20175:
20176:
20177:
20178:
20179:
20180: public void cirException (int response) {
20181: if (CIR_DEBUG_TRACE) {
20182: System.out.printf ("%08x cirException(0x%08x)\n", XEiJ.regPC0, response);
20183: }
20184: cirResponse = response;
20185: cirOperationWord = 0;
20186: cirCommand = 0;
20187: cirRegisterList = 0;
20188: cirOperandAddress = 0;
20189: Arrays.fill (cirOperandBuffer, 0);
20190: cirOperandLength = 0;
20191: cirOperandIndex = 0;
20192: cirStage = CIR_EXCEPTION_PROCESSING;
20193: }
20194:
20195:
20196:
20197: public int cirPeekByteZero (int a) {
20198: return (a & 1) == 0 ? cirPeekWordZero (a) >>> 8 : cirPeekWordZero (a - 1) & 255;
20199: }
20200:
20201:
20202:
20203: public int cirPeekWordZero (int a) {
20204: a &= 0x1e;
20205: int d = 65535;
20206: switch (a) {
20207: case 0x00:
20208: d = (char) cirResponse;
20209: break;
20210:
20211: case 0x04:
20212: if ((cirStage == CIR_EXCEPTION_PROCESSING && cirResponse == 0x1d0d) ||
20213: cirStage == CIR_FSAVE_STATE_FRAME ||
20214: cirStage == CIR_FRESTORE_STATE_FRAME) {
20215: d = 0x0200;
20216:
20217: } else {
20218: if ((cirStage & (CIR_INPUT_MASK | CIR_OUTPUT_MASK)) == 0) {
20219: d = 0x1f38;
20220: } else {
20221: d = 0x1fd4;
20222: }
20223: }
20224: break;
20225: case 0x06:
20226: d = (char) cirFormatWord;
20227: break;
20228: case 0x08:
20229: d = (char) cirOperationWord;
20230: break;
20231:
20232:
20233:
20234:
20235: case 0x10 + 0:
20236:
20237: d = cirPeekLong (a) >>> 16;
20238: break;
20239: case 0x10 + 2:
20240: d = (char) cirPeekLong (a + 2);
20241: break;
20242: case 0x14:
20243: if (cirStage == CIR_REGISTER_SELECT) {
20244:
20245:
20246:
20247:
20248: d = cirRegisterList << 8;
20249: } else {
20250:
20251: }
20252: break;
20253:
20254:
20255:
20256:
20257: case 0x1c + 0:
20258: d = cirPeekLong (a) >>> 16;
20259: break;
20260: case 0x1c + 2:
20261: d = (char) cirPeekLong (a - 2);
20262: break;
20263: }
20264: return d;
20265: }
20266:
20267:
20268:
20269: public int cirPeekLong (int a) {
20270: a &= 0x1e;
20271: int d = -1;
20272: switch (a) {
20273:
20274:
20275:
20276:
20277:
20278:
20279:
20280:
20281:
20282: case 0x10:
20283: if (cirStage == CIR_DESTINATION_OPERAND && cirOperandIndex < cirOperandLength) {
20284: d = cirOperandBuffer[cirOperandIndex];
20285: } else if (cirStage == CIR_FSAVE_STATE_FRAME && cirOperandIndex < cirOperandLength) {
20286: d = cirOperandBuffer[cirOperandLength - cirOperandIndex - 1];
20287: } else {
20288:
20289:
20290: }
20291: break;
20292:
20293:
20294:
20295:
20296: case 0x1c:
20297: d = cirOperandAddress;
20298: break;
20299: }
20300: return d;
20301: }
20302:
20303:
20304:
20305: public int cirReadByteZero (int a) {
20306:
20307: return (a & 1) == 0 ? cirReadWordZero (a) >>> 8 : cirReadWordZero (a - 1) & 255;
20308: }
20309:
20310:
20311:
20312: public int cirReadWordZero (int a) {
20313: a &= 0x1e;
20314: int d = 65535;
20315: switch (a) {
20316: case 0x00:
20317: d = (char) cirResponse;
20318: if (d != cirResponse) {
20319: cirResponse >>>= 16;
20320: if (d == 0x0802) {
20321: cirIdle (0x0802);
20322: }
20323: }
20324: break;
20325:
20326: case 0x04:
20327: if ((cirStage == CIR_EXCEPTION_PROCESSING && cirResponse == 0x1d0d) ||
20328: cirStage == CIR_FSAVE_STATE_FRAME ||
20329: cirStage == CIR_FRESTORE_STATE_FRAME) {
20330: d = 0x0200;
20331: cirException (0x1d0d);
20332: } else {
20333: int i;
20334: if ((cirStage & (CIR_INPUT_MASK | CIR_OUTPUT_MASK)) == 0) {
20335: d = 0x1f38;
20336: i = 0;
20337: } else {
20338: d = 0x1fd4;
20339: i = 3 * 8;
20340: }
20341:
20342: cirOperandBuffer[i++] = epbFpcr;
20343: cirOperandBuffer[i++] = epbFpsr;
20344: cirOperandBuffer[i++] = epbFpiar;
20345: cirOperandBuffer[i++] = epbQuotient;
20346: cirOperandBuffer[i++] = epbRoundingPrec;
20347: cirOperandBuffer[i++] = epbRoundingMode;
20348: cirOperandBuffer[i++] = cirResponse;
20349: cirOperandBuffer[i++] = cirFormatWord;
20350: cirOperandBuffer[i++] = cirOperationWord;
20351: cirOperandBuffer[i++] = cirCommand;
20352: cirOperandBuffer[i++] = cirRegisterList;
20353: cirOperandBuffer[i++] = cirOperandAddress;
20354: cirOperandBuffer[i++] = cirOperandLength;
20355: cirOperandBuffer[i++] = cirOperandIndex;
20356: cirOperandBuffer[i++] = cirStage;
20357: cirFormatWord = d;
20358: cirOperandLength = (d & 255) >>> 2;
20359: cirOperandIndex = 0;
20360: cirStage = CIR_FSAVE_STATE_FRAME;
20361: cirResponse = 0x0900;
20362: }
20363: break;
20364: case 0x06:
20365: d = (char) cirFormatWord;
20366: break;
20367: case 0x08:
20368: d = (char) cirOperationWord;
20369: break;
20370:
20371:
20372:
20373:
20374: case 0x10 + 0:
20375:
20376: d = cirReadLong (a) >>> 16;
20377: break;
20378: case 0x10 + 2:
20379: d = (char) cirReadLong (a + 2);
20380: break;
20381: case 0x14:
20382: if (cirStage == CIR_REGISTER_SELECT) {
20383:
20384:
20385:
20386:
20387: d = cirRegisterList << 8;
20388: cirGen ();
20389: } else {
20390: cirException (0x1d0d);
20391: }
20392: break;
20393:
20394:
20395:
20396:
20397: case 0x1c + 0:
20398: d = cirReadLong (a) >>> 16;
20399: break;
20400: case 0x1c + 2:
20401: d = (char) cirReadLong (a - 2);
20402: break;
20403: }
20404: if (CIR_DEBUG_TRACE) {
20405: System.out.printf ("%08x cirReadWordZero(0x%08x,0x%04x)\n", XEiJ.regPC0, a, d);
20406: }
20407: return d;
20408: }
20409:
20410:
20411:
20412: public int cirReadLong (int a) {
20413: a &= 0x1e;
20414: int d = -1;
20415: switch (a) {
20416:
20417:
20418:
20419:
20420:
20421:
20422:
20423:
20424:
20425: case 0x10:
20426: if (cirStage == CIR_DESTINATION_OPERAND && cirOperandIndex < cirOperandLength) {
20427: d = cirOperandBuffer[cirOperandIndex];
20428: cirOperandIndex++;
20429: if (cirOperandIndex == cirOperandLength) {
20430: cirGen ();
20431: }
20432: } else if (cirStage == CIR_FSAVE_STATE_FRAME && cirOperandIndex < cirOperandLength) {
20433: d = cirOperandBuffer[cirOperandLength - cirOperandIndex - 1];
20434: cirOperandIndex++;
20435: if (cirOperandIndex == cirOperandLength) {
20436: cirIdle (0x0802);
20437: }
20438: } else {
20439:
20440: cirException (0x1d0d);
20441: }
20442: break;
20443:
20444:
20445:
20446:
20447:
20448: case 0x1c:
20449: d = cirOperandAddress;
20450: break;
20451: }
20452: if (CIR_DEBUG_TRACE) {
20453: System.out.printf ("%08x cirReadLong(0x%08x,0x%08x)\n", XEiJ.regPC0, a, d);
20454: }
20455: return d;
20456: }
20457:
20458:
20459:
20460: public void cirWriteByte (int a, int d) {
20461: }
20462:
20463:
20464:
20465: public void cirWriteWord (int a, int d) {
20466: if (CIR_DEBUG_TRACE) {
20467: System.out.printf ("%08x cirWriteWordZero(0x%08x,0x%04x)\n", XEiJ.regPC0, a, d);
20468: }
20469: d &= 65535;
20470: switch (a & 0x1e) {
20471:
20472: case 0x02:
20473:
20474:
20475:
20476: if (cirStage == CIR_EXCEPTION_PROCESSING) {
20477: cirIdle (0x0802);
20478: return;
20479: } else if ((d & 1) != 0) {
20480: cirIdle (0x0802);
20481: return;
20482: }
20483: break;
20484:
20485: case 0x06:
20486: if (d >>> 8 == 0) {
20487: cirFormatWord = d;
20488:
20489: for (int n = 0; n < 8; n++) {
20490: epbFPn[n].setnan ();
20491: }
20492:
20493: epbFpcr = 0;
20494: epbFpsr = 0;
20495: cirIdle (0x0802);
20496: } else if (d == 0x1f38 || d == 0x1fd4) {
20497: cirFormatWord = d;
20498: cirOperandLength = (d & 255) >>> 2;
20499: cirOperandIndex = 0;
20500: cirStage = CIR_FRESTORE_STATE_FRAME;
20501: cirResponse = 0x0900;
20502: } else {
20503: cirFormatWord = 0x0200;
20504: }
20505: return;
20506: case 0x08:
20507:
20508:
20509: cirOperationWord = d;
20510: return;
20511: case 0x0a:
20512: if (cirStage == CIR_IDLE) {
20513: cirCommand = d;
20514: cirGen ();
20515: return;
20516: }
20517: break;
20518: case 0x0c:
20519:
20520: return;
20521: case 0x0e:
20522:
20523: if (cirStage == CIR_IDLE) {
20524: d &= 0x3f;
20525: if ((d & 0x20) != 0 && (epbFpsr & XEiJ.FPU_FPSR_NAN) != 0) {
20526: epbFpsr |= XEiJ.FPU_FPSR_EXC_BSUN;
20527: epbFpsr |= XEiJ.FPU_FPSR_EXC_TO_AEXC[epbFpsr >> 8 & 255];
20528: if ((epbFpcr & XEiJ.FPU_FPCR_BSUN) != 0) {
20529: cirException (0x5c30);
20530: return;
20531: }
20532: }
20533: cirResponse = XEiJ.FPU_CCMAP_882[d << 4 | epbFpsr >> 24 & 15] ? 0x0802_0801 : 0x0802_0800;
20534: return;
20535: }
20536: break;
20537:
20538:
20539: case 0x16:
20540:
20541: return;
20542:
20543:
20544: }
20545: cirException (0x1d0d);
20546: }
20547:
20548:
20549:
20550: public void cirWriteLong (int a, int d) {
20551: if (CIR_DEBUG_TRACE) {
20552: System.out.printf ("%08x cirWriteLongZero(0x%08x,0x%08x)\n", XEiJ.regPC0, a, d);
20553: }
20554: switch (a & 0x1e) {
20555:
20556:
20557:
20558:
20559:
20560:
20561: case 0x0c:
20562:
20563: return;
20564:
20565: case 0x10:
20566: if ((cirStage & CIR_INPUT_MASK) != 0 && cirOperandIndex < cirOperandLength) {
20567: cirOperandBuffer[cirOperandIndex++] = d;
20568: if (cirOperandIndex == cirOperandLength) {
20569: if (cirStage == CIR_DYNAMIC_K_FACTOR ||
20570: cirStage == CIR_DYNAMIC_REGISTER_LIST ||
20571: cirStage == CIR_SOURCE_OPERAND) {
20572: cirGen ();
20573: } else if (cirStage == CIR_FRESTORE_STATE_FRAME) {
20574: int i = cirFormatWord == 0x1f38 ? 0 : 3 * 8;
20575:
20576: epbFpcr = cirOperandBuffer[i++] & EPB_FPCR_ALL;
20577: epbFpsr = cirOperandBuffer[i++] & EPB_FPSR_ALL;
20578: epbFpiar = cirOperandBuffer[i++];
20579: epbQuotient = cirOperandBuffer[i++];
20580: epbRoundingPrec = cirOperandBuffer[i++];
20581: epbRoundingMode = cirOperandBuffer[i++];
20582: cirResponse = cirOperandBuffer[i++];
20583: cirFormatWord = cirOperandBuffer[i++];
20584: cirOperationWord = cirOperandBuffer[i++];
20585: cirCommand = cirOperandBuffer[i++];
20586: cirRegisterList = cirOperandBuffer[i++];
20587: cirOperandAddress = cirOperandBuffer[i++];
20588: cirOperandLength = cirOperandBuffer[i++];
20589: cirOperandIndex = cirOperandBuffer[i++];
20590: cirStage = cirOperandBuffer[i++];
20591: }
20592: }
20593: return;
20594: }
20595: break;
20596:
20597: case 0x16:
20598:
20599: return;
20600: case 0x18:
20601: if (cirStage == CIR_PROGRAM_COUNTER) {
20602:
20603:
20604: epbFpiar = d;
20605: cirGen ();
20606: return;
20607: }
20608: break;
20609: case 0x1c:
20610: cirOperandAddress = d;
20611: break;
20612: }
20613: cirException (0x1d0d);
20614: }
20615:
20616:
20617:
20618:
20619:
20620:
20621: @SuppressWarnings ("fallthrough") public void cirGen () {
20622: if (CIR_DEBUG_TRACE) {
20623: System.out.printf ("%08x cirGen(command=0x%04x,stage=%d(%s))\n", XEiJ.regPC0, cirCommand, cirStage, cirNameOfStage[cirStage & 15]);
20624: }
20625:
20626:
20627:
20628:
20629: int mmm = cirCommand >> 10 & 7;
20630: int nnn = cirCommand >> 7 & 7;
20631: int ccccccc = cirCommand & 0x7f;
20632:
20633:
20634: switch (cirCommand >> 13) {
20635:
20636:
20637: case 0b010:
20638: if (cirStage == CIR_IDLE) {
20639: epbFpsr &= 0x00ff00ff;
20640: epbSetRoundingPrec (epbFpcr >> 6 & 3);
20641: epbSetRoundingMode (epbFpcr >> 4 & 3);
20642: }
20643:
20644: switch (mmm) {
20645:
20646: case 0b000:
20647:
20648:
20649:
20650:
20651:
20652:
20653:
20654:
20655:
20656:
20657: if (cirStage == CIR_IDLE) {
20658: if ((epbFpcr & 0x0000ff00) != 0) {
20659: cirResponse = 0x8900_d504;
20660: cirStage = CIR_PROGRAM_COUNTER;
20661: } else {
20662: cirResponse = 0x8900_9504;
20663: cirOperandLength = 1;
20664: cirOperandIndex = 0;
20665: cirStage = CIR_SOURCE_OPERAND;
20666: }
20667: return;
20668: }
20669: if (cirStage == CIR_PROGRAM_COUNTER) {
20670: cirOperandLength = 1;
20671: cirOperandIndex = 0;
20672: cirStage = CIR_SOURCE_OPERAND;
20673: return;
20674: }
20675: if (cirStage == CIR_SOURCE_OPERAND) {
20676: epbFPn[mmm = EPB_SRC_TMP].seti (cirOperandBuffer[0]);
20677: if (cirPreInstruction ()) {
20678: return;
20679: }
20680: }
20681: break;
20682:
20683: case 0b001:
20684:
20685:
20686:
20687:
20688:
20689:
20690:
20691:
20692:
20693:
20694: if (cirStage == CIR_IDLE) {
20695: if ((epbFpcr & 0x0000ff00) != 0) {
20696: if ((epbMode & EPB_MODE_MC68882) != 0) {
20697: cirResponse = 0x8900_5504;
20698: } else {
20699: cirResponse = 0x8900_d504;
20700: }
20701: cirStage = CIR_PROGRAM_COUNTER;
20702: } else {
20703: if ((epbMode & EPB_MODE_MC68882) != 0) {
20704: cirResponse = 0x8900_1504;
20705: } else {
20706: cirResponse = 0x8900_9504;
20707: }
20708: cirOperandLength = 1;
20709: cirOperandIndex = 0;
20710: cirStage = CIR_SOURCE_OPERAND;
20711: }
20712: return;
20713: }
20714: if (cirStage == CIR_PROGRAM_COUNTER) {
20715: cirOperandLength = 1;
20716: cirOperandIndex = 0;
20717: cirStage = CIR_SOURCE_OPERAND;
20718: return;
20719: }
20720: if (cirStage == CIR_SOURCE_OPERAND) {
20721: epbFPn[mmm = EPB_SRC_TMP].setf0 (cirOperandBuffer[0]);
20722: if (cirPreInstruction ()) {
20723: return;
20724: }
20725: }
20726: break;
20727:
20728: case 0b010:
20729:
20730:
20731:
20732:
20733:
20734:
20735:
20736:
20737:
20738:
20739:
20740:
20741:
20742:
20743:
20744:
20745: if (cirStage == CIR_IDLE) {
20746: if ((epbFpcr & 0x0000ff00) != 0) {
20747: if ((epbMode & EPB_MODE_MC68882) != 0) {
20748: cirResponse = 0x8900_560c;
20749: } else {
20750: cirResponse = 0x8900_d60c;
20751: }
20752: cirStage = CIR_PROGRAM_COUNTER;
20753: } else {
20754: if ((epbMode & EPB_MODE_MC68882) != 0) {
20755: cirResponse = 0x8900_160c;
20756: } else {
20757: cirResponse = 0x8900_960c;
20758: }
20759: cirOperandLength = 3;
20760: cirOperandIndex = 0;
20761: cirStage = CIR_SOURCE_OPERAND;
20762: }
20763: return;
20764: }
20765: if (cirStage == CIR_PROGRAM_COUNTER) {
20766: cirOperandLength = 3;
20767: cirOperandIndex = 0;
20768: cirStage = CIR_SOURCE_OPERAND;
20769: return;
20770: }
20771: if (cirStage == CIR_SOURCE_OPERAND) {
20772: if (epbIsTriple ()) {
20773: epbFPn[mmm = EPB_SRC_TMP].sety012 (cirOperandBuffer[0], (long) cirOperandBuffer[1] << 32 | cirOperandBuffer[2] & 0xffffffffL);
20774: } else {
20775: epbFPn[mmm = EPB_SRC_TMP].setx012 (cirOperandBuffer[0], (long) cirOperandBuffer[1] << 32 | cirOperandBuffer[2] & 0xffffffffL);
20776: }
20777: if (cirPreInstruction ()) {
20778: return;
20779: }
20780: }
20781: break;
20782:
20783: case 0b011:
20784:
20785:
20786:
20787:
20788:
20789:
20790:
20791:
20792:
20793:
20794:
20795:
20796:
20797:
20798:
20799:
20800: if (cirStage == CIR_IDLE) {
20801: if ((epbFpcr & 0x0000ff00) != 0) {
20802: cirResponse = 0x8900_d60c;
20803: cirStage = CIR_PROGRAM_COUNTER;
20804: } else {
20805: cirResponse = 0x8900_960c;
20806: cirOperandLength = 3;
20807: cirOperandIndex = 0;
20808: cirStage = CIR_SOURCE_OPERAND;
20809: }
20810: return;
20811: }
20812: if (cirStage == CIR_PROGRAM_COUNTER) {
20813: cirOperandLength = 3;
20814: cirOperandIndex = 0;
20815: cirStage = CIR_SOURCE_OPERAND;
20816: return;
20817: }
20818: if (cirStage == CIR_SOURCE_OPERAND) {
20819: epbFPn[mmm = EPB_SRC_TMP].setp012 (cirOperandBuffer[0], (long) cirOperandBuffer[1] << 32 | cirOperandBuffer[2] & 0xffffffffL);
20820: if (cirPreInstruction ()) {
20821: return;
20822: }
20823: }
20824: break;
20825:
20826: case 0b100:
20827:
20828:
20829:
20830:
20831:
20832:
20833:
20834:
20835:
20836:
20837:
20838:
20839:
20840:
20841:
20842:
20843:
20844: if (cirStage == CIR_IDLE) {
20845: if ((epbFpcr & 0x0000ff00) != 0) {
20846: cirResponse = 0x8900_d502;
20847: cirStage = CIR_PROGRAM_COUNTER;
20848: } else {
20849: cirResponse = 0x8900_9502;
20850: cirOperandLength = 1;
20851: cirOperandIndex = 0;
20852: cirStage = CIR_SOURCE_OPERAND;
20853: }
20854: return;
20855: }
20856: if (cirStage == CIR_PROGRAM_COUNTER) {
20857: cirOperandLength = 1;
20858: cirOperandIndex = 0;
20859: cirStage = CIR_SOURCE_OPERAND;
20860: return;
20861: }
20862: if (cirStage == CIR_SOURCE_OPERAND) {
20863: epbFPn[mmm = EPB_SRC_TMP].seti (cirOperandBuffer[0] >> 16);
20864: if (cirPreInstruction ()) {
20865: return;
20866: }
20867: }
20868: break;
20869:
20870: case 0b101:
20871:
20872:
20873:
20874:
20875:
20876:
20877:
20878:
20879:
20880:
20881:
20882:
20883:
20884: if (cirStage == CIR_IDLE) {
20885: if ((epbFpcr & 0x0000ff00) != 0) {
20886: if ((epbMode & EPB_MODE_MC68882) != 0) {
20887: cirResponse = 0x8900_5608;
20888: } else {
20889: cirResponse = 0x8900_d608;
20890: }
20891: cirStage = CIR_PROGRAM_COUNTER;
20892: } else {
20893: if ((epbMode & EPB_MODE_MC68882) != 0) {
20894: cirResponse = 0x8900_1608;
20895: } else {
20896: cirResponse = 0x8900_9608;
20897: }
20898: cirOperandLength = 2;
20899: cirOperandIndex = 0;
20900: cirStage = CIR_SOURCE_OPERAND;
20901: }
20902: return;
20903: }
20904: if (cirStage == CIR_PROGRAM_COUNTER) {
20905: cirOperandLength = 2;
20906: cirOperandIndex = 0;
20907: cirStage = CIR_SOURCE_OPERAND;
20908: return;
20909: }
20910: if (cirStage == CIR_SOURCE_OPERAND) {
20911: epbFPn[mmm = EPB_SRC_TMP].setd01 ((long) cirOperandBuffer[0] << 32 | cirOperandBuffer[1] & 0xffffffffL);
20912: if (cirPreInstruction ()) {
20913: return;
20914: }
20915: }
20916: break;
20917:
20918: case 0b110:
20919:
20920:
20921:
20922:
20923:
20924:
20925:
20926:
20927:
20928:
20929:
20930:
20931:
20932:
20933:
20934:
20935:
20936: if (cirStage == CIR_IDLE) {
20937: if ((epbFpcr & 0x0000ff00) != 0) {
20938: cirResponse = 0x8900_d501;
20939: cirStage = CIR_PROGRAM_COUNTER;
20940: } else {
20941: cirResponse = 0x8900_9501;
20942: cirOperandLength = 1;
20943: cirOperandIndex = 0;
20944: cirStage = CIR_SOURCE_OPERAND;
20945: }
20946: return;
20947: }
20948: if (cirStage == CIR_PROGRAM_COUNTER) {
20949: cirOperandLength = 1;
20950: cirOperandIndex = 0;
20951: cirStage = CIR_SOURCE_OPERAND;
20952: return;
20953: }
20954: if (cirStage == CIR_SOURCE_OPERAND) {
20955: epbFPn[mmm = EPB_SRC_TMP].seti (cirOperandBuffer[0] >> 24);
20956: if (cirPreInstruction ()) {
20957: return;
20958: }
20959: }
20960: break;
20961:
20962: case 0b111:
20963:
20964:
20965:
20966:
20967:
20968:
20969:
20970:
20971:
20972:
20973:
20974:
20975:
20976:
20977:
20978:
20979:
20980:
20981:
20982:
20983:
20984:
20985: default:
20986: if (0x40 <= ccccccc) {
20987:
20988:
20989: cirException (0x1c0b);
20990: return;
20991: }
20992: if (false) {
20993: mmm = EPB_CONST_START + ccccccc;
20994: ccccccc = 0;
20995: } else {
20996:
20997: epbFmovecr (epbFPn[nnn], ccccccc);
20998: if (cirMidInstruction ()) {
20999: return;
21000: }
21001:
21002: cirIdle (0x0802);
21003: return;
21004: }
21005:
21006: }
21007:
21008:
21009:
21010:
21011:
21012: case 0b000:
21013: if (cirStage == CIR_IDLE) {
21014: epbFpsr &= 0x00ff00ff;
21015: }
21016:
21017: switch (ccccccc) {
21018:
21019: case 0b000_0000:
21020:
21021:
21022:
21023:
21024:
21025:
21026:
21027:
21028:
21029:
21030:
21031:
21032:
21033:
21034:
21035:
21036:
21037:
21038:
21039:
21040:
21041: epbFPn[nnn].sete (epbFPn[mmm]).finish ();
21042: break;
21043:
21044: case 0b000_0001:
21045:
21046:
21047:
21048:
21049:
21050:
21051:
21052:
21053:
21054:
21055:
21056:
21057:
21058:
21059:
21060:
21061:
21062:
21063:
21064:
21065:
21066:
21067:
21068:
21069: epbSetRoundingPrec (EPB_PREC_EXD);
21070: epbFPn[nnn].round (epbFPn[mmm], epbRoundingMode);
21071: break;
21072:
21073: case 0b000_0010:
21074:
21075:
21076:
21077:
21078:
21079:
21080:
21081:
21082:
21083:
21084:
21085:
21086:
21087:
21088:
21089:
21090:
21091:
21092:
21093:
21094:
21095: epbFPn[nnn].sinh (epbFPn[mmm]);
21096: break;
21097:
21098: case 0b000_0011:
21099:
21100:
21101:
21102:
21103:
21104:
21105:
21106:
21107:
21108:
21109: epbSetRoundingPrec (EPB_PREC_EXD);
21110: epbFPn[nnn].trunc (epbFPn[mmm]);
21111: break;
21112:
21113: case 0b000_0100:
21114: case 0b000_0101:
21115:
21116:
21117:
21118:
21119:
21120:
21121:
21122:
21123:
21124:
21125: epbFPn[nnn].sqrt (epbFPn[mmm]);
21126: break;
21127:
21128: case 0b000_0110:
21129: case 0b000_0111:
21130:
21131:
21132:
21133:
21134:
21135:
21136:
21137:
21138:
21139: epbFPn[nnn].log1p (epbFPn[mmm]);
21140: break;
21141:
21142: case 0b000_1000:
21143:
21144:
21145:
21146:
21147:
21148:
21149:
21150:
21151: epbFPn[nnn].expm1 (epbFPn[mmm]);
21152: break;
21153:
21154: case 0b000_1001:
21155:
21156:
21157:
21158:
21159:
21160:
21161:
21162:
21163: epbFPn[nnn].tanh (epbFPn[mmm]);
21164: break;
21165:
21166: case 0b000_1010:
21167: case 0b000_1011:
21168:
21169:
21170:
21171:
21172:
21173:
21174:
21175:
21176: epbFPn[nnn].atan (epbFPn[mmm]);
21177: break;
21178:
21179: case 0b000_1100:
21180:
21181:
21182:
21183:
21184:
21185:
21186:
21187:
21188: epbFPn[nnn].asin (epbFPn[mmm]);
21189: break;
21190:
21191: case 0b000_1101:
21192:
21193:
21194:
21195:
21196:
21197:
21198:
21199:
21200:
21201: epbFPn[nnn].atanh (epbFPn[mmm]);
21202: break;
21203:
21204: case 0b000_1110:
21205:
21206:
21207:
21208:
21209:
21210:
21211:
21212:
21213: epbFPn[nnn].sin (epbFPn[mmm]);
21214: break;
21215:
21216: case 0b000_1111:
21217:
21218:
21219:
21220:
21221:
21222:
21223:
21224:
21225:
21226: epbFPn[nnn].tan (epbFPn[mmm]);
21227: break;
21228:
21229: case 0b001_0000:
21230:
21231:
21232:
21233:
21234:
21235:
21236:
21237:
21238: epbFPn[nnn].exp (epbFPn[mmm]);
21239: break;
21240:
21241: case 0b001_0001:
21242:
21243:
21244:
21245:
21246:
21247:
21248:
21249:
21250: epbFPn[nnn].exp2 (epbFPn[mmm]);
21251: break;
21252:
21253: case 0b001_0010:
21254: case 0b001_0011:
21255:
21256:
21257:
21258:
21259:
21260:
21261:
21262:
21263: epbFPn[nnn].exp10 (epbFPn[mmm]);
21264: break;
21265:
21266: case 0b001_0100:
21267:
21268:
21269:
21270:
21271:
21272:
21273:
21274:
21275:
21276:
21277: epbFPn[nnn].log (epbFPn[mmm]);
21278: break;
21279:
21280: case 0b001_0101:
21281:
21282:
21283:
21284:
21285:
21286:
21287:
21288:
21289: epbFPn[nnn].log10 (epbFPn[mmm]);
21290: break;
21291:
21292: case 0b001_0110:
21293: case 0b001_0111:
21294:
21295:
21296:
21297:
21298:
21299:
21300:
21301:
21302: epbFPn[nnn].log2 (epbFPn[mmm]);
21303: break;
21304:
21305: case 0b001_1000:
21306:
21307:
21308:
21309:
21310:
21311:
21312:
21313:
21314: epbFPn[nnn].abs (epbFPn[mmm]);
21315: break;
21316:
21317: case 0b001_1001:
21318:
21319:
21320:
21321:
21322:
21323:
21324:
21325:
21326: epbFPn[nnn].cosh (epbFPn[mmm]);
21327: break;
21328:
21329: case 0b001_1010:
21330: case 0b001_1011:
21331:
21332:
21333:
21334:
21335:
21336:
21337:
21338:
21339: epbFPn[nnn].neg (epbFPn[mmm]);
21340: break;
21341:
21342: case 0b001_1100:
21343:
21344:
21345:
21346:
21347:
21348:
21349:
21350:
21351:
21352:
21353: epbFPn[nnn].acos (epbFPn[mmm]);
21354: break;
21355:
21356: case 0b001_1101:
21357:
21358:
21359:
21360:
21361:
21362:
21363:
21364:
21365:
21366: epbFPn[nnn].cos (epbFPn[mmm]);
21367: break;
21368:
21369: case 0b001_1110:
21370:
21371:
21372:
21373:
21374:
21375:
21376:
21377:
21378: epbFPn[nnn].getexp (epbFPn[mmm]);
21379: break;
21380:
21381: case 0b001_1111:
21382:
21383:
21384:
21385:
21386:
21387:
21388:
21389:
21390: epbFPn[nnn].getman (epbFPn[mmm]);
21391: break;
21392:
21393: case 0b010_0000:
21394:
21395:
21396:
21397:
21398:
21399:
21400:
21401:
21402: epbFPn[nnn].div (epbFPn[mmm]);
21403: break;
21404:
21405: case 0b010_0001:
21406:
21407:
21408:
21409:
21410:
21411:
21412:
21413:
21414:
21415:
21416: epbFPn[nnn].rem (epbFPn[mmm]);
21417: break;
21418:
21419: case 0b010_0010:
21420:
21421:
21422:
21423:
21424:
21425:
21426:
21427:
21428: epbFPn[nnn].add (epbFPn[mmm]);
21429: break;
21430:
21431: case 0b010_0011:
21432:
21433:
21434:
21435:
21436:
21437:
21438:
21439:
21440: epbFPn[nnn].mul (epbFPn[mmm]);
21441: break;
21442:
21443: case 0b010_0100:
21444:
21445:
21446:
21447:
21448:
21449:
21450:
21451:
21452: epbSetRoundingPrec (EPB_PREC_XSG);
21453: epbFPn[nnn].div (epbFPn[mmm]);
21454: break;
21455:
21456: case 0b010_0101:
21457:
21458:
21459:
21460:
21461:
21462:
21463:
21464:
21465:
21466:
21467:
21468:
21469: epbFPn[nnn].ieeerem (epbFPn[mmm]);
21470: break;
21471:
21472: case 0b010_0110:
21473:
21474:
21475:
21476:
21477:
21478:
21479:
21480:
21481:
21482: epbFPn[nnn].scale (epbFPn[mmm]);
21483: break;
21484:
21485: case 0b010_0111:
21486:
21487:
21488:
21489:
21490:
21491:
21492:
21493:
21494: {
21495:
21496: int sr = epbFpsr;
21497: epbFPn[EPB_SRC_TMP].roundmanf (epbFPn[mmm], EPB_MODE_RZ);
21498: epbFPn[EPB_DST_TMP].roundmanf (epbFPn[nnn], EPB_MODE_RZ);
21499: epbFpsr = sr;
21500: }
21501: epbSetRoundingPrec (EPB_PREC_XSG);
21502: epbFPn[nnn].mul (epbFPn[EPB_DST_TMP], epbFPn[EPB_SRC_TMP]);
21503: break;
21504:
21505: case 0b010_1000:
21506: case 0b010_1001:
21507: case 0b010_1010:
21508: case 0b010_1011:
21509: case 0b010_1100:
21510: case 0b010_1101:
21511: case 0b010_1110:
21512: case 0b010_1111:
21513:
21514:
21515:
21516:
21517:
21518:
21519:
21520:
21521: epbFPn[nnn].sub (epbFPn[mmm]);
21522: break;
21523:
21524: case 0b011_0000:
21525: case 0b011_0001:
21526: case 0b011_0010:
21527: case 0b011_0011:
21528: case 0b011_0100:
21529: case 0b011_0101:
21530: case 0b011_0110:
21531: case 0b011_0111:
21532:
21533:
21534:
21535:
21536:
21537:
21538:
21539:
21540:
21541: {
21542: int ccc = ccccccc & 7;
21543:
21544: epbFPn[EPB_SRC_TMP].sete (epbFPn[mmm]);
21545: epbFPn[ccc].cos (epbFPn[EPB_SRC_TMP]);
21546: epbFPn[nnn].sin (epbFPn[EPB_SRC_TMP]);
21547: }
21548: break;
21549:
21550: case 0b011_1000:
21551: case 0b011_1001:
21552: case 0b011_1100:
21553: case 0b011_1101:
21554:
21555:
21556:
21557:
21558:
21559:
21560:
21561:
21562:
21563:
21564:
21565:
21566:
21567: {
21568: int xf = epbFPn[nnn].flg;
21569: int yf = epbFPn[mmm].flg;
21570: if ((xf | yf) << 3 < 0) {
21571:
21572: epbFPn[EPB_DST_TMP].flg = N;
21573: } else {
21574: int i = ((xf & yf) << 1 < 0 ? 0 :
21575: epbFPn[nnn].compareTo (epbFPn[mmm]));
21576: if (i == 0) {
21577: if (xf < 0) {
21578:
21579: epbFPn[EPB_DST_TMP].flg = M | Z;
21580: } else {
21581:
21582: epbFPn[EPB_DST_TMP].flg = P | Z;
21583: }
21584: } else if (i < 0) {
21585: epbFPn[EPB_DST_TMP].negset1 ();
21586: } else {
21587: epbFPn[EPB_DST_TMP].set1 ();
21588: }
21589: }
21590: nnn = EPB_DST_TMP;
21591: }
21592: break;
21593:
21594: case 0b011_1010:
21595: case 0b011_1011:
21596: case 0b011_1110:
21597: case 0b011_1111:
21598:
21599:
21600:
21601:
21602:
21603:
21604:
21605:
21606:
21607:
21608:
21609: epbFPn[EPB_DST_TMP].sete (epbFPn[mmm]);
21610: nnn = EPB_DST_TMP;
21611: break;
21612:
21613: case 0b100_0000:
21614:
21615:
21616:
21617:
21618:
21619:
21620:
21621:
21622: epbSetRoundingPrec (EPB_PREC_SGL);
21623: epbFPn[nnn].sete (epbFPn[mmm]).finish ();
21624: break;
21625:
21626: case 0b100_0001:
21627:
21628:
21629:
21630:
21631:
21632:
21633:
21634:
21635: epbSetRoundingPrec (EPB_PREC_SGL);
21636: epbFPn[nnn].sqrt (epbFPn[mmm]);
21637: break;
21638:
21639:
21640:
21641:
21642: case 0b100_0100:
21643:
21644:
21645:
21646:
21647:
21648:
21649:
21650:
21651: epbSetRoundingPrec (EPB_PREC_DBL);
21652: epbFPn[nnn].sete (epbFPn[mmm]).finish ();
21653: break;
21654:
21655: case 0b100_0101:
21656:
21657:
21658:
21659:
21660:
21661:
21662:
21663:
21664: epbSetRoundingPrec (EPB_PREC_DBL);
21665: epbFPn[nnn].sqrt (epbFPn[mmm]);
21666: break;
21667:
21668:
21669:
21670:
21671:
21672:
21673:
21674:
21675:
21676:
21677:
21678:
21679:
21680:
21681:
21682:
21683:
21684:
21685:
21686:
21687: case 0b101_1000:
21688:
21689:
21690:
21691:
21692:
21693:
21694:
21695:
21696: epbSetRoundingPrec (EPB_PREC_SGL);
21697: epbFPn[nnn].abs (epbFPn[mmm]);
21698: break;
21699:
21700:
21701:
21702: case 0b101_1010:
21703:
21704:
21705:
21706:
21707:
21708:
21709:
21710:
21711: epbSetRoundingPrec (EPB_PREC_SGL);
21712: epbFPn[nnn].neg (epbFPn[mmm]);
21713: break;
21714:
21715:
21716:
21717: case 0b101_1100:
21718:
21719:
21720:
21721:
21722:
21723:
21724:
21725:
21726: epbSetRoundingPrec (EPB_PREC_DBL);
21727: epbFPn[nnn].abs (epbFPn[mmm]);
21728: break;
21729:
21730:
21731:
21732: case 0b101_1110:
21733:
21734:
21735:
21736:
21737:
21738:
21739:
21740:
21741: epbSetRoundingPrec (EPB_PREC_DBL);
21742: epbFPn[nnn].neg (epbFPn[mmm]);
21743: break;
21744:
21745:
21746:
21747: case 0b110_0000:
21748:
21749:
21750:
21751:
21752:
21753:
21754:
21755:
21756: epbSetRoundingPrec (EPB_PREC_SGL);
21757: epbFPn[nnn].div (epbFPn[mmm]);
21758: break;
21759:
21760:
21761:
21762: case 0b110_0010:
21763:
21764:
21765:
21766:
21767:
21768:
21769:
21770:
21771: epbSetRoundingPrec (EPB_PREC_SGL);
21772: epbFPn[nnn].add (epbFPn[mmm]);
21773: break;
21774:
21775: case 0b110_0011:
21776:
21777:
21778:
21779:
21780:
21781:
21782:
21783:
21784: epbSetRoundingPrec (EPB_PREC_SGL);
21785: epbFPn[nnn].mul (epbFPn[mmm]);
21786: break;
21787:
21788: case 0b110_0100:
21789:
21790:
21791:
21792:
21793:
21794:
21795:
21796:
21797: epbSetRoundingPrec (EPB_PREC_DBL);
21798: epbFPn[nnn].div (epbFPn[mmm]);
21799: break;
21800:
21801:
21802:
21803: case 0b110_0110:
21804:
21805:
21806:
21807:
21808:
21809:
21810:
21811:
21812: epbSetRoundingPrec (EPB_PREC_DBL);
21813: epbFPn[nnn].add (epbFPn[mmm]);
21814: break;
21815:
21816: case 0b110_0111:
21817:
21818:
21819:
21820:
21821:
21822:
21823:
21824:
21825: epbSetRoundingPrec (EPB_PREC_DBL);
21826: epbFPn[nnn].mul (epbFPn[mmm]);
21827: break;
21828:
21829: case 0b110_1000:
21830:
21831:
21832:
21833:
21834:
21835:
21836:
21837:
21838: epbSetRoundingPrec (EPB_PREC_SGL);
21839: epbFPn[nnn].sub (epbFPn[mmm]);
21840: break;
21841:
21842:
21843:
21844:
21845:
21846: case 0b110_1100:
21847:
21848:
21849:
21850:
21851:
21852:
21853:
21854:
21855:
21856:
21857:
21858:
21859:
21860:
21861:
21862:
21863:
21864:
21865:
21866:
21867:
21868:
21869:
21870:
21871: epbSetRoundingPrec (EPB_PREC_DBL);
21872: epbFPn[nnn].sub (epbFPn[mmm]);
21873: break;
21874:
21875:
21876:
21877:
21878:
21879: case 0b111_0000:
21880: if (EFPBox.EPB_EXTRA_OPERATION) {
21881: epbFPn[nnn].lgamma (epbFPn[mmm]);
21882: } else {
21883: cirException (0x1c0b);
21884: }
21885: break;
21886:
21887: case 0b111_0001:
21888: if (EFPBox.EPB_EXTRA_OPERATION) {
21889: epbFPn[nnn].tgamma (epbFPn[mmm]);
21890: } else {
21891: cirException (0x1c0b);
21892: }
21893: break;
21894:
21895:
21896:
21897:
21898:
21899:
21900:
21901:
21902:
21903:
21904:
21905:
21906:
21907:
21908:
21909:
21910: default:
21911: cirException (0x1c0b);
21912: return;
21913: }
21914:
21915: epbFpsr |= epbFPn[nnn].flg >>> 4;
21916: if (cirMidInstruction ()) {
21917: return;
21918: }
21919:
21920: cirIdle (0x0802);
21921: return;
21922:
21923:
21924: case 0b011:
21925:
21926:
21927:
21928:
21929:
21930:
21931:
21932:
21933: if (cirStage == CIR_IDLE) {
21934: epbFpsr &= 0xffff00ff;
21935: } else if (cirStage == CIR_DESTINATION_OPERAND) {
21936:
21937: cirIdle (0x0802);
21938: return;
21939: }
21940:
21941: switch (mmm) {
21942:
21943: case 0b000:
21944:
21945:
21946:
21947:
21948:
21949:
21950:
21951:
21952:
21953:
21954:
21955:
21956:
21957:
21958:
21959:
21960:
21961: cirOperandBuffer[0] = epbFPn[nnn].geti (epbRoundingMode);
21962: if (cirMidInstruction ()) {
21963: return;
21964: }
21965: cirResponse = 0x8900_b104;
21966: cirOperandLength = 1;
21967: cirOperandIndex = 0;
21968: cirStage = CIR_DESTINATION_OPERAND;
21969: break;
21970:
21971: case 0b001:
21972:
21973:
21974:
21975:
21976:
21977:
21978:
21979:
21980:
21981:
21982:
21983:
21984:
21985:
21986:
21987:
21988:
21989: cirOperandBuffer[0] = epbFPn[nnn].getf0 (epbRoundingMode);
21990: if (cirMidInstruction ()) {
21991: return;
21992: }
21993: if ((epbMode & EPB_MODE_MC68882) != 0) {
21994: cirResponse = 0x8900_3104;
21995: } else {
21996: cirResponse = 0x8900_b104;
21997: }
21998: cirOperandLength = 1;
21999: cirOperandIndex = 0;
22000: cirStage = CIR_DESTINATION_OPERAND;
22001: break;
22002:
22003: case 0b010:
22004:
22005:
22006:
22007:
22008:
22009:
22010:
22011:
22012:
22013:
22014:
22015:
22016:
22017:
22018:
22019:
22020:
22021:
22022:
22023:
22024:
22025:
22026:
22027:
22028:
22029: {
22030: byte[] b = new byte[12];
22031: if (epbIsTriple ()) {
22032: epbFPn[nnn].gety012 (b, 0, epbRoundingMode);
22033: } else {
22034: epbFPn[nnn].getx012 (b, 0, epbRoundingMode);
22035: }
22036: if (cirMidInstruction ()) {
22037: return;
22038: }
22039: cirOperandBuffer[0] = b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
22040: cirOperandBuffer[1] = b[4] << 24 | (b[5] & 255) << 16 | (char) (b[6] << 8 | b[7] & 255);
22041: cirOperandBuffer[2] = b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255);
22042: if ((epbMode & EPB_MODE_MC68882) != 0) {
22043: cirResponse = 0x8900_320c;
22044: } else {
22045: cirResponse = 0x8900_320c;
22046: }
22047: cirOperandLength = 3;
22048: cirOperandIndex = 0;
22049: cirStage = CIR_DESTINATION_OPERAND;
22050: break;
22051: }
22052:
22053: case 0b011:
22054:
22055:
22056:
22057:
22058:
22059:
22060:
22061:
22062:
22063:
22064:
22065:
22066:
22067:
22068:
22069:
22070:
22071:
22072:
22073:
22074:
22075:
22076:
22077:
22078:
22079:
22080:
22081:
22082:
22083:
22084:
22085:
22086:
22087:
22088:
22089:
22090:
22091:
22092:
22093:
22094:
22095:
22096:
22097:
22098:
22099:
22100:
22101:
22102:
22103:
22104:
22105:
22106:
22107:
22108:
22109:
22110:
22111:
22112:
22113:
22114:
22115:
22116:
22117:
22118:
22119:
22120:
22121:
22122:
22123:
22124:
22125:
22126:
22127:
22128:
22129:
22130:
22131:
22132:
22133:
22134:
22135:
22136:
22137:
22138:
22139:
22140:
22141:
22142:
22143:
22144:
22145:
22146:
22147:
22148:
22149:
22150:
22151:
22152:
22153:
22154:
22155: {
22156: byte[] b = new byte[12];
22157: epbFPn[nnn].getp012 (b, 0, ccccccc);
22158: if (cirMidInstruction ()) {
22159: return;
22160: }
22161: cirOperandBuffer[0] = b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
22162: cirOperandBuffer[1] = b[4] << 24 | (b[5] & 255) << 16 | (char) (b[6] << 8 | b[7] & 255);
22163: cirOperandBuffer[2] = b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255);
22164: cirResponse = 0x8900_b20c;
22165: cirOperandLength = 3;
22166: cirOperandIndex = 0;
22167: cirStage = CIR_DESTINATION_OPERAND;
22168: break;
22169: }
22170:
22171: case 0b100:
22172:
22173:
22174:
22175:
22176:
22177:
22178:
22179:
22180:
22181:
22182:
22183:
22184:
22185:
22186:
22187:
22188:
22189: cirOperandBuffer[0] = epbFPn[nnn].gets (epbRoundingMode) << 16;
22190: if (cirMidInstruction ()) {
22191: return;
22192: }
22193: cirResponse = 0x8900_b102;
22194: cirOperandLength = 1;
22195: cirOperandIndex = 0;
22196: cirStage = CIR_DESTINATION_OPERAND;
22197: break;
22198:
22199: case 0b101:
22200:
22201:
22202:
22203:
22204:
22205:
22206:
22207:
22208:
22209:
22210:
22211:
22212:
22213:
22214:
22215:
22216:
22217:
22218:
22219:
22220:
22221: {
22222: long l = epbFPn[nnn].getd01 (epbRoundingMode);
22223: if (cirMidInstruction ()) {
22224: return;
22225: }
22226: cirOperandBuffer[0] = (int) (l >> 32);
22227: cirOperandBuffer[1] = (int) l;
22228: if ((epbMode & EPB_MODE_MC68882) != 0) {
22229: cirResponse = 0x8900_3208;
22230: } else {
22231: cirResponse = 0x8900_b208;
22232: }
22233: cirOperandLength = 2;
22234: cirOperandIndex = 0;
22235: cirStage = CIR_DESTINATION_OPERAND;
22236: }
22237: break;
22238:
22239: case 0b110:
22240:
22241:
22242:
22243:
22244:
22245:
22246:
22247:
22248:
22249:
22250:
22251:
22252:
22253:
22254:
22255:
22256:
22257: cirOperandBuffer[0] = epbFPn[nnn].getb (epbRoundingMode) << 24;
22258: if (cirMidInstruction ()) {
22259: return;
22260: }
22261: cirResponse = 0x8900_b101;
22262: cirOperandLength = 1;
22263: cirOperandIndex = 0;
22264: cirStage = CIR_DESTINATION_OPERAND;
22265: break;
22266:
22267: case 0b111:
22268:
22269:
22270:
22271:
22272:
22273:
22274:
22275:
22276:
22277:
22278:
22279:
22280:
22281:
22282:
22283:
22284:
22285:
22286:
22287:
22288:
22289:
22290:
22291:
22292:
22293:
22294:
22295:
22296: default:
22297: if (cirStage == CIR_IDLE) {
22298: cirResponse = 0x8900_8c00 + (cirCommand >> 4 & 7);
22299: cirOperandLength = 1;
22300: cirOperandIndex = 0;
22301: cirStage = CIR_DYNAMIC_K_FACTOR;
22302: return;
22303: } else if (cirStage == CIR_DYNAMIC_K_FACTOR) {
22304: byte[] b = new byte[12];
22305: epbFPn[nnn].getp012 (b, 0, cirOperandBuffer[0]);
22306: if (cirMidInstruction ()) {
22307: return;
22308: }
22309: cirOperandBuffer[0] = b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
22310: cirOperandBuffer[1] = b[4] << 24 | (b[5] & 255) << 16 | (char) (b[6] << 8 | b[7] & 255);
22311: cirOperandBuffer[2] = b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255);
22312: cirResponse = 0x8900_b20c;
22313: cirOperandLength = 3;
22314: cirOperandIndex = 0;
22315: cirStage = CIR_DESTINATION_OPERAND;
22316: }
22317: }
22318: return;
22319:
22320:
22321: case 0b100:
22322:
22323:
22324:
22325: switch (mmm) {
22326:
22327: case 0b000:
22328:
22329:
22330:
22331:
22332:
22333:
22334:
22335:
22336:
22337:
22338:
22339:
22340: case 0b001:
22341:
22342:
22343:
22344:
22345:
22346:
22347:
22348:
22349:
22350:
22351: if (cirStage == CIR_IDLE) {
22352: cirResponse = 0x8900_9704;
22353: cirOperandLength = 1;
22354: cirOperandIndex = 0;
22355: cirStage = CIR_SOURCE_OPERAND;
22356: return;
22357: } else {
22358: epbFpiar = cirOperandBuffer[0];
22359: }
22360: break;
22361:
22362: case 0b010:
22363:
22364:
22365:
22366:
22367:
22368:
22369:
22370:
22371:
22372:
22373:
22374:
22375: if (cirStage == CIR_IDLE) {
22376: cirResponse = 0x8900_9504;
22377: cirOperandLength = 1;
22378: cirOperandIndex = 0;
22379: cirStage = CIR_SOURCE_OPERAND;
22380: return;
22381: } else {
22382: epbFpsr = cirOperandBuffer[0] & EPB_FPSR_ALL;
22383: }
22384: break;
22385:
22386: case 0b011:
22387:
22388:
22389:
22390:
22391:
22392:
22393:
22394:
22395:
22396:
22397:
22398:
22399:
22400: if (cirStage == CIR_IDLE) {
22401: cirResponse = 0x8900_9608;
22402: cirOperandLength = 2;
22403: cirOperandIndex = 0;
22404: cirStage = CIR_SOURCE_OPERAND;
22405: return;
22406: } else {
22407: epbFpsr = cirOperandBuffer[0] & EPB_FPSR_ALL;
22408: epbFpiar = cirOperandBuffer[1];
22409: }
22410: break;
22411:
22412: case 0b100:
22413:
22414:
22415:
22416:
22417:
22418:
22419:
22420:
22421:
22422:
22423: if (cirStage == CIR_IDLE) {
22424: cirResponse = 0x8900_9504;
22425: cirOperandLength = 1;
22426: cirOperandIndex = 0;
22427: cirStage = CIR_SOURCE_OPERAND;
22428: return;
22429: } else {
22430: epbFpcr = cirOperandBuffer[0] & EPB_FPCR_ALL;
22431: }
22432: break;
22433:
22434: case 0b101:
22435:
22436:
22437:
22438:
22439:
22440:
22441:
22442:
22443:
22444:
22445:
22446:
22447:
22448: if (cirStage == CIR_IDLE) {
22449: cirResponse = 0x8900_9608;
22450: cirOperandLength = 2;
22451: cirOperandIndex = 0;
22452: cirStage = CIR_SOURCE_OPERAND;
22453: return;
22454: } else {
22455: epbFpcr = cirOperandBuffer[0] & EPB_FPCR_ALL;
22456: epbFpiar = cirOperandBuffer[1];
22457: }
22458: break;
22459:
22460: case 0b110:
22461:
22462:
22463:
22464:
22465:
22466:
22467:
22468:
22469:
22470:
22471:
22472:
22473:
22474: if (cirStage == CIR_IDLE) {
22475: cirResponse = 0x8900_9608;
22476: cirOperandLength = 2;
22477: cirOperandIndex = 0;
22478: cirStage = CIR_SOURCE_OPERAND;
22479: return;
22480: } else {
22481: epbFpcr = cirOperandBuffer[0] & EPB_FPCR_ALL;
22482: epbFpsr = cirOperandBuffer[1] & EPB_FPSR_ALL;
22483: }
22484: break;
22485:
22486: case 0b111:
22487:
22488:
22489:
22490:
22491:
22492:
22493:
22494:
22495:
22496:
22497:
22498:
22499:
22500:
22501:
22502:
22503: default:
22504: if (cirStage == CIR_IDLE) {
22505: cirResponse = 0x8900_960c;
22506: cirOperandLength = 3;
22507: cirOperandIndex = 0;
22508: cirStage = CIR_SOURCE_OPERAND;
22509: return;
22510: } else {
22511: epbFpcr = cirOperandBuffer[0] & EPB_FPCR_ALL;
22512: epbFpsr = cirOperandBuffer[1] & EPB_FPSR_ALL;
22513: epbFpiar = cirOperandBuffer[2];
22514: }
22515: }
22516:
22517: cirIdle (0x0802);
22518: return;
22519:
22520:
22521: case 0b101:
22522:
22523:
22524: if (cirStage == CIR_DESTINATION_OPERAND) {
22525:
22526: cirIdle (0x0802);
22527: return;
22528: }
22529:
22530: switch (mmm) {
22531:
22532: case 0b000:
22533:
22534:
22535:
22536:
22537:
22538:
22539:
22540:
22541:
22542:
22543:
22544:
22545:
22546: case 0b001:
22547:
22548:
22549:
22550:
22551:
22552:
22553:
22554:
22555:
22556:
22557:
22558: cirOperandBuffer[0] = epbFpiar;
22559: cirResponse = 0x8900_b304;
22560: cirOperandLength = 1;
22561: cirOperandIndex = 0;
22562: cirStage = CIR_DESTINATION_OPERAND;
22563: return;
22564:
22565: case 0b010:
22566:
22567:
22568:
22569:
22570:
22571:
22572:
22573:
22574:
22575:
22576:
22577: cirOperandBuffer[0] = epbFpsr;
22578: cirResponse = 0x8900_b104;
22579: cirOperandLength = 1;
22580: cirOperandIndex = 0;
22581: cirStage = CIR_DESTINATION_OPERAND;
22582: return;
22583:
22584: case 0b011:
22585:
22586:
22587:
22588:
22589:
22590:
22591:
22592:
22593:
22594:
22595:
22596:
22597:
22598:
22599:
22600: cirOperandBuffer[0] = epbFpsr;
22601: cirOperandBuffer[1] = epbFpiar;
22602: cirResponse = 0x8900_b208;
22603: cirOperandLength = 2;
22604: cirOperandIndex = 0;
22605: cirStage = CIR_DESTINATION_OPERAND;
22606: return;
22607:
22608: case 0b100:
22609:
22610:
22611:
22612:
22613:
22614:
22615:
22616:
22617:
22618:
22619:
22620: cirOperandBuffer[0] = epbFpcr;
22621: cirResponse = 0x8900_b104;
22622: cirOperandLength = 1;
22623: cirOperandIndex = 0;
22624: cirStage = CIR_DESTINATION_OPERAND;
22625: return;
22626:
22627: case 0b101:
22628:
22629:
22630:
22631:
22632:
22633:
22634:
22635:
22636:
22637:
22638:
22639:
22640:
22641:
22642:
22643: cirOperandBuffer[0] = epbFpcr;
22644: cirOperandBuffer[1] = epbFpiar;
22645: cirResponse = 0x8900_b208;
22646: cirOperandLength = 2;
22647: cirOperandIndex = 0;
22648: cirStage = CIR_DESTINATION_OPERAND;
22649: return;
22650:
22651: case 0b110:
22652:
22653:
22654:
22655:
22656:
22657:
22658:
22659:
22660:
22661:
22662:
22663:
22664:
22665:
22666:
22667: cirOperandBuffer[0] = epbFpcr;
22668: cirOperandBuffer[1] = epbFpsr;
22669: cirResponse = 0x8900_b208;
22670: cirOperandLength = 2;
22671: cirOperandIndex = 0;
22672: cirStage = CIR_DESTINATION_OPERAND;
22673: return;
22674:
22675: case 0b111:
22676:
22677:
22678:
22679:
22680:
22681:
22682:
22683:
22684:
22685:
22686:
22687:
22688:
22689:
22690:
22691:
22692:
22693:
22694:
22695: default:
22696: cirOperandBuffer[0] = epbFpcr;
22697: cirOperandBuffer[1] = epbFpsr;
22698: cirOperandBuffer[2] = epbFpiar;
22699: cirResponse = 0x8900_b20c;
22700: cirOperandLength = 3;
22701: cirOperandIndex = 0;
22702: cirStage = CIR_DESTINATION_OPERAND;
22703: return;
22704: }
22705:
22706:
22707:
22708: case 0b110:
22709:
22710:
22711:
22712:
22713:
22714:
22715:
22716:
22717:
22718:
22719:
22720:
22721:
22722:
22723:
22724:
22725:
22726:
22727:
22728:
22729:
22730:
22731:
22732:
22733:
22734:
22735:
22736:
22737:
22738:
22739:
22740:
22741:
22742:
22743:
22744:
22745:
22746:
22747:
22748:
22749:
22750:
22751:
22752:
22753:
22754:
22755:
22756:
22757:
22758:
22759:
22760:
22761:
22762:
22763:
22764:
22765:
22766:
22767:
22768:
22769:
22770:
22771:
22772:
22773:
22774:
22775:
22776:
22777:
22778:
22779:
22780:
22781:
22782:
22783:
22784:
22785:
22786:
22787:
22788:
22789:
22790:
22791:
22792:
22793:
22794:
22795:
22796:
22797:
22798:
22799:
22800:
22801:
22802:
22803:
22804:
22805:
22806:
22807:
22808:
22809:
22810:
22811:
22812:
22813:
22814:
22815:
22816:
22817:
22818:
22819:
22820:
22821:
22822:
22823:
22824:
22825:
22826:
22827:
22828:
22829:
22830:
22831:
22832:
22833:
22834:
22835:
22836:
22837:
22838:
22839:
22840:
22841:
22842:
22843:
22844:
22845:
22846:
22847:
22848:
22849:
22850:
22851:
22852:
22853:
22854:
22855:
22856:
22857:
22858:
22859:
22860:
22861:
22862:
22863:
22864:
22865:
22866:
22867:
22868:
22869:
22870:
22871:
22872:
22873:
22874:
22875:
22876:
22877:
22878:
22879:
22880:
22881:
22882:
22883:
22884:
22885:
22886:
22887:
22888:
22889:
22890:
22891:
22892:
22893:
22894:
22895:
22896:
22897:
22898:
22899:
22900:
22901:
22902:
22903:
22904:
22905:
22906:
22907:
22908:
22909:
22910:
22911:
22912:
22913:
22914:
22915:
22916:
22917:
22918:
22919:
22920:
22921:
22922:
22923:
22924:
22925:
22926:
22927:
22928:
22929:
22930:
22931:
22932:
22933:
22934:
22935:
22936:
22937:
22938:
22939:
22940:
22941:
22942:
22943:
22944:
22945:
22946:
22947:
22948:
22949:
22950:
22951:
22952:
22953:
22954:
22955:
22956:
22957:
22958:
22959:
22960:
22961:
22962:
22963:
22964:
22965:
22966:
22967:
22968:
22969:
22970:
22971:
22972:
22973:
22974:
22975:
22976:
22977:
22978:
22979:
22980:
22981:
22982:
22983:
22984:
22985:
22986:
22987:
22988:
22989: if (cirStage == CIR_IDLE) {
22990: if ((cirCommand & 0x0700) != 0) {
22991: cirException (0x1c0b);
22992: return;
22993: }
22994: if ((mmm & 2) == 0) {
22995: cirRegisterList = cirCommand & 255;
22996: cirResponse = 0x8900_810c;
22997: cirStage = CIR_REGISTER_SELECT;
22998: } else {
22999: cirResponse = 0x8900_8c00 + (cirCommand >> 4 & 7);
23000: cirOperandLength = 1;
23001: cirOperandIndex = 0;
23002: cirStage = CIR_DYNAMIC_REGISTER_LIST;
23003: }
23004: return;
23005: }
23006: if (cirStage == CIR_DYNAMIC_REGISTER_LIST) {
23007: cirRegisterList = cirOperandBuffer[0] & 255;
23008: cirResponse = 0x8900_810c;
23009: cirStage = CIR_REGISTER_SELECT;
23010: return;
23011: }
23012: if (cirStage == CIR_REGISTER_SELECT) {
23013: if (cirRegisterList == 0) {
23014:
23015: cirIdle (0x0802);
23016: return;
23017: }
23018: cirOperandLength = 3 * Integer.bitCount (cirRegisterList);
23019: cirOperandIndex = 0;
23020: cirStage = CIR_SOURCE_OPERAND;
23021: return;
23022: }
23023:
23024: {
23025: int n, p;
23026: if ((cirCommand & 0x1000) == 0) {
23027: n = 7;
23028: p = -1;
23029: } else {
23030: n = 0;
23031: p = 1;
23032: }
23033: int i = 0;
23034: for (int list = cirRegisterList << 24; list != 0; n += p, list <<= 1) {
23035: if (list < 0) {
23036: if (epbIsTriple ()) {
23037: epbFPn[n].sety012 (cirOperandBuffer[i], (long) cirOperandBuffer[i + 1] << 32 | cirOperandBuffer[i + 2] & 0xffffffffL);
23038: } else {
23039: epbFPn[n].setx012 (cirOperandBuffer[i], (long) cirOperandBuffer[i + 1] << 32 | cirOperandBuffer[i + 2] & 0xffffffffL);
23040: }
23041: i += 3;
23042: }
23043: }
23044:
23045: cirIdle (0x0802);
23046: return;
23047: }
23048:
23049:
23050:
23051: case 0b111:
23052:
23053:
23054:
23055:
23056:
23057:
23058:
23059:
23060:
23061:
23062:
23063:
23064:
23065:
23066:
23067:
23068:
23069:
23070:
23071:
23072:
23073:
23074:
23075:
23076:
23077:
23078:
23079:
23080:
23081:
23082:
23083:
23084:
23085:
23086:
23087:
23088:
23089:
23090:
23091:
23092:
23093:
23094:
23095:
23096:
23097:
23098:
23099:
23100:
23101:
23102:
23103:
23104:
23105:
23106:
23107:
23108:
23109:
23110:
23111:
23112:
23113:
23114:
23115:
23116:
23117:
23118:
23119:
23120:
23121:
23122:
23123:
23124:
23125:
23126:
23127:
23128:
23129:
23130:
23131:
23132:
23133:
23134:
23135:
23136:
23137:
23138:
23139:
23140:
23141:
23142:
23143:
23144:
23145:
23146:
23147:
23148:
23149:
23150:
23151:
23152:
23153:
23154:
23155:
23156:
23157:
23158:
23159:
23160:
23161:
23162:
23163:
23164:
23165:
23166:
23167:
23168:
23169:
23170:
23171:
23172:
23173:
23174:
23175:
23176:
23177:
23178:
23179:
23180:
23181:
23182:
23183:
23184:
23185:
23186:
23187:
23188:
23189:
23190:
23191:
23192:
23193:
23194:
23195:
23196: if (cirStage == CIR_IDLE) {
23197: if ((cirCommand & 0x0700) != 0) {
23198: cirException (0x1c0b);
23199: return;
23200: }
23201: if ((mmm & 2) == 0) {
23202: cirRegisterList = cirCommand & 255;
23203: cirResponse = 0x8900_a10c;
23204: cirStage = CIR_REGISTER_SELECT;
23205: } else {
23206: cirResponse = 0x8900_8c00 + (cirCommand >> 4 & 7);
23207: cirOperandLength = 1;
23208: cirOperandIndex = 0;
23209: cirStage = CIR_DYNAMIC_REGISTER_LIST;
23210: }
23211: return;
23212: }
23213: if (cirStage == CIR_DYNAMIC_REGISTER_LIST) {
23214: cirRegisterList = cirOperandBuffer[0] & 255;
23215: cirResponse = 0x8900_a10c;
23216: cirStage = CIR_REGISTER_SELECT;
23217: return;
23218: }
23219: if (cirStage == CIR_REGISTER_SELECT) {
23220: if (cirRegisterList == 0) {
23221:
23222: cirIdle (0x0802);
23223: return;
23224: }
23225: int n, p;
23226: if ((cirCommand & 0x1000) == 0) {
23227: n = 7;
23228: p = -1;
23229: } else {
23230: n = 0;
23231: p = 1;
23232: }
23233: int i = 0;
23234: byte[] b = new byte[12];
23235: for (int list = cirRegisterList << 24; list != 0; n += p, list <<= 1) {
23236: if (list < 0) {
23237: if (epbIsTriple ()) {
23238: epbFPn[n].gety012 (b, 0, epbRoundingMode);
23239: } else {
23240: epbFPn[n].getx012 (b, 0, epbRoundingMode);
23241: }
23242: cirOperandBuffer[i] = b[0] << 24 | (b[1] & 255) << 16 | (char) (b[2] << 8 | b[3] & 255);
23243: cirOperandBuffer[i + 1] = b[4] << 24 | (b[5] & 255) << 16 | (char) (b[6] << 8 | b[7] & 255);
23244: cirOperandBuffer[i + 2] = b[8] << 24 | (b[9] & 255) << 16 | (char) (b[10] << 8 | b[11] & 255);
23245: i += 3;
23246: }
23247: }
23248: cirOperandLength = i;
23249: cirOperandIndex = 0;
23250: cirStage = CIR_DESTINATION_OPERAND;
23251: return;
23252: }
23253:
23254: {
23255:
23256: cirIdle (0x0802);
23257: return;
23258: }
23259:
23260:
23261:
23262: case 0b001:
23263: default:
23264: cirException (0x1c0b);
23265: return;
23266: }
23267:
23268: }
23269:
23270:
23271:
23272:
23273:
23274:
23275:
23276: public boolean cirPreInstruction () {
23277:
23278: epbFpsr |= XEiJ.FPU_FPSR_EXC_TO_AEXC[epbFpsr >> 8 & 255];
23279:
23280: int mask = epbFpcr & epbFpsr & 0x0000ff00;
23281: if (mask == 0) {
23282: return false;
23283: }
23284: if ((short) mask < 0) {
23285: cirException (0x5c30);
23286: } else if (mask << 17 < 0) {
23287: cirException (0x1c36);
23288: } else if (mask << 18 < 0) {
23289: cirException (0x1c34);
23290: } else if (mask << 19 < 0) {
23291: cirException (0x1c35);
23292: } else if (mask << 20 < 0) {
23293: cirException (0x1c33);
23294: } else if (mask << 21 < 0) {
23295: cirException (0x1c32);
23296: } else {
23297: cirException (0x1c31);
23298: }
23299: return true;
23300: }
23301:
23302:
23303:
23304:
23305:
23306:
23307: public boolean cirMidInstruction () {
23308:
23309: epbFpsr |= XEiJ.FPU_FPSR_EXC_TO_AEXC[epbFpsr >> 8 & 255];
23310:
23311: int mask = epbFpcr & epbFpsr & 0x0000ff00;
23312: if (mask == 0) {
23313: return false;
23314: }
23315: if ((short) mask < 0) {
23316: cirException (0x5d30);
23317: } else if (mask << 17 < 0) {
23318: cirException (0x1d36);
23319: } else if (mask << 18 < 0) {
23320: cirException (0x1d34);
23321: } else if (mask << 19 < 0) {
23322: cirException (0x1d35);
23323: } else if (mask << 20 < 0) {
23324: cirException (0x1d33);
23325: } else if (mask << 21 < 0) {
23326: cirException (0x1d32);
23327: } else {
23328: cirException (0x1d31);
23329: }
23330: return true;
23331: }
23332:
23333:
23334:
23335: }
23336:
23337:
23338: