Are there any definitions of functions like sqrt()
, sin()
, cos()
, tan()
, log()
, exp()
(these from math.h/cmath) available ?
I just wanted to know how do they work.
This is an interesting question, but reading sources of efficient libraries won't get you very far unless you happen to know the method used.
Here are some pointers to help you understand the classical methods. My information is by no means accurate. The following methods are only the classical ones, particular implementations can use other methods.
sincos
function.atan2
is computed with a call to sincos
and a little logic. These functions are the building blocks for complex arithmetic.