1.4.3.16 _LIBQ_Q2_29_acos_Q31_Fast Function
Calculates the value of acos(x). This function executes faster than _LIBQ_Q2_29_acos_Q31 but is less precise.
Description
_Q2_29 _LIBQ_Q2_29_acos_Q31_Fast (_Q31 x);
Calculates the acos(x), where x is of type _Q31 and the resulting value is of type _Q2_29. The output value will be radians in the range pi >= result >= -pi.
Preconditions
None.
Parameters
x The _Q31 input value from which to calculate acos(x).
Returns
_LIBQ_Q2_29_acos_Q31_Fast returns the _Q2_29 fixed point result from the calculation acos(x).
Remarks
The function _LIBQ_Q2_29_asin_Q31_Fast is called by this routine and thus must be linked into the executable image.
Execution Time (cycles): 517 typical (32 to 1310)
Program Memory 28 bytes
Error <= 0.000000911 (accurate to 9 least significant _Q2_29 bits)
A higher precision function with reduced performance exists, see _LIBQ_Q2_29_acos_Q31
Example
_Q2_29 resultAcos; resultAcos = _LIBQ_Q2_29_acos_Q31_Fast ((_Q31)0xee63708c); _//_ __LIBQ_Q2_29_acos_Q31_Fast(-0.1375903431) = 1.7088244837 (0x36aeb0af)_
C
_Q2_29 _LIBQ_Q2_29_acos_Q31_Fast (_Q31 x );