Nov 29, 2016 Delphi is the ultimate IDE for creating cross-platform, natively compiled apps. Are you ready to design the best UIs of your life? Our award winning VCL framework for Windows and FireMonkey (FMX) visual framework for cross-platform UIs provide you with the foundation for intuitive, beautiful. C Library -The math.h header defines various mathematical functions and one macro. All the functions available in this library take double as an argument and return double.
So here are my questions:
- Does anyone have any reason to use arctan to more than 12 places (decimal) accuracy? (Because the algorithm gets exponential pretty quickly -- more on this in a moment.)
- Does anyone know of an online resource that gives N digits of arctan(x) (for whatever x, I'll work with it) up in at least the thousands range? (I could calculate them myself, but I don't know where the accuracy lies past what Calc can offer, and I don't trust Calc after about 15-20 digits.)
If you are interested, you can find Carlson's algorithm here:
http://dx.doi.org/10.1090/S0025-5718-1972-0307438-2
As listed, it is exponentially expensive in two ways:
(1) stack space (for the binary recursions)
(2) heap space (for the bigfloat allocations)
(Think computer trees blossoming. Or mushroom clouds rising over a city. Either thought will do.)
After memoizing, it remains exponentially expensive in only one way: think bubble-sort. The precision of the algorithm, n, directly affects the number of iterations to compute, which are n!. Yay, not.
(And additional heap space is n+c. Stack space is O(1).)
But at least it is relatively fast now. For a 100 bit big number it computes in about .385 seconds, using n=4 (24 iterations).
Thanks for reading.
- The C Standard Library
- C Standard Library Resources
- C Programming Resources
- Selected Reading
Description
The C library function double atan(double x) returns the arc tangent of x in radians.
Declaration
Dev C++ Download For Windows 7
Following is the declaration for atan() function.
Parameters
x − This is the floating point value.
Return Value
This function returns the principal arc tangent of x, in the interval [-pi/2,+pi/2] radians.
Example
The following example shows the usage of atan() function.
Arctan In C
Let us compile and run the above program that will produce the following result −