CpuPrecision
Type in CPU oracle
How the CPU backends evaluate f32 arithmetic.
import type { CpuPrecision } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
type CpuPrecision = 'f64' | 'f32';Description
'f64'(default): every value is a JavaScript double, so the result is the mathematically intended one to 53 bits. This is the reference an implementation is checked against.'f32': a correctly rounding f32 machine over the same IR the GPU receives. Every f32-typed operation rounds to f32 after it is evaluated, with ±Infinity on overflow. Use it when the question is what the target computes, so a parity gate can compare at ulp scale without a tolerance wide enough to hide a real error.
See also
Source
src/core/oracle.ts, line 718, at commit 26de7be8