--I have not been able to find the answer as to how the sin and cos functions are calculated in math.h, is this done with the taylor series? or is it somehow read from stored values like a distribution?
--where can i the easiest see the details of algorithms used for math.h?
--does anyone have a recommendation for a library which makes it possible to include integers and floats of a higher precision than 64 bit?
is this done with the taylor series? or is it somehow read from stored values like a distribution?
Both your guess are correct, I think. The calculation in most implementations nowadays relies on co-processor instructions and it is done by set of pre-calculated points interpolated with formulas like Taylor or Fourier for example.
However it is platform-dependent - that is why you could not find exact answer - on some platforms it could be software library - though on most it relies on (co)processor as I've told.
does anyone have a recommendation for a library which makes it possible to include integers and floats of a higher precision than 64 bit
Could you explain why you may need it, by the way? Note that existing precision is sufficient to calculate elements of Earth orbit up to 1 millimeter. Do you really need some precision? Perhaps you just mishandle your calculations somehow?
The C standard library defines sine functions within math.h: sin(double), sinf(float), and sinl(long double). The parameter of each is a floating point value, specifying the angle in radians. Each function returns the same data type as it accepts.
thank you all very for the fast answers. I first of all need c++ to program objects that work within higerlevel sound-programming environments such as SuperCollider and ChucK. I need the library for a special project which is programmed in finite fields, and 64 bit integers are not enough , I have reached the limitation. The GMPlib looks like a very fine option. I am on macOS and linux.
The questions about the trig functions are with respect to being able to make processing as cpu-inexpensive as possible. I have for instance been working on programming a circular wave (sine) without the use of transcendentals as sin or cos, using an ancient parametrization of the circle combined with the algebra of complex numbers (suggested by mathematician NJ Wildberger) it takes less than 10 multiplications per new value in the rotation. Slowly trying to find my way comparing these things. But since things are happening a such different levels that will take quite a bit of studying i guess. thanks for links.