FA-16351 / Floating-point arithmetic / Open access
Sinc folds the denominator along with the periodic numerator · case 01
Sinc folds the denominator along with the periodic numerator.
ROOT CAUSE
Sinc folds the denominator along with the periodic numerator. The faulty expression is result=math.sin(x)/math.remainder(x,2*math.pi).
THE FAILURE
Sinc folds the denominator along with the periodic numerator. The faulty expression is result=math.sin(x)/math.remainder(x,2*math.pi).
Unsuccessful approach: The attempted local correction result=math.sin(x)/math.fmod(x,math.pi) still violates the explicit regression fixtures.
Case contract
Evaluate sin(x)/x on finite x with continuous value one at zero. Tiny values use the fourth-degree even series. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.
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
def render(x):
if math.isnan(x): return 'nan'
if math.isinf(x): return '-infinity' if x<0 else '+infinity'
return format(x,'.11g')
N = 1
observations = []
def solve(x):
try:
if x==0: return '1'
if abs(x)<1e-3:
t=x*x
result=1-t/6+t*t/120
else:
result=math.sin(x)/math.remainder(x,2*math.pi)
return render(result)
except (ValueError, OverflowError, ZeroDivisionError, TypeError):
return "arithmetic-error"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0.0), "1")
check('negative zero', solve(-0.0), "1")
check('small', solve(N*1e-4), render(math.sin(N*1e-4)/(N*1e-4)))
check('negative small', solve(-N*1e-4), render(math.sin(-N*1e-4)/(-N*1e-4)))
check('normal', solve(float(N)), render(math.sin(N)/N))
check('negative normal', solve(-float(N)), render(math.sin(-N)/(-N)))
check('phase crossing', solve(math.pi+0.125*N), render(math.sin(math.pi+0.125*N)/(math.pi+0.125*N)))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero | 1 | 1 | Passed |
| negative zero | 1 | 1 | Passed |
| small | 0.99999999833 | 0.99999999833 | Passed |
| negative small | 0.99999999833 | 0.99999999833 | Passed |
| normal | 0.84147098481 | 0.84147098481 | Passed |
| negative normal | 0.84147098481 | 0.84147098481 | Passed |
| phase crossing | 0.041329654913 | -0.038166599453 | Failed |
SHA-256 / cf6286e15e5dc341e4a3229023c84a1d7cb240c370620462f81befb4fca34a32
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
def render(x):
if math.isnan(x): return 'nan'
if math.isinf(x): return '-infinity' if x<0 else '+infinity'
return format(x,'.11g')
N = 1
observations = []
def solve(x):
try:
if x==0: return '1'
if abs(x)<1e-3:
t=x*x
result=1-t/6+t*t/120
else:
result=math.sin(x)/math.fmod(x,math.pi)
return render(result)
except (ValueError, OverflowError, ZeroDivisionError, TypeError):
return "arithmetic-error"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0.0), "1")
check('negative zero', solve(-0.0), "1")
check('small', solve(N*1e-4), render(math.sin(N*1e-4)/(N*1e-4)))
check('negative small', solve(-N*1e-4), render(math.sin(-N*1e-4)/(-N*1e-4)))
check('normal', solve(float(N)), render(math.sin(N)/N))
check('negative normal', solve(-float(N)), render(math.sin(-N)/(-N)))
check('phase crossing', solve(math.pi+0.125*N), render(math.sin(math.pi+0.125*N)/(math.pi+0.125*N)))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero | 1 | 1 | Passed |
| negative zero | 1 | 1 | Passed |
| small | 0.99999999833 | 0.99999999833 | Passed |
| negative small | 0.99999999833 | 0.99999999833 | Passed |
| normal | 0.84147098481 | 0.84147098481 | Passed |
| negative normal | 0.84147098481 | 0.84147098481 | Passed |
| phase crossing | -0.99739786708 | -0.038166599453 | Failed |
SHA-256 / 98da7c086d02273d3a6b0090b116a032e786531a9caedaa752086b38ba324639
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:35.400742+00:00.
Case digest / 8d503e8621905a67b08346de9c6cf96a5a691c2455bf2aaec98e9a17bc6efe9c