MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / SinF

Function SinF

rEFIt_UEFI/libeg/FloatLib.cpp:48–72  ·  view source on GitHub ↗

we know sin is odd

Source from the content-addressed store, hash-verified

46
47//we know sin is odd
48float SinF(float X)
49{
50 INTN Period;
51 float X2;
52 float Sign = 1.0f;
53
54 if (X < 0.0f) {
55 X = -X;
56 Sign = -1.0f;
57 }
58 Period = (INTN)(X / PI2);
59 X = X - Period * PI2;
60 if (X > PI) {
61 X = X - PI;
62 Sign *= -1.0f;
63 }
64 if (X > PI5) {
65 X = PI - X;
66 }
67 if (X > PI * 0.25f) {
68 return (Sign*CosF(PI5 - X));
69 }
70 X2 = X * X;
71 return (Sign*(X - X2 * X / 6.0f + X2 * X2 * X / 120.0f));
72}
73
74//we know cos is even
75float CosF(float X)

Callers 3

CosFFunction · 0.85
TanFFunction · 0.85
testSVGFunction · 0.85

Calls 1

CosFFunction · 0.85

Tested by

no test coverage detected