broken_source:
"""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>=1023: return '+infinity'
        if x<=-1075: return '0'
        k=math.floor(x)
        f=x-k
        mantissa=2.0**f
        result=math.ldexp(mantissa,k)
        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('integer', solve(float(N)), render(2.0**N))
check('negative integer', solve(-float(N)), render(2.0**(-N)))
check('fraction', solve(N+0.5), render(2.0**(N+0.5)))
check('large finite', solve(1023.0), render(2.0**1023))
check('small subnormal', solve(-1074.0), render(math.ldexp(1.0,-1074)))
check('subnormal half above', solve(-1074.5), render(math.ldexp(1.0,-1074)))
check('underflow midpoint', solve(-1075.0), "0")
check('overflow', solve(1024.0), "+infinity")
check('negative fraction', solve(-N-0.5), render(2.0**(-N-0.5)))
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)

source:
"""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>=1024: return '1e+308'
        if x<=-1075: return '0'
        k=math.floor(x)
        f=x-k
        mantissa=2.0**f
        result=math.ldexp(mantissa,k)
        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('integer', solve(float(N)), render(2.0**N))
check('negative integer', solve(-float(N)), render(2.0**(-N)))
check('fraction', solve(N+0.5), render(2.0**(N+0.5)))
check('large finite', solve(1023.0), render(2.0**1023))
check('small subnormal', solve(-1074.0), render(math.ldexp(1.0,-1074)))
check('subnormal half above', solve(-1074.5), render(math.ldexp(1.0,-1074)))
check('underflow midpoint', solve(-1075.0), "0")
check('overflow', solve(1024.0), "+infinity")
check('negative fraction', solve(-N-0.5), render(2.0**(-N-0.5)))
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)

prompt:
Base-two exponential overflows the highest finite power.

Compute 2**x for finite x by separating its integer exponent from a bounded fractional exponential. Values x>=1024 return positive infinity; x<=-1075 return positive zero under nearest-even rounding. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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>=1024: return '+infinity'
        if x<=-1075: return '0'
        k=math.floor(x)
        f=k-x
        mantissa=2.0**f
        result=math.ldexp(mantissa,k)
        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('integer', solve(float(N)), render(2.0**N))
check('negative integer', solve(-float(N)), render(2.0**(-N)))
check('fraction', solve(N+0.5), render(2.0**(N+0.5)))
check('large finite', solve(1023.0), render(2.0**1023))
check('small subnormal', solve(-1074.0), render(math.ldexp(1.0,-1074)))
check('subnormal half above', solve(-1074.5), render(math.ldexp(1.0,-1074)))
check('underflow midpoint', solve(-1075.0), "0")
check('overflow', solve(1024.0), "+infinity")
check('negative fraction', solve(-N-0.5), render(2.0**(-N-0.5)))
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""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>=1024: return '+infinity'
        if x<=-1075: return '0'
        k=math.floor(x)
        f=abs(x)-k
        mantissa=2.0**f
        result=math.ldexp(mantissa,k)
        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('integer', solve(float(N)), render(2.0**N))
check('negative integer', solve(-float(N)), render(2.0**(-N)))
check('fraction', solve(N+0.5), render(2.0**(N+0.5)))
check('large finite', solve(1023.0), render(2.0**1023))
check('small subnormal', solve(-1074.0), render(math.ldexp(1.0,-1074)))
check('subnormal half above', solve(-1074.5), render(math.ldexp(1.0,-1074)))
check('underflow midpoint', solve(-1075.0), "0")
check('overflow', solve(1024.0), "+infinity")
check('negative fraction', solve(-N-0.5), render(2.0**(-N-0.5)))
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)

prompt:
Split base-two exponential reverses its fractional residual.

Compute 2**x for finite x by separating its integer exponent from a bounded fractional exponential. Values x>=1024 return positive infinity; x<=-1075 return positive zero under nearest-even rounding. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

source:
"""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 render(x)
        m,e=math.frexp(-abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

prompt:
Cube root feeds a negative value to a fractional power.

Real cube root on finite binary64 inputs. Split magnitude with frexp, divide exponent by three with floor division, and apply residual exponent before rooting. Return signed zero unchanged. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 render(x)
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=m**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

source:
"""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 render(x)
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(m*r)**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

prompt:
Cube root discards the residual exponent modulo three.

Real cube root on finite binary64 inputs. Split magnitude with frexp, divide exponent by three with floor division, and apply residual exponent before rooting. Return signed zero unchanged. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 render(x)
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,-q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

source:
"""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 render(x)
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,e)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

prompt:
Cube root rescales by the negated exponent quotient.

Real cube root on finite binary64 inputs. Split magnitude with frexp, divide exponent by three with floor division, and apply residual exponent before rooting. Return signed zero unchanged. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 render(x)
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

source:
"""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 render(x)
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

