Skip to content

rich4483/trig_functions

Repository files navigation

trig_functions

Improved Trig Functions

This repo is used for sharing purposes only. It is not a development repo. It contains:

  • trig_source.png (source code of simple arctan function)
  • trig_plot.png (a graph of the arctan function)
  • Efficient_approximations_for_the_arctangent_function.pdf (IEEE article)

While working as a Senior Software Engineer at an automotive OEM, I was a member of the Infrastructure software team, where I owned Memory Manager and BootLoader. For a brief period I was tasked with taking on the additional responsibility of owning math libraries for Powertrain, to cover a gap in staffing.

During this time, I was contacted by a customer (internal) who had concerns about performance of the trig functions. In response, I ran some performance testing of existing library functions and investigated alternative approaches, to see if performance could be improved. Coincidentally, I was also working on a personal project at the time which involved a physics engine for iPhone development, which made use of trig functions as well.

I found that many math libraries optimized performance of trig functions by using an approximation that targets a narrow input domain. As long as the domain satisfies requirements, this better performing function is an acceptable alternative.

I was able to replace most of the trig functions, which resulted in speed improvements of up to 30%.

While I am not at liberty to share specific source code or documentation, I can provide a simple example. I found a great candidate for arctan in an IEEE article:

https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1628884&userType=inst

About

Improved Trig Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published