Connection
Base URL, credentials and a reachable server.
Use ulp_distance.py to examine binary64 spacing across zero while keeping representable steps distinct from numerical accuracy.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
import math, struct
def ulp_distance(a, b):
if any(type(x) is not float or not math.isfinite(x) for x in (a, b)):
raise ValueError("ulp.finite")
def key(value):
bits = struct.unpack(">Q", struct.pack(">d", value))[0]
magnitude = bits & ((1 << 63)-1)
return (1 << 63)-magnitude if bits >> 63 else (1 << 63)+magnitude
return abs(key(a)-key(b))