WIP: add an initial skeleton for a real scsi.device based upon the ata device impleme...
[AROS.git] / compiler / stdc / math / s_ctanf.c
blob81c72a924e2343c7f90fb2bbbb537d29a7942534
1 /* $OpenBSD: s_ctanf.c,v 1.2 2011/07/20 19:28:33 martynas Exp $ */
2 /*
3 * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 /* ctanf()
20 * Complex circular tangent
24 * SYNOPSIS:
26 * void ctanf();
27 * cmplxf z, w;
29 * ctanf( &z, &w );
33 * DESCRIPTION:
35 * If
36 * z = x + iy,
38 * then
40 * sin 2x + i sinh 2y
41 * w = --------------------.
42 * cos 2x + cosh 2y
44 * On the real axis the denominator is zero at odd multiples
45 * of PI/2. The denominator is evaluated by its Taylor
46 * series near these points.
49 * ACCURACY:
51 * Relative error:
52 * arithmetic domain # trials peak rms
53 * IEEE -10,+10 30000 3.3e-7 5.1e-8
56 #include <complex.h>
57 #include "math.h"
59 #include "math_private.h"
61 float complex
62 ctanf(float complex z)
64 z = ctanhf(CMPLXF(cimagf(z), crealf(z)));
65 return (CMPLXF(cimagf(z), crealf(z)));