summaryrefslogtreecommitdiffstats
path: root/mpi/logtab.h
blob: a4b2d04f678a0a582ece1b55f79a8a399ddeec00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * A table of the logs of 2 for various bases (the 0 and 1 entries of
 * this table are meaningless and should not be referenced).
 *
 * This table is used to compute output lengths for the mp_toradix()
 * function.  Since a number n in radix r takes up about log_r(n)
 * digits, we estimate the output size by taking the least integer
 * greater than log_r(n), where:
 *
 * log_r(n) = log_2(n) * log_r(2)
 *
 * This table, therefore, is a table of log_r(2) for 2 <= r <= 36,
 * which are the output bases supported.
 */

const double s_logv_2[] = {
  0.000000000, 0.000000000, 1.000000000, 0.630929754,
  0.500000000, 0.430676558, 0.386852807, 0.356207187,
  0.333333333, 0.315464877, 0.301029996, 0.289064826,
  0.278942946, 0.270238154, 0.262649535, 0.255958025,
  0.250000000, 0.244650542, 0.239812467, 0.235408913,
  0.231378213, 0.227670249, 0.224243824, 0.221064729,
  0.218104292, 0.215338279, 0.212746054, 0.210309918,
  0.208014598, 0.205846832, 0.203795047, 0.201849087,
  0.200000000, 0.198239863, 0.196561632, 0.194959022,
  0.193426404, 0.191958720, 0.190551412, 0.189200360,
  0.187901825, 0.186652411, 0.185449023, 0.184288833,
  0.183169251, 0.182087900, 0.181042597, 0.180031327,
  0.179052232, 0.178103594, 0.177183820, 0.176291434,
  0.175425064, 0.174583430, 0.173765343, 0.172969690,
  0.172195434, 0.171441601, 0.170707280, 0.169991616,
  0.169293808, 0.168613099, 0.167948779, 0.167300179,
  0.166666667
};