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 < -1: return 'domain'
        if x == -1: return '-1'
        if x == 0: return '0'
        result=x/(math.sqrt(1+x)+1)
        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('tiny positive', solve(N*2.0**-60), render(N*2.0**-61))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-61))
check('normal', solve(3.0), "1")
check('endpoint', solve(-1.0), "-1")
check('domain', solve(-2.0), "domain")
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('large', solve(1e300), render(1e150))
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 < -1: return 'domain'
        if x == -1: return '-1'
        if x == 0: return '-0'
        result=x/(math.sqrt(1+x)+1)
        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('tiny positive', solve(N*2.0**-60), render(N*2.0**-61))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-61))
check('normal', solve(3.0), "1")
check('endpoint', solve(-1.0), "-1")
check('domain', solve(-2.0), "domain")
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('large', solve(1e300), render(1e150))
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:
Square-root increment loses the sign of exact negative zero.

Evaluate sqrt(1+x)-1 stably for finite x >= -1. 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 < -1: return 'domain'
        if x == -1: return '-1'
        if x == 0: return render(x)
        result=x/(math.sqrt(1+x)-1)
        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('tiny positive', solve(N*2.0**-60), render(N*2.0**-61))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-61))
check('normal', solve(3.0), "1")
check('endpoint', solve(-1.0), "-1")
check('domain', solve(-2.0), "domain")
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('large', solve(1e300), render(1e150))
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 < -1: return 'domain'
        if x == -1: return '-1'
        if x == 0: return render(x)
        result=x/(math.sqrt(abs(x))+1)
        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('tiny positive', solve(N*2.0**-60), render(N*2.0**-61))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-61))
check('normal', solve(3.0), "1")
check('endpoint', solve(-1.0), "-1")
check('domain', solve(-2.0), "domain")
check('negative zero', solve(-0.0), "-0")
check('positive zero', solve(0.0), "0")
check('large', solve(1e300), render(1e150))
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:
Rationalized square-root increment uses the wrong conjugate.

