| 1 |
//! Cached exponents for basen values with 80-bit extended floats. |
| 2 |
//! |
| 3 |
//! Exact versions of base**n as an extended-precision float, with both |
| 4 |
//! large and small powers. Use the large powers to minimize the amount |
| 5 |
//! of compounded error. This is used in the Bellerophon algorithm. |
| 6 |
//! |
| 7 |
//! These values were calculated using Python, using the arbitrary-precision |
| 8 |
//! integer to calculate exact extended-representation of each value. |
| 9 |
//! These values are all normalized. |
| 10 |
//! |
| 11 |
//! DO NOT MODIFY: Generated by `etc/bellerophon_table.py` |
| 12 |
|
| 13 |
#![cfg(feature = "compact")] |
| 14 |
#![doc(hidden)] |
| 15 |
|
| 16 |
use crate::bellerophon::BellerophonPowers; |
| 17 |
|
| 18 |
// HIGH LEVEL |
| 19 |
// ---------- |
| 20 |
|
| 21 |
pub const BASE10_POWERS: BellerophonPowers = BellerophonPowers { |
| 22 |
small: &BASE10_SMALL_MANTISSA, |
| 23 |
large: &BASE10_LARGE_MANTISSA, |
| 24 |
small_int: &BASE10_SMALL_INT_POWERS, |
| 25 |
step: BASE10_STEP, |
| 26 |
bias: BASE10_BIAS, |
| 27 |
log2: BASE10_LOG2_MULT, |
| 28 |
log2_shift: BASE10_LOG2_SHIFT, |
| 29 |
}; |
| 30 |
|
| 31 |
// LOW-LEVEL |
| 32 |
// --------- |
| 33 |
|
| 34 |
const BASE10_SMALL_MANTISSA: [u64; 10] = [ |
| 35 |
9223372036854775808, // 10^0 |
| 36 |
11529215046068469760, // 10^1 |
| 37 |
14411518807585587200, // 10^2 |
| 38 |
18014398509481984000, // 10^3 |
| 39 |
11258999068426240000, // 10^4 |
| 40 |
14073748835532800000, // 10^5 |
| 41 |
17592186044416000000, // 10^6 |
| 42 |
10995116277760000000, // 10^7 |
| 43 |
13743895347200000000, // 10^8 |
| 44 |
17179869184000000000, // 10^9 |
| 45 |
]; |
| 46 |
const BASE10_LARGE_MANTISSA: [u64; 66] = [ |
| 47 |
11555125961253852697, // 10^-350 |
| 48 |
13451937075301367670, // 10^-340 |
| 49 |
15660115838168849784, // 10^-330 |
| 50 |
18230774251475056848, // 10^-320 |
| 51 |
10611707258198326947, // 10^-310 |
| 52 |
12353653155963782858, // 10^-300 |
| 53 |
14381545078898527261, // 10^-290 |
| 54 |
16742321987285426889, // 10^-280 |
| 55 |
9745314011399999080, // 10^-270 |
| 56 |
11345038669416679861, // 10^-260 |
| 57 |
13207363278391631158, // 10^-250 |
| 58 |
15375394465392026070, // 10^-240 |
| 59 |
17899314949046850752, // 10^-230 |
| 60 |
10418772551374772303, // 10^-220 |
| 61 |
12129047596099288555, // 10^-210 |
| 62 |
14120069793541087484, // 10^-200 |
| 63 |
16437924692338667210, // 10^-190 |
| 64 |
9568131466127621947, // 10^-180 |
| 65 |
11138771039116687545, // 10^-170 |
| 66 |
12967236152753102995, // 10^-160 |
| 67 |
15095849699286165408, // 10^-150 |
| 68 |
17573882009934360870, // 10^-140 |
| 69 |
10229345649675443343, // 10^-130 |
| 70 |
11908525658859223294, // 10^-120 |
| 71 |
13863348470604074297, // 10^-110 |
| 72 |
16139061738043178685, // 10^-100 |
| 73 |
9394170331095332911, // 10^-90 |
| 74 |
10936253623915059621, // 10^-80 |
| 75 |
12731474852090538039, // 10^-70 |
| 76 |
14821387422376473014, // 10^-60 |
| 77 |
17254365866976409468, // 10^-50 |
| 78 |
10043362776618689222, // 10^-40 |
| 79 |
11692013098647223345, // 10^-30 |
| 80 |
13611294676837538538, // 10^-20 |
| 81 |
15845632502852867518, // 10^-10 |
| 82 |
9223372036854775808, // 10^0 |
| 83 |
10737418240000000000, // 10^10 |
| 84 |
12500000000000000000, // 10^20 |
| 85 |
14551915228366851806, // 10^30 |
| 86 |
16940658945086006781, // 10^40 |
| 87 |
9860761315262647567, // 10^50 |
| 88 |
11479437019748901445, // 10^60 |
| 89 |
13363823550460978230, // 10^70 |
| 90 |
15557538194652854267, // 10^80 |
| 91 |
18111358157653424735, // 10^90 |
| 92 |
10542197943230523224, // 10^100 |
| 93 |
12272733663244316382, // 10^110 |
| 94 |
14287342391028437277, // 10^120 |
| 95 |
16632655625031838749, // 10^130 |
| 96 |
9681479787123295682, // 10^140 |
| 97 |
11270725851789228247, // 10^150 |
| 98 |
13120851772591970218, // 10^160 |
| 99 |
15274681817498023410, // 10^170 |
| 100 |
17782069995880619867, // 10^180 |
| 101 |
10350527006597618960, // 10^190 |
| 102 |
12049599325514420588, // 10^200 |
| 103 |
14027579833653779454, // 10^210 |
| 104 |
16330252207878254650, // 10^220 |
| 105 |
9505457831475799117, // 10^230 |
| 106 |
11065809325636130661, // 10^240 |
| 107 |
12882297539194266616, // 10^250 |
| 108 |
14996968138956309548, // 10^260 |
| 109 |
17458768723248864463, // 10^270 |
| 110 |
10162340898095201970, // 10^280 |
| 111 |
11830521861667747109, // 10^290 |
| 112 |
13772540099066387756, // 10^300 |
| 113 |
]; |
| 114 |
const BASE10_SMALL_INT_POWERS: [u64; 10] = |
| 115 |
[1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000]; |
| 116 |
const BASE10_STEP: i32 = 10; |
| 117 |
const BASE10_BIAS: i32 = 350; |
| 118 |
const BASE10_LOG2_MULT: i64 = 217706; |
| 119 |
const BASE10_LOG2_SHIFT: i32 = 16; |