summaryrefslogtreecommitdiff
path: root/tests/log.dat
blob: ac7e0cf420e4ea6349937295618da296c0f86596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Data test file for mpc_log.

# Copyright (C) 2008, 2009 Paul Zimmermann, Andreas Enge

# This file is part of the MPC Library.
#
# The MPC Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.
#
# The MPC Library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with the MPC Library; see the file COPYING.LIB.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.

# See file sin.dat for the format description.

# Special values, following ISO C99 standard, Annex G,
# more precisely Section G.6.3.2 "The clog functions".

# Rule [conj]: log(conj(z)) = conj(log(z))

# log(-0 + i*0) = -inf + i*pi
0 - 2 -inf 53 +0x3243F6A8885A3p-48   2 -0 2 +0     N N
0 + 2 -inf 53 -0x3243F6A8885A3p-48   2 -0 2 -0     N N
0 - 2 -inf 53 +0x3243F6A8885A3p-48   2 -0 2 +0     N D
# The following test reveals a bug in mpfr-2.4.1 and should be disabled for
# the release as long as mpc does not require a more recent version of mpfr.
# 0 - 2 -inf 53 -0x3243F6A8885A32p-52  2 -0 2 -0     N D

# log(+0 + i*0) = -inf + i*0
0 0 2 -inf 2 +0                      2 +0 2 +0    N N
0 0 2 -inf 2 -0                      2 +0 2 -0    N N

# log(+1 +- i*0) = +0 +- i*0
0 0 2 +0 2 +0                      2 1 2 +0    N N
0 0 2 +0 2 -0                      2 1 2 -0    N N

# log(-1 +- i*0) = +0 +- i*pi
0 - 2 +0 53 +0x3243F6A8885A3p-48   2 -1 2 +0     N N
0 + 2 +0 53 -0x3243F6A8885A3p-48   2 -1 2 -0     N N

# log(x + i*inf) = +inf + i*pi/2 for finite x
0 - 2 +inf 53 +0x3243F6A8885A3p-49  2  1 2 +inf   N N
0 - 2 +inf 53 +0x3243F6A8885A3p-49  2 +0 2 +inf   N N
0 - 2 +inf 53 +0x3243F6A8885A3p-49  2 -0 2 +inf   N N
0 - 2 +inf 53 +0x3243F6A8885A3p-49  2 -1 2 +inf   N N
# by [conj]: log(x - i*inf) = +inf - i*pi/2 for finite x
0 + 2 +inf 53 -0x3243F6A8885A3p-49  2  1 2 -inf  N N
0 + 2 +inf 53 -0x3243F6A8885A3p-49  2 +0 2 -inf  N N
0 + 2 +inf 53 -0x3243F6A8885A3p-49  2 -0 2 -inf  N N
0 + 2 +inf 53 -0x3243F6A8885A3p-49  2 -1 2 -inf  N N

# log(x + i*nan) = nan+i*nan for finite x
0 0 2 nan 2 nan                    2  1 2 nan    N N
0 0 2 nan 2 nan                    2 +0 2 nan    N N
0 0 2 nan 2 nan                    2 -0 2 nan    N N
0 0 2 nan 2 nan                    2 -1 2 nan    N N

# log(-inf + i*y) = +inf + i*pi for finite positive-signed y
0 - 2 +inf 53 0x3243F6A8885A3p-48  2 -inf 2  1   N N
0 - 2 +inf 53 0x3243F6A8885A3p-48  2 -inf 2 +0   N N
# by [conj]: log(-inf + i*y) = +inf - i*pi for finite negative-signed y
0 + 2 +inf 53 -0x3243F6A8885A3p-48  2 -inf 2 -1  N N
0 + 2 +inf 53 -0x3243F6A8885A3p-48  2 -inf 2 -0  N N

# log(+inf + i*y) = +inf + i*0 for finite positive-signed y
0 0 2 +inf 2 +0                    2 +inf 2  1   N N
0 0 2 +inf 2 +0                    2 +inf 2 +0   N N
# by [conj]: log(+inf + i*y) = +inf - i*0 for finite negative-signed y
0 0 2 +inf 2 -0                    2 +inf 2 -1   N N
0 0 2 +inf 2 -0                    2 +inf 2 -0   N N