prompt:
Cube root returns the magnitude for negative inputs.

Real cube root on finite binary64 inputs. Split magnitude with frexp, divide exponent by three with floor division, and apply residual exponent before rooting. Return signed zero unchanged. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 "0"
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

source:
"""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 "-0"
        m,e=math.frexp(abs(x))
        q,r=divmod(e,3)
        root=(math.ldexp(m,r))**(1/3)
        result=math.ldexp(root,q)
        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('integer cube', solve(float(N**3)), render(float(N)))
check('negative cube', solve(-float(N**3)), render(-float(N)))
check('huge', solve(1e300), "1e+100")
check('tiny', solve(1e-300), "1e-100")
check('power remainder', solve(16.0), render(16.0**(1/3)))
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-358)))
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)

prompt:
Cube root canonicalizes negative zero.

Real cube root on finite binary64 inputs. Split magnitude with frexp, divide exponent by three with floor division, and apply residual exponent before rooting. Return signed zero unchanged. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 'domain'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(m)
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

source:
"""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 'domain'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(m)*r
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

prompt:
Scaled square root drops the odd exponent remainder.

Nonnegative square root of finite binary64 x via exponent normalization. Negative input returns domain; negative zero is preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 'domain'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,e))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

source:
"""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 'domain'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,-q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

prompt:
Scaled square root applies the full exponent to its root.

Nonnegative square root of finite binary64 x via exponent normalization. Negative input returns domain; negative zero is preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '0'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

source:
"""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: x=abs(x)
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

prompt:
Scaled square root clamps a negative operand to zero.

Nonnegative square root of finite binary64 x via exponent normalization. Negative input returns domain; negative zero is preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 'domain'
        if x==0: return "0"
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

source:
"""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 'domain'
        if x==0: return "-0"
        m,e=math.frexp(x)
        q,r=divmod(e,2)
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

prompt:
Scaled square root loses negative zero.

Nonnegative square root of finite binary64 x via exponent normalization. Negative input returns domain; negative zero is preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 'domain'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=(e+1)//2,e%2
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

source:
"""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 'domain'
        if x==0: return render(x)
        m,e=math.frexp(x)
        q,r=abs(e)//2,e%2
        root=math.sqrt(math.ldexp(m,r))
        return render(math.ldexp(root,q))
    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('square', solve(float(N*N)), render(float(N)))
check('normal', solve(float(N)), render(math.sqrt(N)))
check('huge', solve(1e300), "1e+150")
check('tiny', solve(1e-300), "1e-150")
check('odd exponent', solve(2.0), render(math.sqrt(2)))
check('positive root zero', solve(0.0), "0")
check('negative domain', solve(-float(N)), "domain")
check('negative zero', solve(-0.0), "-0")
check('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))
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)

prompt:
Scaled square root rounds the exponent quotient upward.

Nonnegative square root of finite binary64 x via exponent normalization. Negative input returns domain; negative zero is preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '-infinity' if x<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

source:
"""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 '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

prompt:
Reciprocal classifies negative zero through numerical comparison.

Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,abs(e))
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

prompt:
Reciprocal retains the input exponent sign.

Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1-m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

prompt:
Reciprocal rescales the original mantissa without inversion.

Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        return render(math.copysign(0.0 if result<2.0**-1022 else 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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        return render(math.copysign(max(result,2.0**-1022),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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

prompt:
Reciprocal flushes subnormal results.

Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity' if x<0 else '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

prompt:
Reciprocal drops sign after magnitude normalization.

Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '+infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

source:
"""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 '-infinity' if math.copysign(1.0,x)<0 else '+infinity'
        m,e=math.frexp(abs(x))
        fraction=1/m
        try:
            result=math.ldexp(fraction,-e)
        except OverflowError:
            return '-infinity'
        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('positive ordinary', solve(float(N)), render(1/N))
check('negative ordinary', solve(-float(N)), render(-1/N))
check('huge', solve(1e308), render(1e-308))
check('negative huge', solve(-1e308), render(-1e-308))
check('tiny overflow', solve(math.ldexp(1.0,-1074)), "+infinity")
check('negative tiny', solve(-math.ldexp(1.0,-1074)), "-infinity")
check('positive zero', solve(0.0), "+infinity")
check('negative zero', solve(-0.0), "-infinity")
check('fraction', solve(0.125), "8")
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)

prompt:
Reciprocal overflow always reports a positive infinity.

Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.exp(x)*c
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=min(math.exp(x),1e308)*c
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential materializes its overflowing common real exponential.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=math.exp(x)*s
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=min(math.exp(x),1e308)*s
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential materializes overflow before its imaginary projection.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x/k if k else x
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential subtracts a binary exponent as though natural.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*s,k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*abs(c),k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential uses the sine for its real projection.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*c,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*abs(s),k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential uses cosine for its imaginary projection.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,-k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=scale*c
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential reverses the rescaling exponent.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=scale*s
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=math.sin(y)
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*s,-k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential rescales only its real component.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(abs(y)); s=math.sin(abs(y))
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

