Algorithms to approximate trigonometric functions to n decimal digits I'm currently writing a big number calculator program in C#.Net. What are some reasonably fast and easily implemented algorithms to compute trigonometric functions to $n$ correct decimal digits (where base 10 arithmetic is used and precision may be varied)?
 A: If linear rates of convergence are satisfactory, suitable algorithms may be formulated using power series or continued fraction expansions of the trigonometric functions (and other elementary transcendental functions).  R. Brent showed more rapid convergence can be implemented using Gauss's arithmetic-geometric mean (AGM), but this is may be too much to tackle in a first version.  [Several references about variable precision methods for decimal arithmetic are listed here].
While a Taylor series or continued fraction expansion of a trigonometric function may have theoretical convergence on the entire real line, in practice the idea of range reduction is important to a satisfactory implementation of variable precision computation.
For trigonometric functions their periodicity is the first step to range reduction, i.e. $[0,2\pi]$ for sine and cosine or $[-\pi/2,+\pi/2]$ for tangent.  Other well-known relations, such as evenness for cosine and oddness for sine & tangent, sum or double-angle formulas, etc., can also be employed to relate a general argument $\theta$ to a value in a narrow range close to the origin.  Obviously having a high/arbitrary precision value of $\pi$ is useful for the reduction by periodicity, and this approximation by itself is a nontrivial task.
Once a general argument has been "reduced" to one in the narrow range where a truncated power series (polynomial) approximation has the desired accuracy (or the similar topic for a continued fraction expansion), one has a choice of the direction in which the approximation will be evaluated.  For a truncated power series/polynomial expression, starting with the lowest degree term and proceeding to add high degree terms is attractive for a posteriori stopping criteria based on the sizes of subsequent terms (Taylor Thm. with Remainder applies in the trigonometric power series).  However evaluation in the reverse order is attractive because it allows us to minimize storage and arithmetic operations by Horner's method.  Depending on when the argument and the required decimal digits of precision are determined, it may be efficient to do a small mostly integer computation to decide a priori how many terms of the series are needed to get the desired accuracy at the given argument (typically the closer the argument is to the origin, the fewer terms are needed for a specified precision).
A similar situation exists for continued fraction expansions, which may be evaluated in a naive bottom-to-top level recurrence (analogous to Horner's method) or by a clever fundamental recurrence that gives us the flexibility to increase depth adaptively to reach desired precision.
