summaryrefslogtreecommitdiff
path: root/mpc/tests/add_fr.dat
blob: a07110c07cc1ed2f4ee99889a2f56a662eeb8209 (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
# Data file for mpc_add_fr.
#
# Copyright (C) 2008, 2012 INRIA
#
# This file is part of GNU MPC.
#
# GNU MPC 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 3 of the License, or (at your
#o ption) any later version.
#
# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
#
# The line format respects the parameter order in function prototype as
# follow:
#
# INEX_RE INEX_IM PREC_ROP_RE  ROP_RE  PREC_ROP_IM  ROP_IM  PREC_OP1_RE  OP1_RE  PREC_OP1_IM  OP1_IM  PREC_OP2  OP2  RND_RE  RND_IM
#
# where op1 = op1_re + i * op1_im, rop = rop_re + i * rop_im,
# The data are read from the file and stored in variables op1, op2, rop using
# rounding to nearest when needed, for instance: rop_re is ROP_RE rounded to
# nearest to the precision of PREC_ROP_RE.
# ROP_RE is checked against Re(op1 + op2) rounded to the precision PREC_ROP_RE
#   in the direction RND_RE
# ROP_IM is checked against Im(op1) rounded to the precision PREC_ROP_IM
#   in the direction RND_IM
# INEX_RE is the ternary value for the real part with the following notation:
# "?" ternary value not checked
# "+" if ROP_RE is greater than the exact mathematical result
# "0" if ROP_RE is exactly the mathematical result
# "-" if ROP_RE is less than the exact mathematical result
# (m.m. INEX_IM)
# rounding modes notation:
# "N" is rounding to nearest
# "Z" is rounding towards zero
# "U" is rounding towards plus infinity
# "D" is rounding towards minus infinity
# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
#   no prefix for value in base ten.
# In all bases, "nan" is NaN, "inf" is infinity;
# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".

# special values (following ISO C99 standard)
0 0 53 -inf 53 -inf    53 -inf 53 -inf 53 -inf N Z
0 0 53 -inf 53 +inf    53 -inf 53 +inf 53   -1 Z U
0 0 53 -inf 53   -0    53 -inf 53   -0 53   -0 U D
0 0 53 -inf 53   +0    53 -inf 53   +0 53   +0 D N
0 0 53 -inf 53   -1    53 -inf 53   -1 53   +1 N U
0 0 53  nan 53   +1    53 -inf 53   +1 53 +inf Z D
0 0 53  nan 53  nan    53 -inf 53  nan 53  nan U N

0 0 53 -inf 53 +inf    53   -1 53 +inf 53 -inf N Z
0 0 53   -2 53   -0    53   -1 53   -0 53   -1 Z U
0 0 53   -1 53   +0    53   -1 53   +0 53   -0 U D
0 0 53   -1 53   -1    53   -1 53   -1 53   +0 D N
0 0 53   +0 53   +1    53   -1 53   +1 53   +1 N U
0 0 53 +inf 53  nan    53   -1 53  nan 53 +inf Z D
0 0 53  nan 53 -inf    53   -1 53 -inf 53  nan U N

0 0 53 -inf 53   -0    53   -0 53   -0 53 -inf N Z
0 0 53   -1 53   +0    53   -0 53   +0 53   -1 Z U
0 0 53   -0 53   -1    53   -0 53   -1 53   -0 U D
0 0 53   -0 53   +1    53   -0 53   +1 53   +0 D N
0 0 53   +1 53  nan    53   -0 53  nan 53   +1 N U
0 0 53 +inf 53 -inf    53   -0 53 -inf 53 +inf Z D
0 0 53  nan 53 +inf    53   -0 53 +inf 53  nan U N

0 0 53 -inf 53   +0    53   +0 53   +0 53 -inf N Z
0 0 53   -1 53   -1    53   +0 53   -1 53   -1 Z U
0 0 53   +0 53   +1    53   +0 53   +1 53   -0 U D
0 0 53   +0 53  nan    53   +0 53  nan 53   +0 D N
0 0 53   +1 53 -inf    53   +0 53 -inf 53   +1 N U
0 0 53 +inf 53 +inf    53   +0 53 +inf 53 +inf Z D
0 0 53  nan 53   -0    53   +0 53   -0 53  nan U N

0 0 53 -inf 53   -1    53   +1 53   -1 53 -inf N Z
0 0 53   +0 53   +1    53   +1 53   +1 53   -1 Z U
0 0 53   +1 53  nan    53   +1 53  nan 53   -0 U D
0 0 53   +1 53 -inf    53   +1 53 -inf 53   +0 D N
0 0 53   +2 53 +inf    53   +1 53 +inf 53   +1 N U
0 0 53 +inf 53   -0    53   +1 53   -0 53 +inf Z D
0 0 53  nan 53   +0    53   +1 53   +0 53  nan U N

0 0 53  nan 53   +1    53 +inf 53   +1 53 -inf N Z
0 0 53 +inf 53  nan    53 +inf 53  nan 53   -1 Z U
0 0 53 +inf 53 -inf    53 +inf 53 -inf 53   -0 U D
0 0 53 +inf 53 +inf    53 +inf 53 +inf 53   +0 D N
0 0 53 +inf 53   -0    53 +inf 53   -0 53   +1 N U
0 0 53 +inf 53   +0    53 +inf 53   +0 53 +inf Z D
0 0 53  nan 53   -1    53 +inf 53   -1 53  nan U N

0 0 53  nan 53  nan    53  nan 53  nan 53 -inf N Z
0 0 53  nan 53 -inf    53  nan 53 -inf 53   -1 Z U
0 0 53  nan 53 +inf    53  nan 53 +inf 53   -0 U D
0 0 53  nan 53   -0    53  nan 53   -0 53   +0 D N
0 0 53  nan 53   +0    53  nan 53   +0 53   +1 N U
0 0 53  nan 53   -1    53  nan 53   -1 53 +inf Z D
0 0 53  nan 53   +1    53  nan 53   +1 53  nan U N

# pure real argument
- 0 53  0x10000000000000p-52  53 -0    53 +1 53 -0 53 0x10000000000001p-106 N N
+ 0 53  0x10000000000001p-52  53 -0    53 +1 53 -0 53 0x10000000000001p-105 N N
- 0 53  0x10000000000001p-52  53 -0    53 +1 53 -0 53 0x10000000000001p-104 N N
- 0 53  0x10000000000000p-52  53 -0    53 +1 53 -0 53 0x10000000000001p-105 Z Z
+ 0 53  0x10000000000001p-52  53 -0    53 +1 53 -0 53 0x10000000000001p-105 U U
- 0 53  0x10000000000000p-52  53 -0    53 +1 53 -0 53 0x10000000000001p-105 D D

# pure imaginary argument
0 0 53 +1 53 +1     53 -0 53 1 53 +1 N N
0 0 53 +1 53 +1     53 +0 53 1 53 +1 Z Z
0 0 53 +1 53 +1     53 +0 53 1 53 +1 U U
0 0 53 +1 53 +1     53 -0 53 1 53 +1 D D

# non-zero return values for imaginary part
0 + 2 0 2 8  3 0 3 7 3 0 N N
0 - 2 0 2 4  3 0 3 5 3 0 N N