pub fn cosq(x: f128) callconv(.c) f128
pub fn cosq(x: f128) callconv(.c) f128 { const se = ld.signExponent(x) & 0x7fff; if (se == 0x7fff) { return x - x; } if (@abs(x) < trig.pi_4) { if (se < 0x3fff - math.floatMantissaBits(f128)) { // raise inexact if x!=0 return 1.0 + x; } return trig.cosq(x, 0.0); } var y: [2]f128 = undefined; const n = rem_pio2l(f128, x, &y); return switch (n & 3) { 0 => trig.cosq(y[0], y[1]), 1 => -trig.sinq(y[0], y[1], 1), 2 => -trig.cosq(y[0], y[1]), else => trig.sinq(y[0], y[1], 1), }; }