pub fn f32_to_f16(f: f32) -> u16
Convert an f32 to a 16-bit half-precision float (IEEE 754 binary16). This is a pure-Rust implementation with no external dependency.