Rich Schupbach

Improved Trig Functions

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:

IEEE

Here is a link to my GitHub, where you may find the IEEE article in PDF form:

GitHub
Pricise Hardware Control
Speed and Performance Optimization