FA-16336 / Floating-point arithmetic / Open access
Sinc series uses x instead of x squared · case 01
Sinc series uses x instead of x squared.
ROOT CAUSE
Sinc series uses x instead of x squared. The faulty expression is t=x.
VERIFIED REPAIR
Apply the contract at this fault site using t=x*x.
Unsuccessful approach: The attempted local correction t=abs(x) 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
result=1-t/6+t*t/120
else:
result=math.sin(x)/x
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.99998333342 | 0.99999999833 | Failed |
| negative small | 1.0000166668 | 0.99999999833 | Failed |
| normal | 0.84147098481 | 0.84147098481 | Passed |
| negative normal | 0.84147098481 | 0.84147098481 | Passed |
| phase crossing | -0.038166599453 | -0.038166599453 | Passed |
SHA-256 / 153ceb66e821eea4aeb9ef2e5322ae2cddf86680da702dfaabbb716eec7d7c9a
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=abs(x)
result=1-t/6+t*t/120
else:
result=math.sin(x)/x
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.99998333342 | 0.99999999833 | Failed |
| negative small | 0.99998333342 | 0.99999999833 | Failed |
| normal | 0.84147098481 | 0.84147098481 | Passed |
| negative normal | 0.84147098481 | 0.84147098481 | Passed |
| phase crossing | -0.038166599453 | -0.038166599453 | Passed |
SHA-256 / a71c16c4565c67c01b66700cebad83fb2002339663cbebff91ba284972257d29
3 / The verified repair
Exit 0"""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)/x
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.038166599453 | -0.038166599453 | Passed |
SHA-256 / ae22c0a2889ac818972e70cc72be1b702de4e30ecdff2ffa50f781c55900d8e9
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.358147+00:00.
Case digest / d73f4db646a46af539af16286ef0451d306a0edb5889a9dd6c416372cb4a5b05