// Generated by EML-lang WGSL backend (function library) // Source module: clamp_bounded // Source file: /home/monogate/monogate/forge/examples/clamp_bounded.eml // Functions: 1 // Constants: 2 // // Float32-only. EML `Real` and `f64` lower to WGSL `f32`. // WebGPU has no native f64; f16 is an optional extension // (`enable f16;`). If you need >32-bit precision, do the // high-precision step on CPU and ship a float32 result. // // No entry point is provided; this is a function library. // Validate with `naga ` or include in your own // vertex / fragment / compute shader and call from there. const LO: f32 = (-1.0); const HI: f32 = 1.0; // clamp_unit // Pfaffian profile: chain_order=0, cost_class=p0-d2-w0-c0, drift_risk=LOW. // forge.ensures: (result >= LO) // forge.ensures: (result <= HI) // forge.verify: lean theorem=clamp_in_unit_interval fn clamp_unit(x: f32) -> f32 { return clamp(x, LO, HI); }