fn redupif32(x: f32) f32 x: f3223
24
25
26
27
28
29
30
31
32
33
34
35
36
37fn redupif32(x: f32) f32 {
const DP1 = 3.140625;
const DP2 = 9.67502593994140625e-4;
const DP3 = 1.509957990978376432e-7;
var t = x / math.pi;
if (t >= 0.0) {
t += 0.5;
} else {
t -= 0.5;
}
const u: f32 = @trunc(t);
return ((x - u * DP1) - u * DP2) - u * DP3;
}