Evaluate sqrt(1+x)-1 stably for finite x >= -1. 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 '-infinity'
        if x < -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(1-math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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 '-infinity'
        if x < -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(max(1-math.exp(x),1e-300))
        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('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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:
Complementary log exponentials subtract near unity.

Evaluate log(1-exp(x)) for x <= 0; zero maps to negative infinity. Choose a cancellation-safe formula on either side of -log(2). 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 '-infinity'
        if x < -math.log(2):
            result=math.log(1-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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 '-infinity'
        if x < -math.log(2):
            result=0.0 if x < -40 else math.log(1-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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:
Complementary log exponentials lose the distant tail.

Evaluate log(1-exp(x)) for x <= 0; zero maps to negative infinity. Choose a cancellation-safe formula on either side of -log(2). 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 '-infinity'
        if x > -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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 '-infinity'
        if x < 0:
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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:
Complementary log exponentials select unstable branches.

Evaluate log(1-exp(x)) for x <= 0; zero maps to negative infinity. Choose a cancellation-safe formula on either side of -log(2). 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'
        if x < -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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 'domain'
        if x < -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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:
Complementary logarithm assigns a finite value at zero.

Evaluate log(1-exp(x)) for x <= 0; zero maps to negative infinity. Choose a cancellation-safe formula on either side of -log(2). 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: x=-x
        if x==0: return '-infinity'
        if x < -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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 'nan'
        if x==0: return '-infinity'
        if x < -math.log(2):
            result=math.log1p(-math.exp(x))
        else:
            result=math.log(-math.expm1(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('near zero', solve(-N*2.0**-60), render(math.log(N*2.0**-60)))
check('far tail', solve(-50.0-N), render(-math.exp(-50.0-N)))
check('midpoint', solve(-math.log(2)), render(math.log(0.5)))
check('moderate', solve(-1.0), render(math.log1p(-math.exp(-1))))
check('boundary', solve(0.0), "-infinity")
check('invalid', solve(float(N)), "domain")
check('negative zero', solve(-0.0), "-infinity")
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:
Complementary logarithm reflects positive input into its domain.

Evaluate log(1-exp(x)) for x <= 0; zero maps to negative infinity. Choose a cancellation-safe formula on either side of -log(2). 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:
            result=math.log1p(math.exp(x))
        else:
            result=math.log1p(math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
            result=math.log1p(math.exp(min(x,700)))
        else:
            result=math.log1p(math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
Softplus materializes a large positive exponential.

Evaluate log(1+exp(x)) without overflowing or erasing a small positive tail. 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:
            result=x+math.log1p(math.exp(-x))
        else:
            result=math.log(1+math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
            result=x+math.log1p(math.exp(-x))
        else:
            result=0.0 if x < -40 else math.log(1+math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
Softplus adds one before taking the logarithm.

Evaluate log(1+exp(x)) without overflowing or erasing a small positive tail. 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:
            result=x+math.log1p(math.exp(-x))
        else:
            result=math.log1p(math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
            result=x+math.log1p(math.exp(-x))
        else:
            result=math.log1p(math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
Softplus evaluates the wrong stabilized branch.

Evaluate log(1+exp(x)) without overflowing or erasing a small positive tail. 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:
            result=math.log1p(math.exp(-x))
        else:
            result=math.log1p(math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
            result=x
        else:
            result=math.log1p(math.exp(x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
Positive softplus drops its linear asymptote.

Evaluate log(1+exp(x)) without overflowing or erasing a small positive tail. 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:
            result=x+math.log1p(math.exp(-x))
        else:
            result=math.log1p(math.exp(-x))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
            result=x+math.log1p(math.exp(-x))
        else:
            result=math.log1p(math.exp(abs(x)))
        return render(result)
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive huge', solve(1000.0*N), render(1000.0*N))
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), render(math.log(2)))
check('positive moderate', solve(float(N)), render(math.log1p(math.exp(float(N)))))
check('negative moderate', solve(-float(N)), render(math.log1p(math.exp(-float(N)))))
check('small positive', solve(N*1e-8), render(math.log1p(math.exp(N*1e-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:
Negative softplus uses a reflected exponential.

Evaluate log(1+exp(x)) without overflowing or erasing a small positive tail. 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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(-x)
            result=z/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(min(-x,700))
            result=z/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
Sigmoid exponentiates the large magnitude of a negative input.

Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. 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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(x)
            result=1-1/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(x)
            result=max(0.0,1-1/(1+z))
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
Sigmoid computes its negative tail as a complement.

Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. 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:
            z=math.exp(-x)
            result=z/(1+z)
        else:
            z=math.exp(x)
            result=z/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
            z=math.exp(-x)
            result=1-z
        else:
            z=math.exp(x)
            result=z/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
Sigmoid reuses the negative-branch numerator on positive inputs.

Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. 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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(x)
            result=z/z
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(x)
            result=z
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
Sigmoid omits one from the negative-branch normalizer.

Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. 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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(x)
            result=z/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
            z=math.exp(-x)
            result=1/(1+z)
        else:
            z=math.exp(x)
            result=z/(1+z)
        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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-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:
Sigmoid sends large inputs to the overflowing branch.

Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. 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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log((1+a)/(1-a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log(max((1+a)/(1-a),1.0))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse tangent loses tiny input in a logarithmic ratio.

Evaluate inverse hyperbolic tangent on [-1,1], with signed infinite endpoints and a domain marker outside. 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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1-a))
        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('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1-a))
        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('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse tangent drops odd symmetry.

Evaluate inverse hyperbolic tangent on [-1,1], with signed infinite endpoints and a domain marker outside. 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 abs(x)>1: return 'domain'
        if x==1: return '0'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1-a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 abs(x)>1: return 'domain'
        if x==1: return 'domain'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1-a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse tangent replaces positive pole with zero.

Evaluate inverse hyperbolic tangent on [-1,1], with signed infinite endpoints and a domain marker outside. 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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '+infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1-a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return 'domain'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1-a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse tangent assigns the wrong sign at its negative pole.

Evaluate inverse hyperbolic tangent on [-1,1], with signed infinite endpoints and a domain marker outside. 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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=0.5*math.log1p(2*a/(1+a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 abs(x)>1: return 'domain'
        if x==1: return '+infinity'
        if x==-1: return '-infinity'
        if x==0: return render(x)
        a=abs(x)
        result=math.log1p(a)
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny positive', solve(N*2.0**-60), render(N*2.0**-60))
check('tiny negative', solve(-N*2.0**-60), render(-N*2.0**-60))
check('normal', solve(0.125*N), render(math.atanh(0.125*N)))
check('negative normal', solve(-0.125*N), render(math.atanh(-0.125*N)))
check('positive endpoint', solve(1.0), "+infinity")
check('negative endpoint', solve(-1.0), "-infinity")
check('invalid', solve(1.0+N), "domain")
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse tangent uses one plus magnitude in its rationalization.

Evaluate inverse hyperbolic tangent on [-1,1], with signed infinite endpoints and a domain marker outside. 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:
        a=abs(x)
        if a<1e-8: return render(math.log(x+math.sqrt(1+x*x)))
        if a>1e150:
            result=math.log(a)+math.log(2)
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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:
        a=abs(x)
        if a<1e-8: return "0"
        if a>1e150:
            result=math.log(a)+math.log(2)
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse sine uses a cancellation-prone logarithm for tiny inputs.

Evaluate inverse hyperbolic sine for finite binary64 values with tiny-value preservation and a large-value logarithmic branch. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(a+math.sqrt(1+a*a))
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(min(a+math.sqrt(1+a*a),1e308))
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse sine squares a huge magnitude before taking its logarithm.

Evaluate inverse hyperbolic sine for finite binary64 values with tiny-value preservation and a large-value logarithmic branch. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(a)
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=2*math.log(a)
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse sine omits the large-input factor of two.

Evaluate inverse hyperbolic sine for finite binary64 values with tiny-value preservation and a large-value logarithmic branch. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(a)+math.log(2)
        else:
            result=math.log1p(a+a*a/(math.sqrt(1+a*a)))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(a)+math.log(2)
        else:
            result=math.log1p(a+a*a/(1+a))
        return render(math.copysign(result,x))
    except (ValueError, OverflowError, ZeroDivisionError, TypeError):
        return "arithmetic-error"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse sine rationalizes with the wrong square-root denominator.

Evaluate inverse hyperbolic sine for finite binary64 values with tiny-value preservation and a large-value logarithmic branch. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(a)+math.log(2)
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(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('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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:
        a=abs(x)
        if a<1e-8: return render(x)
        if a>1e150:
            result=math.log(a)+math.log(2)
        else:
            result=math.log1p(a+a*a/(1+math.sqrt(1+a*a)))
        return render(-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('tiny', solve(N*2.0**-60), render(N*2.0**-60))
check('negative tiny', solve(-N*2.0**-60), render(-N*2.0**-60))
check('large', solve(N*1e300), render(math.asinh(N*1e300)))
check('negative large', solve(-N*1e300), render(math.asinh(-N*1e300)))
check('normal', solve(float(N)), render(math.asinh(N)))
check('negative normal', solve(-float(N)), render(math.asinh(-N)))
check('negative zero', solve(-0.0), "-0")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Inverse sine loses the sign in the magnitude branch.

Evaluate inverse hyperbolic sine for finite binary64 values with tiny-value preservation and a large-value logarithmic branch. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(x)+math.log(2)
        else:
            t=x-1
            result=math.log(x+math.sqrt(x*x-1))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(x)+math.log(2)
        else:
            t=x-1
            result=math.log(x+math.sqrt(max(x*x-1,0)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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:
Inverse cosine forms x squared minus one near its branch point.

Evaluate inverse hyperbolic cosine for finite x>=1. Use logarithmic scaling for huge inputs and a log1p expression near one. 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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(x+math.sqrt(x*x-1))
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*(x+1)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(min(x+math.sqrt(x*x-1),1e308))
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*(x+1)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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:
Inverse cosine overflows while squaring a finite input.

Evaluate inverse hyperbolic cosine for finite x>=1. Use logarithmic scaling for huge inputs and a log1p expression near one. 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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(x)
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*(x+1)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(2)*math.log(x)
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*(x+1)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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:
Inverse cosine forgets the factor of two at large magnitude.

Evaluate inverse hyperbolic cosine for finite x>=1. Use logarithmic scaling for huge inputs and a log1p expression near one. 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<1: return 'domain'
        if x==1: return 'domain'
        if x>1e150:
            result=math.log(x)+math.log(2)
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*(x+1)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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<1: return 'domain'
        if x==1: return '-infinity'
        if x>1e150:
            result=math.log(x)+math.log(2)
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*(x+1)))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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:
Inverse cosine rejects its finite branch point.

Evaluate inverse hyperbolic cosine for finite x>=1. Use logarithmic scaling for huge inputs and a log1p expression near one. 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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(x)+math.log(2)
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t*t))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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<1: return 'domain'
        if x==1: return '0'
        if x>1e150:
            result=math.log(x)+math.log(2)
        else:
            t=x-1
            result=math.log1p(t+math.sqrt(t))
        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('fixed near one', solve(1+2.0**-50), render(math.acosh(1+2.0**-50)))
check('near one', solve(1+N*2.0**-50), render(math.acosh(1+N*2.0**-50)))
check('huge', solve(N*1e300), render(math.acosh(N*1e300)))
check('normal', solve(1.0+N), render(math.acosh(1.0+N)))
check('endpoint', solve(1.0), "0")
check('invalid', solve(0.0), "domain")
check('negative', solve(-float(N)), "domain")
check('mid', solve(1.5), render(math.acosh(1.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:
Inverse cosine rationalization omits the x plus one factor.

Evaluate inverse hyperbolic cosine for finite x>=1. Use logarithmic scaling for huge inputs and a log1p expression near one. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.

split: open-access