![]() |
Raven Engine v0.1
|
Classes | |
| struct | CosCoeffs |
| Polynomial coefficient table for cosine approximations on [-pi/4, pi/4]. More... | |
| struct | CosCoeffs< 5 > |
| Degree-5 cosine: cos(x) ~= c0 + c2*x^2 + c4*x^4. More... | |
| struct | CosCoeffs< 7 > |
| Degree-7 cosine: cos(x) ~= c0 + c2*x^2 + c4*x^4 + c6*x^6. More... | |
| struct | CosCoeffs< 9 > |
| Degree-9 cosine: cos(x) ~= c0 + c2*x^2 + c4*x^4 + c6*x^6 + c8*x^8. More... | |
| struct | SinCoeffs |
| Polynomial coefficient table for sine approximations on [-pi/4, pi/4]. More... | |
| struct | SinCoeffs< 5 > |
| Degree-5 sine: sin(x) ~= c1*x + c3*x^3 + c5*x^5. More... | |
| struct | SinCoeffs< 7 > |
| Degree-7 sine: sin(x) ~= c1*x + c3*x^3 + c5*x^5 + c7*x^7. More... | |
| struct | SinCoeffs< 9 > |
| Degree-9 sine: sin(x) ~= c1*x + c3*x^3 + c5*x^5 + c7*x^7 + c9*x^9. More... | |
Enumerations | |
| enum class | PrecisionMode { Fast , Standard , High } |
| Precision modes for selecting polynomial degree. More... | |
Functions | |
| template<PrecisionMode Mode> | |
| constexpr float | PolySin (float x) |
| Dispatch to the appropriate degree-xx sine polynomial. | |
| template<PrecisionMode Mode> | |
| constexpr float | PolyCos (float x) |
| Dispatch to the appropriate degree-xx cosine polynomial. | |
| template<int Degree> | |
| constexpr float | PolySinImpl (float x) |
| Generic Estrin-based sine polynomial of degree D on x in [-pi/4,pi/4]. | |
| template<> | |
| float | PolySinImpl< 5 > (float x) |
| template<> | |
| float | PolySinImpl< 7 > (float x) |
| template<> | |
| float | PolySinImpl< 9 > (float x) |
| template<int Degree> | |
| constexpr float | PolyCosImpl (float x) |
| Generic Estrin-based cosine polynomial of degree D on x in [-pi/4,pi/4]. | |
| template<> | |
| float | PolyCosImpl< 5 > (float x) |
| template<> | |
| float | PolyCosImpl< 7 > (float x) |
| template<> | |
| float | PolyCosImpl< 9 > (float x) |
Local constants for range reduction (float) | |
| void | ReduceAngle (float x, float &outXr, unsigned int &outQuad) noexcept |
| Reduce angle into [-pi/4, pi/4] and extract quadrant. | |
|
strong |
|
inlineconstexpr |
Dispatch to the appropriate degree-xx cosine polynomial.
| Mode | Desired precision mode. |
| x | Input in [-pi/4, pi/4]. |
|
inlineconstexpr |
Generic Estrin-based cosine polynomial of degree D on x in [-pi/4,pi/4].
| Degree | Polynomial degree (must be even: 5,7,9). |
| x | Reduced input in [-pi/4,pi/4]. |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Dispatch to the appropriate degree-xx sine polynomial.
| Mode | Desired precision mode. |
| x | Input in [-pi/4, pi/4]. |
|
inlineconstexpr |
Generic Estrin-based sine polynomial of degree D on x in [-pi/4,pi/4].
| Degree | Polynomial degree (must be odd: 5,7,9). |
| x | Reduced input in [-pi/4,pi/4]. |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
Reduce angle into [-pi/4, pi/4] and extract quadrant.
1) Scale x by 2/pi to get k. 2) Round k to nearest int without branches. 3) Subtract k*(pi/2) using two-step FMA (hi then lo). 4) Compute quadrant = k mod 4.
| x | Input angle in radians. |
| outXr | [out] Reduced angle in [-pi/4, pi/4]. |
| outQuad | [out] Quadrant index in {0,1,2,3}. |
The caller uses outQuad to decide sine vs cosine and sign.