{"abstract":"Same-sign interpolation adds endpoints before weighting.","category":"Floating-point arithmetic","checks":10,"contract":"Interpolate finite a and b at t in [0,1], preserving endpoints and avoiding overflow in a difference or an endpoint sum. Return domain marker outside the interval. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-lerp","failed_approach":"The attempted local correction result=(a+b)/2 still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-lerp-sum-overflow","id":"FA-16686","implementations":{"attempt":{"sha256":"203587bfda8095e867e958126de1cef4d3ac732260416dd589d21f1b9c5bcc94","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(a,b,t):\n    try:\n        if not 0<=t<=1: return 'domain'\n        if t==0: return render(a)\n        if t==1: return render(b)\n        if (a<=0<=b) or (b<=0<=a):\n            result=(1-t)*a+t*b\n        else:\n            result=(a+b)/2\n        result=min(max(a,b),max(min(a,b),result))\n        return render(result)\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('opposite asymmetric', solve(-float(N),float(N),0.25), render(-N/2))\ncheck('opposite extremes', solve(-1e308,1e308,0.5), \"0\")\ncheck('same extremes', solve(1e308,1.5e308,0.5), render(1.25e308))\ncheck('first endpoint', solve(-0.0,float(N),0.0), \"-0\")\ncheck('last endpoint', solve(float(N),-0.0,1.0), \"-0\")\ncheck('increasing', solve(float(N),float(N+8),0.25), render(N+2))\ncheck('decreasing', solve(float(N+8),float(N),0.25), render(N+6))\ncheck('negative same sign', solve(-float(N+8),-float(N),0.25), render(-N-6))\ncheck('outside', solve(float(N),float(N+8),1.5), \"domain\")\ncheck('tiny blend', solve(N*1e-300,3*N*1e-300,0.5), render(2*N*1e-300))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"43ba177ba0be34b6688d498fe46dc97d2f3ee59ad7069b25bf57e8a0f8c896e3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(a,b,t):\n    try:\n        if not 0<=t<=1: return 'domain'\n        if t==0: return render(a)\n        if t==1: return render(b)\n        if (a<=0<=b) or (b<=0<=a):\n            result=(1-t)*a+t*b\n        else:\n            result=((1-t)*(a+b)+t*(a+b))/2\n        result=min(max(a,b),max(min(a,b),result))\n        return render(result)\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('opposite asymmetric', solve(-float(N),float(N),0.25), render(-N/2))\ncheck('opposite extremes', solve(-1e308,1e308,0.5), \"0\")\ncheck('same extremes', solve(1e308,1.5e308,0.5), render(1.25e308))\ncheck('first endpoint', solve(-0.0,float(N),0.0), \"-0\")\ncheck('last endpoint', solve(float(N),-0.0,1.0), \"-0\")\ncheck('increasing', solve(float(N),float(N+8),0.25), render(N+2))\ncheck('decreasing', solve(float(N+8),float(N),0.25), render(N+6))\ncheck('negative same sign', solve(-float(N+8),-float(N),0.25), render(-N-6))\ncheck('outside', solve(float(N),float(N+8),1.5), \"domain\")\ncheck('tiny blend', solve(N*1e-300,3*N*1e-300,0.5), render(2*N*1e-300))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"7bba9214b3973ac4980ab464b751f476a070ab000f3d7b17449065c0764f5c1b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(a,b,t):\n    try:\n        if not 0<=t<=1: return 'domain'\n        if t==0: return render(a)\n        if t==1: return render(b)\n        if (a<=0<=b) or (b<=0<=a):\n            result=(1-t)*a+t*b\n        else:\n            result=a+t*(b-a)\n        result=min(max(a,b),max(min(a,b),result))\n        return render(result)\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('opposite asymmetric', solve(-float(N),float(N),0.25), render(-N/2))\ncheck('opposite extremes', solve(-1e308,1e308,0.5), \"0\")\ncheck('same extremes', solve(1e308,1.5e308,0.5), render(1.25e308))\ncheck('first endpoint', solve(-0.0,float(N),0.0), \"-0\")\ncheck('last endpoint', solve(float(N),-0.0,1.0), \"-0\")\ncheck('increasing', solve(float(N),float(N+8),0.25), render(N+2))\ncheck('decreasing', solve(float(N+8),float(N),0.25), render(N+6))\ncheck('negative same sign', solve(-float(N+8),-float(N),0.25), render(-N-6))\ncheck('outside', solve(float(N),float(N+8),1.5), \"domain\")\ncheck('tiny blend', solve(N*1e-300,3*N*1e-300,0.5), render(2*N*1e-300))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Controlled binary64 or explicitly stipulated miniature format; no hardware exception flags or platform floating environment are modeled. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-floating_point_arithmetic-lerp-sum-overflow","generated_at":"2026-09-29T14:39:38.704989+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline floating representation model isolates a reproducible arithmetic fault.","repair":"Apply the contract at this fault site using result=a+t*(b-a).","root_cause":"Same-sign interpolation adds endpoints before weighting. The faulty expression is result=((1-t)*(a+b)+t*(a+b))/2.","sha256":"c56fa48a70725b586a5cd1daf200ab6ff5e50654b2faed483c14580a4fa977d1","title":"Same-sign interpolation adds endpoints before weighting · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.473,"exit_code":1,"observations":[{"actual":"-0.5","check":"opposite asymmetric","expected":"-0.5","passed":true},{"actual":"0","check":"opposite extremes","expected":"0","passed":true},{"actual":"1.5e+308","check":"same extremes","expected":"1.25e+308","passed":false},{"actual":"-0","check":"first endpoint","expected":"-0","passed":true},{"actual":"-0","check":"last endpoint","expected":"-0","passed":true},{"actual":"5","check":"increasing","expected":"3","passed":false},{"actual":"5","check":"decreasing","expected":"7","passed":false},{"actual":"-5","check":"negative same sign","expected":"-7","passed":false},{"actual":"domain","check":"outside","expected":"domain","passed":true},{"actual":"2e-300","check":"tiny blend","expected":"2e-300","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opposite asymmetric\", \"actual\": \"-0.5\", \"expected\": \"-0.5\", \"passed\": true}, {\"check\": \"opposite extremes\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"same extremes\", \"actual\": \"1.5e+308\", \"expected\": \"1.25e+308\", \"passed\": false}, {\"check\": \"first endpoint\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"last endpoint\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"increasing\", \"actual\": \"5\", \"expected\": \"3\", \"passed\": false}, {\"check\": \"decreasing\", \"actual\": \"5\", \"expected\": \"7\", \"passed\": false}, {\"check\": \"negative same sign\", \"actual\": \"-5\", \"expected\": \"-7\", \"passed\": false}, {\"check\": \"outside\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}, {\"check\": \"tiny blend\", \"actual\": \"2e-300\", \"expected\": \"2e-300\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.866,"exit_code":1,"observations":[{"actual":"-0.5","check":"opposite asymmetric","expected":"-0.5","passed":true},{"actual":"0","check":"opposite extremes","expected":"0","passed":true},{"actual":"1.5e+308","check":"same extremes","expected":"1.25e+308","passed":false},{"actual":"-0","check":"first endpoint","expected":"-0","passed":true},{"actual":"-0","check":"last endpoint","expected":"-0","passed":true},{"actual":"5","check":"increasing","expected":"3","passed":false},{"actual":"5","check":"decreasing","expected":"7","passed":false},{"actual":"-5","check":"negative same sign","expected":"-7","passed":false},{"actual":"domain","check":"outside","expected":"domain","passed":true},{"actual":"2e-300","check":"tiny blend","expected":"2e-300","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opposite asymmetric\", \"actual\": \"-0.5\", \"expected\": \"-0.5\", \"passed\": true}, {\"check\": \"opposite extremes\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"same extremes\", \"actual\": \"1.5e+308\", \"expected\": \"1.25e+308\", \"passed\": false}, {\"check\": \"first endpoint\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"last endpoint\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"increasing\", \"actual\": \"5\", \"expected\": \"3\", \"passed\": false}, {\"check\": \"decreasing\", \"actual\": \"5\", \"expected\": \"7\", \"passed\": false}, {\"check\": \"negative same sign\", \"actual\": \"-5\", \"expected\": \"-7\", \"passed\": false}, {\"check\": \"outside\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}, {\"check\": \"tiny blend\", \"actual\": \"2e-300\", \"expected\": \"2e-300\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.432,"exit_code":0,"observations":[{"actual":"-0.5","check":"opposite asymmetric","expected":"-0.5","passed":true},{"actual":"0","check":"opposite extremes","expected":"0","passed":true},{"actual":"1.25e+308","check":"same extremes","expected":"1.25e+308","passed":true},{"actual":"-0","check":"first endpoint","expected":"-0","passed":true},{"actual":"-0","check":"last endpoint","expected":"-0","passed":true},{"actual":"3","check":"increasing","expected":"3","passed":true},{"actual":"7","check":"decreasing","expected":"7","passed":true},{"actual":"-7","check":"negative same sign","expected":"-7","passed":true},{"actual":"domain","check":"outside","expected":"domain","passed":true},{"actual":"2e-300","check":"tiny blend","expected":"2e-300","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opposite asymmetric\", \"actual\": \"-0.5\", \"expected\": \"-0.5\", \"passed\": true}, {\"check\": \"opposite extremes\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"same extremes\", \"actual\": \"1.25e+308\", \"expected\": \"1.25e+308\", \"passed\": true}, {\"check\": \"first endpoint\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"last endpoint\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"increasing\", \"actual\": \"3\", \"expected\": \"3\", \"passed\": true}, {\"check\": \"decreasing\", \"actual\": \"7\", \"expected\": \"7\", \"passed\": true}, {\"check\": \"negative same sign\", \"actual\": \"-7\", \"expected\": \"-7\", \"passed\": true}, {\"check\": \"outside\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}, {\"check\": \"tiny blend\", \"actual\": \"2e-300\", \"expected\": \"2e-300\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}