# log(-inf + i*inf) = +inf + i*(3*pi/4)
0 - 2 +inf 53 0x96CBE3F9990E9p-50  2 -inf 2 +inf N N
# by [conj]: log(-inf - i*inf) = +inf - i*(3*pi/4)
0 + 2 +inf 53 -0x96CBE3F9990E9p-50 2 -inf 2 -inf N N

# log(+inf + i*inf) = +inf + i*(pi/4)
0 - 2 +inf 53 0x3243F6A8885A3p-50  2 +inf 2 +inf N N
# by [conj]: log(+inf - i*inf) = +inf - i*(pi/4)
0 + 2 +inf 53 -0x3243F6A8885A3p-50 2 +inf 2 -inf N N

# log(+/-inf + i*nan) = +inf + i*nan
0 0 2 +inf 2 nan                   2 +inf 2 nan  N N
0 0 2 +inf 2 nan                   2 -inf 2 nan  N N

# log(nan + i*y) = nan + i*nan for finite y
0 0 2 nan 2 nan                    2 nan 2  1    N N
0 0 2 nan 2 nan                    2 nan 2 +0    N N
0 0 2 nan 2 nan                    2 nan 2 -0    N N
0 0 2 nan 2 nan                    2 nan 2 -1    N N

# log(nan + i*inf) = +inf + i*nan
0 0 2 +inf 2 nan                   2 nan 2 +inf  N N

# log(nan + i*nan) = nan + i*nan
0 0 2 nan 2 nan                    2 nan 2 nan   N N

# log(x + i*y) with either x or y zero and the other non-zero
+ 0 53 0xB5535E0FD3FBDp-50  2                    0     5  0x11 2     0 N N
+ - 53 0xB5535E0FD3FBDp-50 53  0x3243F6A8885A3p-49     2     0 5  0x11 N N
- - 53 0x5E38D81812CCBp-49 53  0x3243F6A8885A3p-48     5 -0x13 2    +0 N N
- + 53 0x5E38D81812CCBp-49 53 -0x3243F6A8885A3p-48     5 -0x13 2    -0 N N
- + 53 0x5E38D81812CCBp-49 53 -0x3243F6A8885A3p-49     2     0 5 -0x13 N N

- + 53 0x19157DFDD1B3Fp-47  53  0x1921FB54442D19p-51   5 -0x17 2    +0 Z U
- - 53 0x19157DFDD1B3Fp-47  53 -0x1921FB54442D19p-51   5 -0x17 2    -0 N D
+ - 53 0x19157DFDD1B3F1p-51 53  0x3243F6A8885A3p-48    5 -0x17 2    +0 U Z
- + 53 0x19157DFDD1B3Fp-47  53 -0x3243F6A8885A3p-48    5 -0x17 2    -0 D N
- - 53 0x8611A6D2511D3p-49  53  0x3243F6A8885A3p-48    7 -0x42 2    +0 Z D
- + 53 0x8611A6D2511D3p-49  53 -0x3243F6A8885A3p-48    7 -0x42 2    -0 N Z
+ - 53 0x10C234DA4A23A7p-50 53  0x3243F6A8885A3p-48    7 -0x42 2    +0 U N
- + 53 0x8611A6D2511D3p-49  53 -0x3243F6A8885A3p-48    7 -0x42 2    -0 D U

