Handmade Hero»Forums
2 posts
Day 440 Function Approximation Notes/Source Code/Resources

Does anyone have the source code or notes for "Day 440 - Intro to Function Approximation with Andrew Bromage" or are they available somewhere?

I'm watching that episode to try to get some understanding of how best to approach trig functions for my current project and the information is great, but I'm really struggling to understand it because of the audio glitches. Having the source code and notes would help but I've searched around and haven't been able to find them. I think Andrew mentioned that at least the source code was MIT licensed.

On a related note, does anyone have any other favorite resources on function approximation of the type he's doing? It's something I never understood well in my math education and would be interested in reading more about generally if I could find a good starting point.

Mārtiņš Možeiko
2561 posts / 2 projects
Day 440 Function Approximation Notes/Source Code/Resources
Edited by Mārtiņš Možeiko on

Afaik it was never followed up and finished. So nothing is released.

Here are recent good presentations explaining how to construct function approximations:

Faster Math Functions

Even Faster Math Functions (from page 24 to 100)

The main idea is to find approximation to minimize absolute error of function in specific range when it is calculated with floats (or doubles). Because float/double calculations are inaccurate - ignoring that won't give you most precise approximation which usually many are doing.

There is great software (mentioned in paper) called Sollya that can do this automatically. All you need is provide function, interval, wanted precision and it will spit out approximation using constants that are represented in float our double exactly. See page 89 in second pdf.

2 posts
Day 440 Function Approximation Notes/Source Code/Resources
Replying to mmozeiko (#25414)

What a bummer that it was never followed up. I will check out Sollya and probably use it but I want to at least try and understand the theory. Those resources look great from a skim, I look forward to reading thoroughly when I’m done with work for the day. Thank you very much.