Lines Matching refs:BigInteger
122 import java.math.BigInteger;
211 static final BigInteger big0 = BigInteger.ZERO;
212 static final BigInteger big1 = BigInteger.ONE;
213 static final BigInteger bigm1 = BigInteger.valueOf(-1);
214 static final BigInteger big2 = BigInteger.valueOf(2);
215 static final BigInteger bigm2 = BigInteger.valueOf(-2);
216 static final BigInteger big3 = BigInteger.valueOf(3);
217 static final BigInteger big6 = BigInteger.valueOf(6);
218 static final BigInteger big8 = BigInteger.valueOf(8);
219 static final BigInteger big10 = BigInteger.TEN;
220 static final BigInteger big750 = BigInteger.valueOf(750);
221 static final BigInteger bigm750 = BigInteger.valueOf(-750);
244 protected abstract BigInteger approximate(int precision); in approximate()
248 transient BigInteger max_appr;
279 public static CR valueOf(BigInteger n) { in valueOf()
288 return valueOf(BigInteger.valueOf(n)); in valueOf()
296 return valueOf(BigInteger.valueOf(n)); in valueOf()
337 static BigInteger shift(BigInteger k, int n) { in shift()
344 static BigInteger scale(BigInteger k, int n) { in scale()
348 BigInteger adj_k = shift(k, n+1).add(big1); in scale()
363 public synchronized BigInteger get_appr(int precision) { in get_appr()
368 BigInteger result = approximate(precision); in get_appr()
503 BigInteger this_appr = get_appr(needed_prec); in compareTo()
504 BigInteger x_appr = x.get_appr(needed_prec); in compareTo()
540 BigInteger this_appr = get_appr(needed_prec); in signum()
586 BigInteger scaled_result = new BigInteger(whole + fraction, radix); in valueOf()
587 BigInteger divisor = BigInteger.valueOf(radix).pow(fraction.length()); in valueOf()
603 BigInteger scale_factor = BigInteger.valueOf(radix).pow(n); in toString()
606 BigInteger scaled_int = scaled_CR.get_appr(0); in toString()
664 BigInteger big_radix = BigInteger.valueOf(radix); in toStringFloatRep()
684 BigInteger scaled_int = scaled_res.get_appr(0); in toStringFloatRep()
707 public BigInteger BigIntegerValue() { in BigIntegerValue()
888 BigInteger rough_appr = get_appr(low_prec); in exp()
920 BigInteger halfpi_multiples = divide(PI).get_appr(-1); in cos()
921 BigInteger abs_halfpi_multiples = halfpi_multiples.abs(); in cos()
924 BigInteger pi_multiples = scale(halfpi_multiples, -1); in cos()
951 BigInteger rough_appr = get_appr(-10); in asin()
969 static final BigInteger low_ln_limit = big8; /* sixteenths, i.e. 1/2 */
970 static final BigInteger high_ln_limit =
971 BigInteger.valueOf(16 + 8 /* 1.5 */);
972 static final BigInteger scaled_4 =
973 BigInteger.valueOf(4*16);
980 BigInteger rough_appr = get_appr(low_prec); /* In sixteenths */ in ln()
1023 public synchronized BigInteger get_appr(int precision) { in get_appr()
1030 BigInteger result = approximate(eval_prec); in get_appr()
1042 BigInteger value;
1043 int_CR(BigInteger n) { in int_CR()
1046 protected BigInteger approximate(int p) { in approximate()
1059 protected BigInteger approximate(int p) { in approximate()
1076 protected BigInteger approximate(int p) { in approximate()
1092 protected BigInteger approximate(int p) { in approximate()
1103 protected BigInteger approximate(int p) { in approximate()
1123 protected BigInteger approximate(int p) { in approximate()
1126 BigInteger op1_appr = op1.get_appr(p-1); in approximate()
1127 BigInteger op2_appr = op2.get_appr(p-1); in approximate()
1128 BigInteger diff = op1_appr.subtract(op2_appr).abs(); in approximate()
1153 protected BigInteger approximate(int p) { in approximate()
1181 BigInteger appr2 = op2.get_appr(prec2); in approximate()
1185 BigInteger appr1 = op1.get_appr(prec1); in approximate()
1196 protected BigInteger approximate(int p) { in approximate()
1216 BigInteger dividend = big1.shiftLeft(log_scale_factor); in approximate()
1217 BigInteger scaled_divisor = op.get_appr(prec_needed); in approximate()
1218 BigInteger abs_scaled_divisor = scaled_divisor.abs(); in approximate()
1219 BigInteger adj_dividend = dividend.add( in approximate()
1222 BigInteger result = adj_dividend.divide(abs_scaled_divisor); in approximate()
1240 protected BigInteger approximate(int p) { in approximate()
1251 BigInteger op_appr = op.get_appr(op_prec); in approximate()
1257 BigInteger scaled_1 = big1.shiftLeft(-calc_precision); in approximate()
1258 BigInteger current_term = scaled_1; in approximate()
1259 BigInteger current_sum = scaled_1; in approximate()
1261 BigInteger max_trunc_error = in approximate()
1268 current_term = current_term.divide(BigInteger.valueOf(n)); in approximate()
1282 protected BigInteger approximate(int p) { in approximate()
1293 BigInteger op_appr = op.get_appr(op_prec); in approximate()
1299 BigInteger current_term; in approximate()
1301 BigInteger max_trunc_error = in approximate()
1305 BigInteger current_sum = current_term; in approximate()
1312 BigInteger divisor = BigInteger.valueOf(-n) in approximate()
1313 .multiply(BigInteger.valueOf(n-1)); in approximate()
1327 protected BigInteger approximate(int p) { in approximate()
1342 BigInteger scaled_1 = big1.shiftLeft(-calc_precision); in approximate()
1343 BigInteger big_op = BigInteger.valueOf(op); in approximate()
1344 BigInteger big_op_squared = BigInteger.valueOf(op*op); in approximate()
1345 BigInteger op_inverse = scaled_1.divide(big_op); in approximate()
1346 BigInteger current_power = op_inverse; in approximate()
1347 BigInteger current_term = op_inverse; in approximate()
1348 BigInteger current_sum = op_inverse; in approximate()
1351 BigInteger max_trunc_error = in approximate()
1359 current_power.divide(BigInteger.valueOf(current_sign*n)); in approximate()
1378 protected BigInteger approximate(int p) { in approximate()
1388 BigInteger op_appr = op.get_appr(op_prec); in approximate()
1390 BigInteger x_nth = scale(op_appr, op_prec - calc_precision); in approximate()
1391 BigInteger current_term = x_nth; // x**n in approximate()
1392 BigInteger current_sum = current_term; in approximate()
1395 BigInteger max_trunc_error = in approximate()
1402 current_term = x_nth.divide(BigInteger.valueOf(n * current_sign)); in approximate()
1417 protected BigInteger approximate(int p) { in approximate()
1441 BigInteger op_appr = op.get_appr(op_prec); in approximate()
1453 BigInteger max_last_term = in approximate()
1456 BigInteger current_term = op_appr.shiftLeft(op_prec - calc_precision); in approximate()
1457 BigInteger current_sum = current_term; in approximate()
1458 BigInteger current_factor = current_term; in approximate()
1472 current_factor = current_factor.multiply(BigInteger.valueOf(exp - 2)); in approximate()
1477 BigInteger divisor = BigInteger.valueOf(exp - 1); in approximate()
1484 current_term = current_factor.divide(BigInteger.valueOf(exp)); in approximate()
1500 sqrt_CR(CR x, int min_p, BigInteger max_a) { in sqrt_CR()
1510 protected BigInteger approximate(int p) { in approximate()
1524 BigInteger op_appr = op.get_appr(prod_prec); in approximate()
1525 BigInteger last_appr = get_appr(appr_prec); in approximate()
1528 BigInteger prod_prec_scaled_numerator = in approximate()
1530 BigInteger scaled_numerator = in approximate()
1532 BigInteger shifted_result = scaled_numerator.divide(last_appr); in approximate()
1539 BigInteger scaled_bi_appr = op.get_appr(op_prec) in approximate()
1545 BigInteger scaled_sqrt = BigInteger.valueOf((long)scaled_fp_sqrt); in approximate()
1572 ArrayList<BigInteger> b_val = new ArrayList<BigInteger>();
1577 private static BigInteger TOLERANCE = BigInteger.valueOf(4);
1581 protected BigInteger approximate(int p) { in approximate()
1588 if (p >= 0) return scale(BigInteger.valueOf(3), -p); in approximate()
1597 BigInteger a = BigInteger.ONE.shiftLeft(-eval_prec); in approximate()
1598 BigInteger b = SQRT_HALF.get_appr(eval_prec); in approximate()
1599 BigInteger t = BigInteger.ONE.shiftLeft(-eval_prec - 2); in approximate()
1604 final BigInteger next_a = a.add(b).shiftRight(1); in approximate()
1605 final BigInteger next_b; in approximate()
1606 final BigInteger a_diff = a.subtract(next_a); in approximate()
1607 final BigInteger b_prod = a.multiply(b).shiftRight(-eval_prec); in approximate()
1619 final BigInteger scaled_next_b = scale(next_b, -extra_eval_prec); in approximate()
1634 final BigInteger next_t = in approximate()
1642 final BigInteger sum = a.add(b); in approximate()
1643 final BigInteger result = sum.multiply(sum).divide(t).shiftRight(2); in approximate()