FAILURE MAP
← Case archive

FA-15931 / Floating-point arithmetic / Open access

ULP uses the exponent of the next binade · case 01

ULP uses the exponent of the next binade.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

ULP uses the exponent of the next binade. The faulty expression is e=max(e-52,-1074).

VERIFIED REPAIR

Apply the contract at this fault site using e=max(e-53,-1074).

Unsuccessful approach: The attempted local correction e=max(e-54,-1074) still violates the explicit regression fixtures.

Case contract

Return a finite binary64 ulp as a hex string; NaN maps to nan and either infinity maps to infinity. For subnormals and zero the ulp is the minimum positive subnormal.

Why this case matters

An offline floating representation model isolates a reproducible arithmetic fault.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
N = 1
observations = []
def solve(bits):
    x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]
    if math.isnan(x): return 'nan'
    if math.isinf(x): return 'infinity'
    x=abs(x)
    if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()
    m,e=math.frexp(x)
    e=max(e-52,-1074)
    return math.ldexp(1.0,e).hex()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0), '0x0.0000000000001p-1022')
check('negative zero', solve(1<<63), '0x0.0000000000001p-1022')
check('subnormal', solve(N), '0x0.0000000000001p-1022')
check('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())
check('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())
check('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())
check('infinity', solve(0x7ff0000000000000), 'infinity')
check('nan', solve(0x7ff8000000000000|N), 'nan')
check('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
zero0x0.0000000000001p-10220x0.0000000000001p-1022Passed
negative zero0x0.0000000000001p-10220x0.0000000000001p-1022Passed
subnormal0x0.0000000000001p-10220x0.0000000000001p-1022Passed
power boundary0x1.0000000000000p-500x1.0000000000000p-51Failed
negative power0x1.0000000000000p-500x1.0000000000000p-51Failed
below power0x1.0000000000000p-510x1.0000000000000p-52Failed
infinityinfinityinfinityPassed
nannannanPassed
maximum0x1.0000000000000p+9720x1.0000000000000p+971Failed

SHA-256 / 075c8814c8c02f386f5e1f1134346601dd99c780d5a501867ba2148e25e6992d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
N = 1
observations = []
def solve(bits):
    x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]
    if math.isnan(x): return 'nan'
    if math.isinf(x): return 'infinity'
    x=abs(x)
    if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()
    m,e=math.frexp(x)
    e=max(e-54,-1074)
    return math.ldexp(1.0,e).hex()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0), '0x0.0000000000001p-1022')
check('negative zero', solve(1<<63), '0x0.0000000000001p-1022')
check('subnormal', solve(N), '0x0.0000000000001p-1022')
check('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())
check('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())
check('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())
check('infinity', solve(0x7ff0000000000000), 'infinity')
check('nan', solve(0x7ff8000000000000|N), 'nan')
check('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
zero0x0.0000000000001p-10220x0.0000000000001p-1022Passed
negative zero0x0.0000000000001p-10220x0.0000000000001p-1022Passed
subnormal0x0.0000000000001p-10220x0.0000000000001p-1022Passed
power boundary0x1.0000000000000p-520x1.0000000000000p-51Failed
negative power0x1.0000000000000p-520x1.0000000000000p-51Failed
below power0x1.0000000000000p-530x1.0000000000000p-52Failed
infinityinfinityinfinityPassed
nannannanPassed
maximum0x1.0000000000000p+9700x1.0000000000000p+971Failed

SHA-256 / 74d19462b8b8ff76bdbcc331b69fa752f4dbdc3bf47f060921f2923e9522f5ab

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
N = 1
observations = []
def solve(bits):
    x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]
    if math.isnan(x): return 'nan'
    if math.isinf(x): return 'infinity'
    x=abs(x)
    if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()
    m,e=math.frexp(x)
    e=max(e-53,-1074)
    return math.ldexp(1.0,e).hex()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0), '0x0.0000000000001p-1022')
check('negative zero', solve(1<<63), '0x0.0000000000001p-1022')
check('subnormal', solve(N), '0x0.0000000000001p-1022')
check('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())
check('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())
check('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())
check('infinity', solve(0x7ff0000000000000), 'infinity')
check('nan', solve(0x7ff8000000000000|N), 'nan')
check('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
zero0x0.0000000000001p-10220x0.0000000000001p-1022Passed
negative zero0x0.0000000000001p-10220x0.0000000000001p-1022Passed
subnormal0x0.0000000000001p-10220x0.0000000000001p-1022Passed
power boundary0x1.0000000000000p-510x1.0000000000000p-51Passed
negative power0x1.0000000000000p-510x1.0000000000000p-51Passed
below power0x1.0000000000000p-520x1.0000000000000p-52Passed
infinityinfinityinfinityPassed
nannannanPassed
maximum0x1.0000000000000p+9710x1.0000000000000p+971Passed

SHA-256 / 2d845f1224db3a884bf6208ebd3d50326ec5c32e26c953c914127acaad9dc1f2

Verification & scope

Controlled binary64 or explicitly stipulated miniature format; no hardware exception flags or platform floating environment are modeled. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:39:31.492566+00:00.

Case digest / ae51f0995369a522f3c8e86a9b9aa9c4eaf066a2c6f92ed6f048e8abab847b71