Import Upstream version 0.8.2
[platform/upstream/mpc.git] / tests / tan.dat
1 # Data test file for mpc_tan.
2
3 # Copyright (C) 2008 Paul Zimmermann, Philippe Th\'eveny
4
5 # This file is part of the MPC Library.
6 #
7 # The MPC Library is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2.1 of the License, or (at your
10 # option) any later version.
11 #
12 # The MPC Library is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15 # License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with the MPC Library; see the file COPYING.LIB.  If not, write to
19 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 # MA 02111-1307, USA.
21
22 # See file sin.dat for the format description.
23
24 # Special values, following ISO C99 standard, Annex G,
25 # more precisely Section G.6.2.6 "The ctanh functions"
26 # since G.6 defines ctan(z) as -i * ctanh(i*z)
27
28 # Rule [conj]: tan(conj(z)) = conj(tan(z))
29 # Rule [odd]:  tan(-z) = -tan(z)
30
31 # Note: for each rule, we cite the rule for tanh from C99,
32 #       and below the translated rule for tan, using tanh(z) = i tan(-iz),
33 #       thus tanh(a+i*b) = c+i*d translates to tan(b-i*a) = d-i*c
34
35 # tanh(+0 + i*0) = +0 + i*0
36 # tan (+0 - i*0) = +0 - i*0
37 0 0 2 +0 2 -0   2 +0 2 -0   N N
38 # [conj]: tan(+0 + i*0) =  +0 + i*0
39 0 0 2 +0 2 +0   2 +0 2 +0   N N
40 # [odd]: tan(-0 + i*0) =  -0 + i*0
41 0 0 2 -0 2 +0   2 -0 2 +0   N N
42 # [odd+conj]: tan(-0 - i*0) =  -0 - i*0
43 0 0 2 -0 2 -0   2 -0 2 -0   N N
44
45 # tanh(x + i*inf) = nan + i*nan for finite x
46 # tan (inf - i*x) = nan + i*nan for finite x
47 0 0 2 nan 2 nan   2 +inf 2 +1   N N
48 0 0 2 nan 2 nan   2 +inf 2 +0   N N
49 0 0 2 nan 2 nan   2 +inf 2 -0   N N
50 0 0 2 nan 2 nan   2 +inf 2 -1   N N
51 # [conj] does not make sense since we already considered x < 0
52 # [odd]: tan(-inf + i*x) = nan + i*nan for finite x
53 0 0 2 nan 2 nan   2 -inf 2 +1   N N
54 0 0 2 nan 2 nan   2 -inf 2 +0   N N
55 0 0 2 nan 2 nan   2 -inf 2 -0   N N
56 0 0 2 nan 2 nan   2 -inf 2 -1   N N
57
58 # tanh(x + i*nan) = nan + i*nan for finite x
59 # tan (nan + i*x) = nan + i*nan for finite x
60 0 0 2 nan 2 nan   2 nan 2  1    N N
61 0 0 2 nan 2 nan   2 nan 2 +0    N N
62 0 0 2 nan 2 nan   2 nan 2 -0    N N
63 0 0 2 nan 2 nan   2 nan 2 -1    N N
64 # [conj] makes no sense since we already considered x < 0
65 # idem for [odd] since nan has no sign
66
67 # tanh(+inf + i*y) = 1 + i*0*sin(2y) for positive-signed finite y
68 # tan (y - i*inf) = 0*sin(2*y) - i*1 for positive-signed finite y
69 0 0 2 +0 2 -1   2 1 2 -inf   N N
70 0 0 2 -0 2 -1   2 2 2 -inf   N N
71 # [conj]: tan (y + i*inf) = 0*sin(2*y) + i*1
72 0 0 2 +0 2 +1   2 1 2 +inf   N N
73 0 0 2 -0 2 +1   2 2 2 +inf   N N
74 # [odd]: tan (-y + i*inf) = -0*sin(2*y) + i*1
75 0 0 2 -0 2 +1   2 -1 2 +inf   N N
76 0 0 2 +0 2 +1   2 -2 2 +inf   N N
77 # [odd+conj]: tan (-y - i*inf) = -0*sin(2*y) - i*1
78 0 0 2 -0 2 -1   2 -1 2 -inf   N N
79 0 0 2 +0 2 -1   2 -2 2 -inf   N N
80
81 # tanh(+inf + i*inf) = 1 +/- i*0 (unspecified sign of zero for C99)
82 # tan (+inf - i*inf) = +/-0 - i*1
83 0 0 2 0 2 -1   2 +inf 2 -inf   N N
84 # [conj]: tan (+inf + i*inf) = +/-0 + i*1
85 0 0 2 0 2 +1   2 +inf 2 +inf   N N
86 # [odd]:  tan (-inf + i*inf) = +/-0 + i*1
87 0 0 2 0 2 +1   2 -inf 2 +inf   N N
88 # [odd+conj]: tan (-inf - i*inf) = +/-0 - i*1
89 0 0 2 0 2 -1   2 -inf 2 -inf   N N
90
91 # tanh(+inf + i*nan) = 1 +/- i*0 (unspecified sign of zero for C99)
92 # tan (nan  - i*inf) = +/-0 - i*1
93 0 0 2 0 2 -1   2 nan 2 -inf   N N
94 # [conj]: tan (nan + i*inf) = +/-0 + i*1
95 0 0 2 0 2 +1   2 nan 2 +inf   N N
96 # [odd] = [conj] since nan has no sign, and -(+/-0) = +/-0
97
98 # tanh(nan + i*0) = nan + i*0
99 # tan(+0 + i*nan) = +0 + i*nan
100 0 0 2 +0 2 nan   2 +0 2 nan   N N
101 # [conj] gives the same identity since nan has no sign
102 # [odd]: tan(-0 + i*nan) = -0 + i*nan
103 0 0 2 -0 2 nan   2 -0 2 nan   N N
104
105 # tanh(nan + i*y) = nan + i*nan for all nonzero y
106 # tan (y + i*nan) = nan + i*nan
107 0 0 2 nan 2 nan   2 +inf 2 nan   N N
108 0 0 2 nan 2 nan   2 +1   2 nan   N N
109 0 0 2 nan 2 nan   2 -1   2 nan   N N
110 0 0 2 nan 2 nan   2 -inf 2 nan   N N
111 # [conj] gives no new relation since nan has no sign
112 # [odd] gives no new relation since we already considered y < 0
113
114 # tanh(nan + i*nan) = nan + i*nan
115 0 0 2 nan 2 nan   2 nan 2 nan   N N
116
117 # corner case: op = atan (2^(-k) + i*2^k) for k=200 and k=1000
118 + + 100 0x1@-50 100 0x1@50  1000 0x1.921fb54442d18469898cc51701b839a252049c1114cf98e804177d4c76273644a29410f31c6809bbdf2a33679a748636605614dbe4be286e9fc26adadaa3848bc90b6aecc4bcfd8de89884d34c6fdad617feb96de80d6fdbdc70d7f6b5133f4b5d3e4822f8963fcc9250cca3d9c8b67b8400f97142c77e0b31b4906c38 1000 0x1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555548888888888888888888888888888888888888888888888888a@-50 N N
119 + + 100 0x1@-250 100 0x1@250  4000 0x1.921fb54442d18469898cc51701b839a252049c1114cf98e804177d4c76273644a29410f31c6809bbdf2a33679a748636605614dbe4be286e9fc26adadaa3848bc90b6aecc4bcfd8de89885d34c6fdad617feb96de80d6fdbdc70d7f6b5133f4b5d3e4822f8963fcc9250cca3d9c8b67b8400f97142c77e0b31b4906c38aba734d22c7f51fa499ebf06caba47b9475b2c38c5e6ac410aa5773daa520ee12d2cdace186a9c95793009e2e8d811943042f86520bc8c5c6d9c77c73cee58301d0c07364f0745d80f451f6b8abbe0de98a593bc5797ed2ab02e30732a92f9d52ad5ca2ba44c3131f40a202ae51cb51555885b5a662e1a08a0f46750aa4357be3974c9d9f70a08b1b7de1515d4e2aeba0c18fb672e1f0b4dc3c98f57eb5d19b61267ae3d1929c0944ac33b9dc7a44c35a5dcd7e25ff40db31410c9b0ec04e67d90d4c8a43e56302ef6401977c22eaef4c2bad8ee13118175b28dc411c49f40e9cb566287b6b7f9c1fa211c9705a2415242100234e478254f0fccaf10e334217b74b64d33864e30d5e9c4783528d0696c2a17b44b07d39455a899d1b77785b609bd1df25d1df8283f7d954c50f8b28e9cd780bb33652c9f412187444677430ca2b7cfda3ec252e19dc5af5f7037baec42e09039a00d224fab60b5532769d5311b1fbb830dff6fb9214d811e9be86b92680509246d87f56a 4000 0x1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555556@-250 N N
120
121 # yet another absurd case: op = atan (2^200) + 2^(-200000)*I;
122 # expensive to compute
123 #- - 50 0x1@50 50 0x1@-49900  1000 0x1.921fb54442d18469898cc51701b839a252049c1114cf98e803177d4c76273644a29410f31c6809bbdf2a33679a748636605614dbe4be286e9fc26adadaa3848bc90b6aecc4bcfd8de8988628a1c5302b6d540ec33d62c53131c62d4c0a6894a0b2939d784deb9521e7a621f92f1e0bd0d9564ec6981cd3608709e5c18e 1000 0x1@-50000 N N
124
125 # corner case
126 - + 9 -0x9bp-51 9 -1    9 -0x16dp-8 9 -0x77p-3   N N
127