The Scheme standard provides a rich arithmetic universe. It shuts the programmer away from the binary nature of the platform however. There are algorithms that exploit well the binary nature of modern computers. If b is a large integer it is presumably inefficient to invoke a multi-precision division to compute (/ b (expt 2 n)). Yet it is very efficient for code that has access to the hardware primitives. Computing the Jacobi symbol in Scheme seems to be a (log n)3 algorithm instead of (log n)2 when expressed in official Scheme functions. Not all machines have the same primitives, but the main variation today is whether you have 32 or 64 bit operands at the bottom.
What would access to the raw arithmetic look like in Scheme? First a query concerning the ‘natural arithmetic word length’. Next a request for a package of operators on numbers based on a word length specified by the requestor. Signedness is a problem since some hardware may have a slight preference for signed over unsigned, or conversely. Some algorithms benefit from signed operands but for initial simplicity I will decree unsigned here for now, for that is the most frequent tool for multi-precision arithmetic. There are algorithms that use most, but not all of the bits of a binary word in that they weight super digits by a factor smaller than the word size. I think that that does not bear on the choice of primitives.
I propose that (pa n) return a list of the primitive functions modulo 2n. For this note a ‘smint’ is a small integer k, 0≤k<2n. Operands of the defined operations must be smints, or pairs thereof. If (a . b) is a pair then f((a . b)) = 2na + b. Most of the standard arithmetic operations naturally yield two word answers which we package here as a pair of smints and by ‘pair’ on this page, we a pair of smints. We speak below as if such a pair represented a number k such that 0≤k<22n but that is merely a convenient way of specifying the exact semantics of the functions. Some higher algorithms use these primitives without that interpretation.