FA-16246 / Floating-point arithmetic / Open access
Inverse sine rationalizes with the wrong square-root denominator · case 01
Inverse sine rationalizes with the wrong square-root denominator.
ROOT CAUSE
Inverse sine rationalizes with the wrong square-root denominator. The faulty expression is result=math.log1p(a+a*a/(math.sqrt(1+a*a))).
VERIFIED REPAIR
Apply the contract at this fault site using result=math.log1p(a+a*a/(1+math.sqrt(1+a*a))).
Unsuccessful approach: The attempted local correction result=math.log1p(a+a*a/(1+a)) still violates the explicit regression fixtures.
Case contract
Evaluate inverse hyperbolic sine for finite binary64 values with tiny-value preservation and a large-value logarithmic branch. 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:
a=abs(x)
if a<1e-8: return render(x)
if a>1e150:
result=math.log(a)+math.log(2)
else:
result=math.log1p(a+a*a/(math.sqrt(1+a*a)))
return render(math.copysign(result,x))
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('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
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 |
|---|---|---|---|
| tiny | 8.6736173799e-19 | 8.6736173799e-19 | Passed |
| negative tiny | -8.6736173799e-19 | -8.6736173799e-19 | Passed |
| large | 691.46867508 | 691.46867508 | Passed |
| negative large | -691.46867508 | -691.46867508 | Passed |
| normal | 0.99588045617 | 0.88137358702 | Failed |
| negative normal | -0.99588045617 | -0.88137358702 | Failed |
| negative zero | -0 | -0 | Passed |
SHA-256 / 07c2ddbd0f4e01f5579a8cd5db6d0f8d0908882c1232b2e6b863f41e6ff95aa3
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:
a=abs(x)
if a<1e-8: return render(x)
if a>1e150:
result=math.log(a)+math.log(2)
else:
result=math.log1p(a+a*a/(1+a))
return render(math.copysign(result,x))
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('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
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 |
|---|---|---|---|
| tiny | 8.6736173799e-19 | 8.6736173799e-19 | Passed |
| negative tiny | -8.6736173799e-19 | -8.6736173799e-19 | Passed |
| large | 691.46867508 | 691.46867508 | Passed |
| negative large | -691.46867508 | -691.46867508 | Passed |
| normal | 0.91629073187 | 0.88137358702 | Failed |
| negative normal | -0.91629073187 | -0.88137358702 | Failed |
| negative zero | -0 | -0 | Passed |
SHA-256 / 1577e9fb84c1bc9ddd14e01e623626b61619fa0c5a5344e75b7137c8251e8148
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:
a=abs(x)
if a<1e-8: return render(x)
if a>1e150:
result=math.log(a)+math.log(2)
else:
result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
return render(math.copysign(result,x))
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('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
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 |
|---|---|---|---|
| tiny | 8.6736173799e-19 | 8.6736173799e-19 | Passed |
| negative tiny | -8.6736173799e-19 | -8.6736173799e-19 | Passed |
| large | 691.46867508 | 691.46867508 | Passed |
| negative large | -691.46867508 | -691.46867508 | Passed |
| normal | 0.88137358702 | 0.88137358702 | Passed |
| negative normal | -0.88137358702 | -0.88137358702 | Passed |
| negative zero | -0 | -0 | Passed |
SHA-256 / 63b2caefba5e573952c603b31c9fbd968c653bd31fa97b5a6acc0ceaedc2a138
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:34.673819+00:00.
Case digest / 3d14b4fffe1660089347681d117aae9bf590f26b4ef58342795c0da44e8dede3