v_sin and v_cos (f32 and f16) take an angle in turns. The whole turns now come off first (x - round_even(x), exact), so a large angle keeps its fraction of a turn instead of losing it when scaled to radians. The sine of a half turn and the cosine of a quarter turn are exactly +0, as the hardware gives; the host's functions of the rounded angle give about 1e-7. A zero operand passes unreduced, so sin(-0) stays -0. float_semantics_are_the_consoles asserts the exact zeros (it failed before this change). The compiler the tests use takes whole turns off itself, so the large-angle path cannot be reached from HLSL and rests on the measurements cited in issue #2. Left from the issue: denormal operands of the legacy multiply, which needs the float mode register as state first. Refs #2 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
0b499d7afd
·
2026-11-24 00:13:19 +01:00
History