/* CONSTANTS DEFINING THE FLOATING POINT FORMAT. */
typedefdouble xsum_flt; /* C floating point type sums are done for */
typedef int64_t xsum_int; /* Signed integer type for a fp value */ typedef uint64_t xsum_uint; /* Unsigned integer type for a fp value */ typedef int_fast16_t xsum_expint; /* Integer type for holding an exponent */
#define XSUM_MANTISSA_BITS 52/* Bits in fp mantissa, excludes implict 1 */ #define XSUM_EXP_BITS 11/* Bits in fp exponent */
#define XSUM_SMALL_CARRY_BITS \
((XSUM_SCHUNK_BITS - 1) - XSUM_MANTISSA_BITS) /* Bits sums can carry into */
#define XSUM_SMALL_CARRY_TERMS \
((1 << XSUM_SMALL_CARRY_BITS) - 1) /* # terms can add before need prop. */
typedefstruct {
xsum_schunk chunk[XSUM_SCHUNKS]; /* Chunks making up small accumulator */
xsum_int Inf; /* If non-zero, +Inf, -Inf, or NaN */
xsum_int NaN; /* If non-zero, a NaN value with payload */ int adds_until_propagate; /* Number of remaining adds before carry */
} xsum_small_accumulator; /* propagation must be done again */
/* CONSTANTS DEFINING THE LARGE ACCUMULATOR FORMAT. */
#define XSUM_LCHUNK_BITS 64/* Bits in chunk of the large accumulator */ typedef uint64_t xsum_lchunk; /* Integer type of large accumulator chunk,
must be EXACTLY 64 bits in size */
#define XSUM_LCOUNT_BITS (64 - XSUM_MANTISSA_BITS) /* # of bits in count */ typedef int_least16_t xsum_lcount; /* Signed int type of counts for large acc.*/
#define XSUM_LCHUNKS \
(1 << (XSUM_EXP_BITS + 1)) /* # of chunks in large accumulator */
typedef uint64_t xsum_used; /* Unsigned type for holding used flags */
typedefstruct {
xsum_lchunk chunk[XSUM_LCHUNKS]; /* Chunks making up large accumulator */
xsum_lcount count[XSUM_LCHUNKS]; /* Counts of # adds remaining for chunks,
or -1 if not used yet or special. */
xsum_used chunks_used[XSUM_LCHUNKS / 64]; /* Bits indicate chunks in use */
xsum_used used_used; /* Bits indicate chunk_used entries not 0 */
xsum_small_accumulator sacc; /* The small accumulator to condense into */
} xsum_large_accumulator;
/* TYPE FOR LENGTHS OF ARRAYS. Must be a signed integer type. Set to ptrdiff_thereontheassumptionthatthiswillbebigenough,but
not unnecessarily big, which seems to be true. */
typedef ptrdiff_t xsum_length;
/* FUNCTIONS FOR EXACT SUMMATION, WITH POSSIBLE DIVISION BY AN INTEGER. */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.