mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Added bx::sinCosApprox bench.
This commit is contained in:
@@ -162,7 +162,7 @@ namespace bx
|
||||
return _a * _a;
|
||||
}
|
||||
|
||||
inline void sinCosApprox(float _a, float* _outSinApprox, float* _outCos)
|
||||
inline void sinCosApprox(float& _outSinApprox, float& _outCos, float _a)
|
||||
{
|
||||
const float aa = _a - floor(_a*kInvPi2)*kPi2;
|
||||
const float absA = abs(aa);
|
||||
@@ -172,8 +172,8 @@ namespace bx
|
||||
const float tmp1 = aa > 0.0f && aa < kPi ? 1.0f : -1.0f;
|
||||
const float sinA = mul(tmp0, tmp1);
|
||||
|
||||
*_outSinApprox = sinA;
|
||||
*_outCos = cosA;
|
||||
_outSinApprox = sinA;
|
||||
_outCos = cosA;
|
||||
}
|
||||
|
||||
inline BX_CONST_FUNC float sin(float _a)
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace bx
|
||||
/// @remarks The function calculates cosine, and then approximates sine based on the cosine
|
||||
/// result. Therefore calculation of sine is less accurate than calling `bx::sin` function.
|
||||
///
|
||||
void sinCosApprox(float _a, float* _outSinApprox, float* _outCos);
|
||||
void sinCosApprox(float& _outSinApprox, float& _outCos, float _a);
|
||||
|
||||
/// Returns the sine of the argument _a.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user