Commit Graph

15 Commits

Author SHA1 Message Date
Martin Larralde 6f6284807f
Fix missing function when building without overflow support 2019-09-08 15:28:05 +02:00
Flatmush 85204f4a28 Updated coding style document.
Cleaned up some code.
2012-07-25 14:49:11 +00:00
Flatmush d9944df6d2 Added some deg/rad conversion functions.
Fixed up some code style inconsistencies.
Added a modulo function to allow optimization on 8-bit machines.
2012-07-25 09:54:58 +00:00
vincent.del.medico 5248e45183 Faster atan2 algorithm (about twice faster), same precision 2011-06-09 12:32:50 +00:00
vincent.del.medico 716d5fa179 Added a new algo for sin() function, and a small error analysis to show the precision differences 2011-06-08 22:46:14 +00:00
flatmush 9c8a4f9aa9 Updated 32-bit division so it's now actually accurate to within 0.00065% even for non-reciprocals, the algorithm is slightly slower and slightly less accurate than the 64-bit version on my machine though.
Added 32-bit tan port using joe's atan2_complex algorithm, this is accurate to 0.0055% when used with the new 32-bit divide.
2011-03-01 15:26:37 +00:00
flatmush ae58c98283 Added 32-bit division option, it is less accurate (inaccuracy of ~0.0035%) and very slow (750% of float) but it does work.
Changed tan to be saturated (i.e. tan(pi/4) = fix16_max rather than divide by zero error), may revert or implement as stan later.
2011-02-28 11:24:38 +00:00
flatmush 5dd63f37ce Updated sin lut to use ~200KiB for it's table with the same accuracy, the lookup table implementation tends to run at about 33-36% of the speed of sinf on my machine (Intel T5500).
Fixed a bug in the sin lut code so that the results are always accurate.
Changed fixsingen tool to generate tables correctly for the new implementation.
2011-02-25 16:07:39 +00:00
flatmush 0317f964f4 Added option to replace sin function with ~384KiB look-up table for fastest and most accurate results.
Added tool to generate sin tables.
Tests indicate that using a lut is still ~2.1% out from sinf so it's very possible that our sin function is more accurate than the libmath sinf function on the computer I'm testing with. In which case the accuracy results are offset by that amount.
2011-02-25 15:32:23 +00:00
flatmush 0ecfa08dc3 Added a new faster version of the sin function, it loses 0.2% accuracy for a speed gain of 159%. The accuracy of the standard implementation is ~2.1% while this is ~2.3%.
This can be enabled using the FIXMATH_FAST_SIN macro.
2011-02-25 13:37:37 +00:00
flatmush 8cbe9b3f9b Added fix16_exp currently using the Taylor Series algorithm off Wikipedia, if anyone can optimize this better then go ahead.
Modified fixtest to be a little more generic, can now easily change which function it tests.
2011-02-25 12:08:03 +00:00
flatmush d829f83d31 Updated fix16_atan, now removes some un-necessary code.
Added FIXMATH_NO_ROUNDING macro to disable rounding, currently only applies to fix16_atan but will change to apply this to other operations (namely mul/div) too.
Changed optimization options for rel build in code::blocks project.
2011-02-24 17:18:08 +00:00
flatmush f5cb74ab2e Added an optimized and improved implementation of joe's fixed point atan2 algorithm so that it now works correctly over the full range of fixed point numbers and should be much faster too. 2011-02-23 17:07:17 +00:00
flatmush 5d939700e8 Fixed errors in asin/atan, where incorrect integer maths was used.
Added a macro (FIXMATH_NO_CACHE) to disable caching.
Added fix16_lerp8 and fix16_lerp32 (should be part of fract module really).
2011-02-23 09:47:08 +00:00
Flatmush 3420855dc0 Initial commit. Since its use in fgl and the Dingoo SDK the functions have been separated into more descriptive files/modules. 2011-02-14 20:59:41 +00:00