# huge values
+ 0 53 0x162E42FEFA39Fp-39  2   0                   2 0x1p1024 2    +0 U U
+ 0 53 0x162E42FEFA39Fp-38  2   0                   2 0x1p2048 2    +0 U U
+ 0 53 0x162E42FEFA39Fp-37  2   0                   2 0x1p4096 2    +0 U U
+ 0 53 0x162E42FEFA39Fp-36  2   0                   2 0x1p8192 2    +0 U U
+ 0 53 0x162E42FEFA39Fp-35  2   0                   2 0x1p16384 2   +0 U U
+ 0 53 0x162E42FEFA39Fp-34  2   0                   2 0x1p32768 2   +0 U U
+ 0 53 0x162E42FEFA39Fp-33  2   0                   2 0x1p65536 2   +0 U U
+ 0 53 0x162E42FEFA39Fp-32  2   0                   2 0x1p131072 2  +0 U U
+ 0 53 0x162E42FEFA39Fp-31  2   0                   2 0x1p262144 2  +0 U U
+ 0 53 0x162E42FEFA39Fp-30  2   0                   2 0x1p524288 2  +0 U U
+ 0 53 0x162E42FEFA39Fp-29  2   0                   2 0x1p1048576 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-28  2   0                   2 0x1p2097152 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-27  2   0                   2 0x1p4194304 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-26  2   0                   2 0x1p8388608 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-25  2   0                  2 0x1p16777216 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-24  2   0                  2 0x1p33554432 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-23  2   0                  2 0x1p67108864 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-22  2   0                 2 0x1p134217728 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-21  2   0                 2 0x1p268435456 2 +0 U U
+ 0 53 0x162E42FEFA39Fp-20  2   0                 2 0x1p536870912 2 +0 U U
+ + 53 0x163108C75A1937p-43 53 0x1921FB54442D19p-53 2 0x1p1024 2 0x1p1024 U U
+ + 53 0x162FA5E32A2993p-42 53 0x1921FB54442D19p-53 2 0x1p2048 2 0x1p2048 U U
+ + 53 0xB177A388918E1p-40  53 0x1921FB54442D19p-53 2 0x1p4096 2 0x1p4096 U U
+ + 53 0x162E9BB80635D9p-40 53 0x1921FB54442D19p-53 2 0x1p8192 2 0x1p8192 U U
+ + 53 0x58B9BD6E00DF9p-37  53 0x1921FB54442D19p-53 2 0x1p16384 2 0x1p16384 U U
+ + 53 0xB172C969E9C75p-37  53 0x1921FB54442D19p-53 2 0x1p32768 2 0x1p32768 U U
+ + 53 0x162E4E161BB96Dp-37 53 0x1921FB54442D19p-53 2 0x1p65536 2 0x1p65536 U U
+ + 53 0xB172445457CD7p-35   2  0x1p0             2 0x1p131072 2 0x1p131072 U U
+ + 53 0x162E45C4C299CFp-35  2  0x1p0             2 0x1p262144 2 0x1p262144 U U
+ + 53 0x162E4461DE69DFp-34  2  0x1p0             2 0x1p524288 2 0x1p524288 U U
+ + 53 0x2C5C8760D8A3Dp-30   2  0x1p0           2 0x1p1048576 2 0x1p1048576 U U
+ + 53 0x58B90D5ECD17Bp-30   2  0x1p0           2 0x1p2097152 2 0x1p2097152 U U
+ + 53 0xB172195AB5FF7p-30   2  0x1p0           2 0x1p4194304 2 0x1p4194304 U U
+ + 53 0x162E4315287CEFp-30  2  0x1p0           2 0x1p8388608 2 0x1p8388608 U U
+ + 53 0x162E430A115B6Fp-29  2  0x1p0         2 0x1p16777216 2 0x1p16777216 U U
+ + 53 0x162E430485CAAFp-28  2  0x1p0         2 0x1p33554432 2 0x1p33554432 U U
+ + 53 0x162E4301C0025p-23   2  0x1p0         2 0x1p67108864 2 0x1p67108864 U U
+ + 53 0xB1721802E8F1p-21    2  0x1p0       2 0x1p134217728 2 0x1p134217728 U U
+ + 53 0x2C5C85FF57581p-22   2  0x1p0       2 0x1p268435456 2 0x1p268435456 U U
# Due to intermediate overflow, the following result has real part infinity
# instead of the correct result. Since this may happen in other parts of the
# library as well, we do not consider it a bug for the moment.
# + + 53 0x58B90BFD4BCBFp-22   2  0x1p0       2 0x1p536870912 2 0x1p536870912 U U