Skip to content

Commit

Permalink
AK: Add a better implementation of tan() on non-x86
Browse files Browse the repository at this point in the history
  • Loading branch information
nico committed Dec 26, 2024
1 parent 5152950 commit 17622bf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions AK/Math.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,7 @@ constexpr T tan(T angle)
return ret;
#else
# if defined(AK_OS_SERENITY)
// FIXME: This is a very naive implementation, and is only valid for small x.
// Probably a good idea to use a better algorithm in the future, such as a taylor approximation.
return angle;
return sin(angle) / cos(angle);
# else
return __builtin_tan(angle);
# endif
Expand Down

0 comments on commit 17622bf

Please sign in to comment.