SSumHarrier
Product

Product features · Compensated floating-point sums

01

Trace the running total and correction beside cancellation fixtures so a small addend is not judged from the rounded total alone.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Compensated floating-point sums

● ● ●SumHarrier●
A concrete starting point · Compensated floating-point sums ×
def compensated_sum(values):
    values = tuple(values)
    if len(values) > 1000 or any(type(v) not in (int, float) or
                                not -1e100 <= v <= 1e100 for v in values):
        raise ValueError("values.range")
    total = correction = 0.0
    for value in values:
        value = float(value)
        next_total = total + value
        correction += ((total - next_total) + value if abs(total) >= abs(value)
                       else (value - next_total) + total)
        total = next_total
    return total + correction
✳Sum at most 1000 finite numbers of magnitude at most 1e100 with a compensation term.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