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 af54ddad5.
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 roundingf32machine over the same IR the GPU receives. Everyf32-typed operation rounds tof32after 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 727, at commit af54ddad5