|
Epstein Zeta Library 0.6.2
Calculates the Epstein Zeta function
|
High-precision dyadic number operations. More...

Go to the source code of this file.
Classes | |
| struct | hpdyad_t |
| Fixed-size high-precision dyadic number (hpdyad) with separate sign and binary exponent. More... | |
Macros | |
| #define | HPDYAD_MAX_LIMBS 32 |
| Maximum number of 32-bit limbs in fixed-size representation (1024 bits total). | |
Functions | |
| unsigned | ctz64 (unsigned long long x) |
| Count trailing zero bits in a 64-bit unsigned integer. | |
| int | msb32 (unsigned int x) |
| Find index of most significant bit in a 32-bit unsigned integer. | |
| void | hpdyad_set_ull (hpdyad_t *a, unsigned long long x, signed char sign) |
| Initialize hpdyad from unsigned long long with sign. | |
| void | hpdyad_normalize (hpdyad_t *a) |
| Normalize hpdyad: trim leading zeros and left-shift mantissa so MSB of top limb is 1. | |
| void | hpdyad_mul (hpdyad_t *out, const hpdyad_t *a, const hpdyad_t *b) |
| Multiply two high precision dyadic numbers (hpdyad's): out = a * b. | |
| void | hpdyad_shr_bits_sticky (hpdyad_t *dst, const hpdyad_t *src, unsigned int bits) |
| Right-shift mantissa with sticky bit (value-preserving) | |
| void | hpdyad_shl_bits (hpdyad_t *dst, const hpdyad_t *src, int bits) |
| Left-shift mantissa by specified number of bits (value-preserving) | |
| void | hpdyad_add (hpdyad_t *out, const hpdyad_t *a, const hpdyad_t *b) |
| Add two high precision dyadic numbers (hpdyad's): out = a + b. | |
| double | hpdyad_to_double (const hpdyad_t *a) |
| Convert hpdyad to double with round-to-nearest-even. | |
High-precision dyadic number operations.
| unsigned ctz64 | ( | unsigned long long | x | ) |
Count trailing zero bits in a 64-bit unsigned integer.
| [in] | x | input value |
Add two high precision dyadic numbers (hpdyad's): out = a + b.
| [out] | out | result (supports aliasing) |
| [in] | a | first operand |
| [in] | b | second operand |
Multiply two high precision dyadic numbers (hpdyad's): out = a * b.
| [out] | out | result (may alias a or b) |
| [in] | a | first operand |
| [in] | b | second operand |
| void hpdyad_normalize | ( | hpdyad_t * | a | ) |
Normalize hpdyad: trim leading zeros and left-shift mantissa so MSB of top limb is 1.
| [in,out] | a | pointer to hpdyad to normalize |
| void hpdyad_set_ull | ( | hpdyad_t * | a, |
| unsigned long long | x, | ||
| signed char | sign ) |
Initialize hpdyad from unsigned long long with sign.
| [out] | a | destination hpdyad |
| [in] | x | unsigned integer value |
| [in] | sign | +1 or -1 |
Left-shift mantissa by specified number of bits (value-preserving)
| [out] | dst | destination hpdyad |
| [in] | src | source hpdyad |
| [in] | bits | number of bits to shift left |
Right-shift mantissa with sticky bit (value-preserving)
Shifts mantissa right by bits, increments exp2 by bits to preserve value. Any 1-bit shifted out ORs into bit 0 (sticky). Does NOT normalize.
| [out] | dst | destination hpdyad |
| [in] | src | source hpdyad |
| [in] | bits | number of bits to shift right |
| double hpdyad_to_double | ( | const hpdyad_t * | a | ) |
Convert hpdyad to double with round-to-nearest-even.
| [in] | a | pointer to normalized hpdyad |
| int msb32 | ( | unsigned int | x | ) |
Find index of most significant bit in a 32-bit unsigned integer.
| [in] | x | input value |