source:
"""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,y):
    try:
        k=math.floor(x/math.log(2))
        f=x-k*math.log(2)
        scale=math.exp(f)
        c=math.cos(y); s=abs(math.sin(y))
        real=math.ldexp(scale*c,k)
        imag=math.ldexp(scale*s,k)
        return [render(real),render(imag)]
    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('overflowing common factor', solve(710.0,math.pi/4), [render(math.exp(710-math.log(2))*(2*math.cos(math.pi/4))),render(math.exp(710-math.log(2))*(2*math.sin(math.pi/4)))])
check('negative real projection', solve(float(N),2.0), [render(math.exp(N)*math.cos(2)),render(math.exp(N)*math.sin(2))])
check('ordinary', solve(float(N),0.25), [render(math.exp(N)*math.cos(0.25)),render(math.exp(N)*math.sin(0.25))])
check('negative phase', solve(float(N),-0.25), [render(math.exp(N)*math.cos(-0.25)),render(math.exp(N)*math.sin(-0.25))])
check('negative real', solve(-float(N),0.25), [render(math.exp(-N)*math.cos(0.25)),render(math.exp(-N)*math.sin(0.25))])
check('negative zero phase', solve(float(N),-0.0), [render(math.exp(N)),"-0"])
check('zero', solve(0.0,0.0), ["1","0"])
check('tiny common factor', solve(-744.0,0.25), [render(math.exp(-744)*math.cos(0.25)),render(math.exp(-744)*math.sin(0.25))])
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)

prompt:
Complex exponential discards the sign of its phase.

Compute exp(x+iy) for finite components using binary exponent splitting. Fixtures keep each final component finite or zero, including cases where exp(x) alone overflows. Return two rendered components; exact trigonometric zeros are preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access


broken_source:
"""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,y):
    try:
        if y==0: return 'domain'
        ay=abs(y)
        r=x%ay
        a=abs(r)
        other=ay-a
        odd=math.fmod(abs(x),2*ay)>=ay
        if a>other or (a==other and odd):
            r-=math.copysign(ay,x)
        if r==0: r=math.copysign(0.0,x)
        return render(r)
    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('even tie', solve(2.0*N*4+2,4.0), "2")
check('odd tie', solve((2.0*N+1)*4+2,4.0), "-2")
check('negative even tie', solve(-2.0*N*4-2,4.0), "-2")
check('negative odd tie', solve(-(2.0*N+1)*4-2,4.0), "2")
check('above half', solve(4.0*N+3,4.0), "-1")
check('below half', solve(4.0*N+1,4.0), "1")
check('negative divisor below half', solve(4.0*N+1,-4.0), "1")
check('negative divisor', solve(4.0*N+3,-4.0), "-1")
check('negative exact', solve(-4.0*N,4.0), "-0")
check('positive exact', solve(4.0*N,4.0), "0")
check('zero divisor', solve(float(N),0.0), "domain")
check('huge finite', solve(1.5e308,1e308), render(math.remainder(1.5e308,1e308)))
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)

source:
"""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,y):
    try:
        if y==0: return 'domain'
        ay=abs(y)
        r=abs(math.fmod(x,ay))
        a=abs(r)
        other=ay-a
        odd=math.fmod(abs(x),2*ay)>=ay
        if a>other or (a==other and odd):
            r-=math.copysign(ay,x)
        if r==0: r=math.copysign(0.0,x)
        return render(r)
    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('even tie', solve(2.0*N*4+2,4.0), "2")
check('odd tie', solve((2.0*N+1)*4+2,4.0), "-2")
check('negative even tie', solve(-2.0*N*4-2,4.0), "-2")
check('negative odd tie', solve(-(2.0*N+1)*4-2,4.0), "2")
check('above half', solve(4.0*N+3,4.0), "-1")
check('below half', solve(4.0*N+1,4.0), "1")
check('negative divisor below half', solve(4.0*N+1,-4.0), "1")
check('negative divisor', solve(4.0*N+3,-4.0), "-1")
check('negative exact', solve(-4.0*N,4.0), "-0")
check('positive exact', solve(4.0*N,4.0), "0")
check('zero divisor', solve(float(N),0.0), "domain")
check('huge finite', solve(1.5e308,1e308), render(math.remainder(1.5e308,1e308)))
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)

prompt:
Nearest floating remainder starts from floor-modulo residue.

For finite x and finite nonzero y, return the remainder x-n*y with n the nearest integer quotient, ties to even. The output has magnitude at most abs(y)/2; exact zero has the sign of x. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access