math.h sin, cos, atan2, sqrt functions source code

Hello!

Can i see how does math.h calculate sin, cos, atan2, sqrt
like math.cpp where all things are happening?

I dont want to call those functions because i find that the function calling is to slow and where i need those things, there have to be really low process.
I would be very grateful if someone can help me with that.
Thank you!
Use cmath as C++ header. math.h is here only for C compatibility.

All C/C++ library faculties are usually precompiled and linked into your program. So you cannot actually look into it. However you can download sources of libc (for example) and search for implementation. However it is mostly arcane code which is created for specific compiler with specific settings (in sake of perfomance).

i find that the function calling is to slow
Lolwut? Can you please show profiler output which shows that function calls creates significant decrease in perfomance. Do not do premature optimization. Modern processors will probably cache these functions if you call them often and if you just inline it every time you use it it will lead to code bloat and more loads from memore hence actual decrease in perfomance.

Hint: fast inverse square root wasn't an inline function. If you know what I'm talking about...
Topic archived. No new replies allowed.