Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

sinq

trig.sinq
pub fn sinq(x: f128, y: f128, iy: i32) f128

File

lib/compiler_rt/trig.zig:205

Code

pub fn sinq(x: f128, y: f128, iy: i32) f128 {
    const S1: f128 = -0.16666666666666666666666666666666666606732416116558;
    const S2: f128 = 0.0083333333333333333333333333333331135404851288270047;
    const S3: f128 = -0.00019841269841269841269841269839935785325638310428717;
    const S4: f128 = 0.27557319223985890652557316053039946268333231205686e-5;
    const S5: f128 = -0.25052108385441718775048214826384312253862930064745e-7;
    const S6: f128 = 0.16059043836821614596571832194524392581082444805729e-9;
    const S7: f128 = -0.76471637318198151807063387954939213287488216303768e-12;
    const S8: f128 = 0.28114572543451292625024967174638477283187397621303e-14;
    const S9: f64 = -0.82206352458348947812512122163446202498005154296863e-17;
    const S10: f64 = 0.19572940011906109418080609928334380560135358385256e-19;
    const S11: f64 = -0.38680813379701966970673724299207480965452616911420e-22;
    const S12: f64 = 0.64038150078671872796678569586315881020659912139412e-25;

    const z = x * x;
    const v = z * x;
    const r = S2 + z * (S3 + z * (S4 + z * (S5 + z * (S6 + z * (S7 + z * (S8 +
        z * (S9 + z * (S10 + z * (S11 + z * S12)))))))));

    if (iy == 0)
        return x + v * (S1 + z * r);

    return x - ((z * (0.5 * y - v * r) - y) - v * S1);
}