1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00
serenity/Libraries/LibM
Jesse bcf3a4457f LibM: Fixed sin() precision (#726)
The old implementation of sin() had a very unacceptable amount of
error that was causing a lot of texture perspective issues in Quake.
This has been remedied through the use of the hardware `fsin`
x87 instruction. As has been noted in #246, this instruction is both
very slow, and can become wildly inaccurate for more precise values,
however the current implementation made an incorrect assumption about
applications "will end up writing their own implemtnation anyways",
which is not the case for Quake in Software mode, which relies heavily
on a correct `sin()` and `cos()` function for `R_ScanEdges()`.

Realistically, we should be using something like the CORDIC algorithm
(https://en.wikipedia.org/wiki/CORDIC) or `Taylor Expansion`, however
for now these provides a somewhat accurate result that allows Quake to
run without any texture or geometry issues.
2019-11-03 09:56:39 +01:00
..
install.sh POSIX compliance: (most) shell scripts converted to generic shell 2019-11-03 09:26:22 +01:00
Makefile Libraries: Remove unused "install" targets. 2019-07-21 21:28:48 +02:00
math.cpp LibM: Fixed sin() precision (#726) 2019-11-03 09:56:39 +01:00
math.h LibM: Implement various functions. 2019-10-17 09:32:24 +02:00
TestMath.cpp LibM: Implement various functions. 2019-10-17 09:32:24 +02:00