FLINT3.7.0-dev

ca_sin_cos_exponential, ca_sin_cos_direct, ca_sin_cos_tangent, ca_sin_cos

Synopsis#include <flint/ca.h>
void ca_sin_cos_exponential(ca_t res1, ca_t res2, const ca_t x, ca_ctx_t ctx)source
void ca_sin_cos_direct(ca_t res1, ca_t res2, const ca_t x, ca_ctx_t ctx)source
void ca_sin_cos_tangent(ca_t res1, ca_t res2, const ca_t x, ca_ctx_t ctx)source
void ca_sin_cos(ca_t res1, ca_t res2, const ca_t x, ca_ctx_t ctx)source

Sets res1 to \sin x and res2 to \cos x. Either output may be NULL if only the other function is wanted.

The exponential version writes \sin x = (e^{ix} - e^{-ix})/(2i) and \cos x = (e^{ix} + e^{-ix})/2; rational multiples of \pi then give elements of cyclotomic fields. The direct version returns the generators of \mathbb{Q}(\sin x) and \mathbb{Q}(\cos x) (perhaps after symmetry transformations, which may exchange the two functions), and the tangent version expresses both in terms of t = \tan(x/2) as 2t/(1+t^2) and (1-t^2)/(1+t^2). In the last two versions, very simple algebraic values become elements of real number fields. ca_sin_cos uses the form selected by CA_OPT_TRIG_FORM, exponential by default, which works best for simplification and zero testing although it introduces complex numbers in real computations; CA_TRIG_SINE_COSINE selects the direct form.

For special values: \sin(\pm i \infty) = \pm i \infty, \cos(\pm i \infty) = +\infty, the other infinities give Undefined, and Undefined and Unknown map to themselves.

Cite this page

The FLINT team, “ca_sin_cos_exponential, ca_sin_cos_direct, ca_sin_cos_tangent, ca_sin_cos (ca.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca/ca_sin_cos_exponential.html (generated 2026-10-20).