annotate gcc/testsuite/ada/acats/tests/cxa/cxa5a07.a @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- CXA5A07.A
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 -- Check that the function Arctan provides correct results.
kono
parents:
diff changeset
28 --
kono
parents:
diff changeset
29 -- TEST DESCRIPTION:
kono
parents:
diff changeset
30 -- This test examines both the version of Arctan resulting from the
kono
parents:
diff changeset
31 -- instantiation of the Ada.Numerics.Generic_Elementary_Functions with
kono
parents:
diff changeset
32 -- a type derived from type Float, as well as the preinstantiated
kono
parents:
diff changeset
33 -- version of this package for type Float.
kono
parents:
diff changeset
34 -- Prescribed results, including instances prescribed to raise
kono
parents:
diff changeset
35 -- exceptions, are examined in the test cases. In addition,
kono
parents:
diff changeset
36 -- certain evaluations are performed where the actual function result
kono
parents:
diff changeset
37 -- is compared with the expected result (within an epsilon range of
kono
parents:
diff changeset
38 -- accuracy).
kono
parents:
diff changeset
39 --
kono
parents:
diff changeset
40 -- TEST FILES:
kono
parents:
diff changeset
41 -- The following files comprise this test:
kono
parents:
diff changeset
42 --
kono
parents:
diff changeset
43 -- FXA5A00.A (foundation code)
kono
parents:
diff changeset
44 -- CXA5A07.A
kono
parents:
diff changeset
45 --
kono
parents:
diff changeset
46 --
kono
parents:
diff changeset
47 -- CHANGE HISTORY:
kono
parents:
diff changeset
48 -- 04 Apr 95 SAIC Initial prerelease version.
kono
parents:
diff changeset
49 -- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
kono
parents:
diff changeset
50 -- use of Result_Within_Range function overloaded for
kono
parents:
diff changeset
51 -- FXA5A00.New_Float_Type.
kono
parents:
diff changeset
52 -- 28 Feb 97 PWB.CTA Removed checks with explicit Cycle => 2.0*Pi
kono
parents:
diff changeset
53 --
kono
parents:
diff changeset
54 -- CHANGE NOTE:
kono
parents:
diff changeset
55 -- According to Ken Dritz, author of the Numerics Annex of the RM,
kono
parents:
diff changeset
56 -- one should never specify the cycle 2.0*Pi for the trigonometric
kono
parents:
diff changeset
57 -- functions. In particular, if the machine number for the first
kono
parents:
diff changeset
58 -- argument is not an exact multiple of the machine number for the
kono
parents:
diff changeset
59 -- explicit cycle, then the specified exact results cannot be
kono
parents:
diff changeset
60 -- reasonably expected. The affected checks in this test have been
kono
parents:
diff changeset
61 -- marked as comments, with the additional notation "pwb-math".
kono
parents:
diff changeset
62 -- Phil Brashear
kono
parents:
diff changeset
63 --!
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 with Ada.Numerics.Elementary_Functions;
kono
parents:
diff changeset
66 with Ada.Numerics.Generic_Elementary_Functions;
kono
parents:
diff changeset
67 with FXA5A00;
kono
parents:
diff changeset
68 with Report;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 procedure CXA5A07 is
kono
parents:
diff changeset
71 begin
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 Report.Test ("CXA5A07", "Check that the Arctan function provides " &
kono
parents:
diff changeset
74 "correct results");
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 Test_Block:
kono
parents:
diff changeset
77 declare
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 use Ada.Numerics;
kono
parents:
diff changeset
80 use FXA5A00;
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
kono
parents:
diff changeset
83 package EF renames Ada.Numerics.Elementary_Functions;
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 Float_Result : Float;
kono
parents:
diff changeset
86 New_Float_Result : New_Float;
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 procedure Dont_Optimize_Float is new Dont_Optimize(Float);
kono
parents:
diff changeset
89 procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 begin
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 -- Testing of Arctan Function, both instantiated and pre-instantiated
kono
parents:
diff changeset
94 -- version.
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 -- Check that Argument_Error is raised by the Arctan function when
kono
parents:
diff changeset
97 -- provided parameter values of 0.0, 0.0.
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 begin
kono
parents:
diff changeset
100 New_Float_Result := GEF.Arctan(Y => 0.0, X => 0.0);
kono
parents:
diff changeset
101 Report.Failed("Argument_Error not raised when the Arctan " &
kono
parents:
diff changeset
102 "function is provided input of 0.0, 0.0");
kono
parents:
diff changeset
103 Dont_Optimize_New_Float(New_Float_Result, 1);
kono
parents:
diff changeset
104 exception
kono
parents:
diff changeset
105 when Argument_Error => null; -- OK, expected exception.
kono
parents:
diff changeset
106 when others =>
kono
parents:
diff changeset
107 Report.Failed("Incorrect exception raised by the Arctan " &
kono
parents:
diff changeset
108 "function when provided 0.0, 0.0 input parameters");
kono
parents:
diff changeset
109 end;
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 -- Check that no exception is raised by the Arctan function when
kono
parents:
diff changeset
113 -- provided a large positive or negative Y parameter value, when
kono
parents:
diff changeset
114 -- using the default value for parameter X.
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 begin
kono
parents:
diff changeset
117 Float_Result := EF.Arctan(Y => FXA5A00.Large);
kono
parents:
diff changeset
118 Dont_Optimize_Float(Float_Result, 2);
kono
parents:
diff changeset
119 exception
kono
parents:
diff changeset
120 when others =>
kono
parents:
diff changeset
121 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
122 "provided a large positive Y parameter value");
kono
parents:
diff changeset
123 end;
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 begin
kono
parents:
diff changeset
126 New_Float_Result := GEF.Arctan(Y => New_Float(-FXA5A00.Large));
kono
parents:
diff changeset
127 Dont_Optimize_New_Float(New_Float_Result, 3);
kono
parents:
diff changeset
128 exception
kono
parents:
diff changeset
129 when others =>
kono
parents:
diff changeset
130 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
131 "provided a large negative Y parameter value");
kono
parents:
diff changeset
132 end;
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134
kono
parents:
diff changeset
135 -- Check that no exception is raised by the Arctan function when
kono
parents:
diff changeset
136 -- provided a small positive or negative Y parameter value, when
kono
parents:
diff changeset
137 -- using the default value for parameter X.
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 begin
kono
parents:
diff changeset
140 Float_Result := EF.Arctan(Y => FXA5A00.Small);
kono
parents:
diff changeset
141 Dont_Optimize_Float(Float_Result, 4);
kono
parents:
diff changeset
142 exception
kono
parents:
diff changeset
143 when others =>
kono
parents:
diff changeset
144 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
145 "provided a small positive Y parameter value");
kono
parents:
diff changeset
146 end;
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 begin
kono
parents:
diff changeset
149 New_Float_Result := GEF.Arctan(Y => New_Float(-FXA5A00.Small));
kono
parents:
diff changeset
150 Dont_Optimize_New_Float(New_Float_Result, 5);
kono
parents:
diff changeset
151 exception
kono
parents:
diff changeset
152 when others =>
kono
parents:
diff changeset
153 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
154 "provided a small negative Y parameter value");
kono
parents:
diff changeset
155 end;
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 -- Check that no exception is raised by the Arctan function when
kono
parents:
diff changeset
159 -- provided combinations of large and small positive or negative
kono
parents:
diff changeset
160 -- parameter values for both Y and X input parameters.
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 begin
kono
parents:
diff changeset
163 Float_Result := EF.Arctan(Y => FXA5A00.Large, X => FXA5A00.Large);
kono
parents:
diff changeset
164 Dont_Optimize_Float(Float_Result, 6);
kono
parents:
diff changeset
165 exception
kono
parents:
diff changeset
166 when others =>
kono
parents:
diff changeset
167 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
168 "provided large positive X and Y parameter values");
kono
parents:
diff changeset
169 end;
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 begin
kono
parents:
diff changeset
172 New_Float_Result := GEF.Arctan(New_Float(-FXA5A00.Large),
kono
parents:
diff changeset
173 X => New_Float(FXA5A00.Small));
kono
parents:
diff changeset
174 Dont_Optimize_New_Float(New_Float_Result, 7);
kono
parents:
diff changeset
175 exception
kono
parents:
diff changeset
176 when others =>
kono
parents:
diff changeset
177 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
178 "provided a large negative Y parameter value " &
kono
parents:
diff changeset
179 "and a small positive X parameter value");
kono
parents:
diff changeset
180 end;
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 begin
kono
parents:
diff changeset
184 Float_Result := EF.Arctan(Y => FXA5A00.Small, X => FXA5A00.Large);
kono
parents:
diff changeset
185 Dont_Optimize_Float(Float_Result, 8);
kono
parents:
diff changeset
186 exception
kono
parents:
diff changeset
187 when others =>
kono
parents:
diff changeset
188 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
189 "provided a small positive Y parameter value " &
kono
parents:
diff changeset
190 "and a large positive X parameter value");
kono
parents:
diff changeset
191 end;
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 begin
kono
parents:
diff changeset
194 New_Float_Result := GEF.Arctan(New_Float(-FXA5A00.Small),
kono
parents:
diff changeset
195 New_Float(-FXA5A00.Large));
kono
parents:
diff changeset
196 Dont_Optimize_New_Float(New_Float_Result, 9);
kono
parents:
diff changeset
197 exception
kono
parents:
diff changeset
198 when others =>
kono
parents:
diff changeset
199 Report.Failed("Exception raised when the Arctan function is " &
kono
parents:
diff changeset
200 "provided a small negative Y parameter value " &
kono
parents:
diff changeset
201 "and a large negative parameter value");
kono
parents:
diff changeset
202 end;
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204
kono
parents:
diff changeset
205 -- Check that when the Arctan function is provided a Y parameter value
kono
parents:
diff changeset
206 -- of 0.0 and a positive X parameter input value, the prescribed result
kono
parents:
diff changeset
207 -- of zero is returned.
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 if GEF.Arctan(Y => 0.0) /= 0.0 or -- Default X value
kono
parents:
diff changeset
210 EF.Arctan(Y => 0.0, X => FXA5A00.Large) /= 0.0 or
kono
parents:
diff changeset
211 --pwb-math: Next line: changed 2.0*Pi to 360.0
kono
parents:
diff changeset
212 GEF.Arctan(0.0, 360.0) /= 0.0 or
kono
parents:
diff changeset
213 EF.Arctan(0.0, FXA5A00.Small) /= 0.0
kono
parents:
diff changeset
214 then
kono
parents:
diff changeset
215 Report.Failed("Incorrect results from the Arctan function when " &
kono
parents:
diff changeset
216 "provided a Y parameter value of 0.0 and various " &
kono
parents:
diff changeset
217 "positive X parameter values");
kono
parents:
diff changeset
218 end if;
kono
parents:
diff changeset
219
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 -- Check that the Arctan function provides correct results when provided
kono
parents:
diff changeset
222 -- a variety of Y parameter values.
kono
parents:
diff changeset
223
kono
parents:
diff changeset
224 if not FXA5A00.Result_Within_Range(EF.Arctan(Pi), 1.26, 0.01) or
kono
parents:
diff changeset
225 not FXA5A00.Result_Within_Range(EF.Arctan(-Pi), -1.26, 0.01) or
kono
parents:
diff changeset
226 not FXA5A00.Result_Within_Range(GEF.Arctan(1.0), 0.785, 0.001) or
kono
parents:
diff changeset
227 not FXA5A00.Result_Within_Range(EF.Arctan(-1.0), -0.785, 0.001) or
kono
parents:
diff changeset
228 not FXA5A00.Result_Within_Range(GEF.Arctan(0.25), 0.245, 0.001) or
kono
parents:
diff changeset
229 not FXA5A00.Result_Within_Range(EF.Arctan(0.92), 0.744, 0.001)
kono
parents:
diff changeset
230 then
kono
parents:
diff changeset
231 Report.Failed("Incorrect results from the Arctan function when " &
kono
parents:
diff changeset
232 "provided a variety of Y parameter values");
kono
parents:
diff changeset
233 end if;
kono
parents:
diff changeset
234
kono
parents:
diff changeset
235
kono
parents:
diff changeset
236
kono
parents:
diff changeset
237 -- Check the results of the Arctan function with specified cycle
kono
parents:
diff changeset
238 -- parameter.
kono
parents:
diff changeset
239
kono
parents:
diff changeset
240 -- Check that the Arctan function with specified Cycle parameter
kono
parents:
diff changeset
241 -- raises Argument_Error when the value of the Cycle parameter is zero
kono
parents:
diff changeset
242 -- or negative.
kono
parents:
diff changeset
243
kono
parents:
diff changeset
244 begin
kono
parents:
diff changeset
245 Float_Result := EF.Arctan(Y => Pi, Cycle => 0.0); -- Default X value
kono
parents:
diff changeset
246 Report.Failed("Argument_Error not raised by the Arctan function " &
kono
parents:
diff changeset
247 "with default X parameter value, when the Cycle " &
kono
parents:
diff changeset
248 "parameter is 0.0");
kono
parents:
diff changeset
249 Dont_Optimize_Float(Float_Result, 10);
kono
parents:
diff changeset
250 exception
kono
parents:
diff changeset
251 when Argument_Error => null; -- OK, expected exception.
kono
parents:
diff changeset
252 when others =>
kono
parents:
diff changeset
253 Report.Failed("Incorrect exception raised by the Arctan " &
kono
parents:
diff changeset
254 "function with default X parameter value, when " &
kono
parents:
diff changeset
255 "provided a 0.0 cycle parameter value");
kono
parents:
diff changeset
256 end;
kono
parents:
diff changeset
257
kono
parents:
diff changeset
258 begin
kono
parents:
diff changeset
259 New_Float_Result := GEF.Arctan(Y => Pi, X => 1.0, Cycle => 0.0);
kono
parents:
diff changeset
260 Report.Failed("Argument_Error not raised by the Arctan function " &
kono
parents:
diff changeset
261 "when the Cycle parameter is 0.0");
kono
parents:
diff changeset
262 Dont_Optimize_New_Float(New_Float_Result, 11);
kono
parents:
diff changeset
263 exception
kono
parents:
diff changeset
264 when Argument_Error => null; -- OK, expected exception.
kono
parents:
diff changeset
265 when others =>
kono
parents:
diff changeset
266 Report.Failed("Incorrect exception raised by the Arctan " &
kono
parents:
diff changeset
267 "function when provided a 0.0 cycle parameter " &
kono
parents:
diff changeset
268 "value");
kono
parents:
diff changeset
269 end;
kono
parents:
diff changeset
270
kono
parents:
diff changeset
271 begin
kono
parents:
diff changeset
272 Float_Result := EF.Arctan(Y => Pi, Cycle => -360.0);
kono
parents:
diff changeset
273 Report.Failed("Argument_Error not raised by the Arctan function " &
kono
parents:
diff changeset
274 "with a default X parameter value, when the Cycle " &
kono
parents:
diff changeset
275 "parameter is -360.0");
kono
parents:
diff changeset
276 Dont_Optimize_Float(Float_Result, 12);
kono
parents:
diff changeset
277 exception
kono
parents:
diff changeset
278 when Argument_Error => null; -- OK, expected exception.
kono
parents:
diff changeset
279 when others =>
kono
parents:
diff changeset
280 Report.Failed("Incorrect exception raised by the Arctan " &
kono
parents:
diff changeset
281 "function with a default X parameter value, when " &
kono
parents:
diff changeset
282 "provided a -360.0 cycle parameter value");
kono
parents:
diff changeset
283 end;
kono
parents:
diff changeset
284
kono
parents:
diff changeset
285 begin
kono
parents:
diff changeset
286 New_Float_Result := GEF.Arctan(Y => Pi, X => 1.0, Cycle => -Pi);
kono
parents:
diff changeset
287 Report.Failed("Argument_Error not raised by the Arctan function " &
kono
parents:
diff changeset
288 "when the Cycle parameter is -Pi");
kono
parents:
diff changeset
289 Dont_Optimize_New_Float(New_Float_Result, 13);
kono
parents:
diff changeset
290 exception
kono
parents:
diff changeset
291 when Argument_Error => null; -- OK, expected exception.
kono
parents:
diff changeset
292 when others =>
kono
parents:
diff changeset
293 Report.Failed("Incorrect exception raised by the Arctan " &
kono
parents:
diff changeset
294 "function when provided a -Pi cycle parameter " &
kono
parents:
diff changeset
295 "value");
kono
parents:
diff changeset
296 end;
kono
parents:
diff changeset
297
kono
parents:
diff changeset
298
kono
parents:
diff changeset
299 -- Check that no exception is raised by the Arctan function with
kono
parents:
diff changeset
300 -- specified Cycle parameter, when provided large and small positive
kono
parents:
diff changeset
301 -- or negative parameter values for both Y and X input parameters.
kono
parents:
diff changeset
302
kono
parents:
diff changeset
303 begin
kono
parents:
diff changeset
304 Float_Result := EF.Arctan(Y => -FXA5A00.Large,
kono
parents:
diff changeset
305 X => -FXA5A00.Large,
kono
parents:
diff changeset
306 --pwb-math: Next line: changed 2.0*Pi to 360.0
kono
parents:
diff changeset
307 Cycle => 360.0);
kono
parents:
diff changeset
308 Dont_Optimize_Float(Float_Result, 14);
kono
parents:
diff changeset
309 exception
kono
parents:
diff changeset
310 when others =>
kono
parents:
diff changeset
311 Report.Failed("Exception raised when the Arctan function with " &
kono
parents:
diff changeset
312 "specified Cycle parameter, when provided large " &
kono
parents:
diff changeset
313 "negative X and Y parameter values");
kono
parents:
diff changeset
314 end;
kono
parents:
diff changeset
315
kono
parents:
diff changeset
316
kono
parents:
diff changeset
317 begin
kono
parents:
diff changeset
318 New_Float_Result := GEF.Arctan(New_Float(FXA5A00.Large),
kono
parents:
diff changeset
319 X => New_Float(-FXA5A00.Small),
kono
parents:
diff changeset
320 --pwb-math: Next line: changed 2.0*Pi to 360.0
kono
parents:
diff changeset
321 Cycle => 360.0);
kono
parents:
diff changeset
322 Dont_Optimize_New_Float(New_Float_Result, 15);
kono
parents:
diff changeset
323 exception
kono
parents:
diff changeset
324 when others =>
kono
parents:
diff changeset
325 Report.Failed("Exception raised when the Arctan function with " &
kono
parents:
diff changeset
326 "specified Cycle parameter, when provided large " &
kono
parents:
diff changeset
327 "positive Y parameter value and a small negative " &
kono
parents:
diff changeset
328 "X parameter value");
kono
parents:
diff changeset
329 end;
kono
parents:
diff changeset
330
kono
parents:
diff changeset
331
kono
parents:
diff changeset
332 begin
kono
parents:
diff changeset
333 Float_Result := EF.Arctan(Y => -FXA5A00.Small,
kono
parents:
diff changeset
334 X => -FXA5A00.Large,
kono
parents:
diff changeset
335 --pwb-math: Next line: changed 2.0*Pi to 360.0
kono
parents:
diff changeset
336 Cycle => 360.0);
kono
parents:
diff changeset
337 Dont_Optimize_Float(Float_Result, 16);
kono
parents:
diff changeset
338 exception
kono
parents:
diff changeset
339 when others =>
kono
parents:
diff changeset
340 Report.Failed("Exception raised when the Arctan function with " &
kono
parents:
diff changeset
341 "specified Cycle parameter, when provided large " &
kono
parents:
diff changeset
342 "negative Y parameter value and a large negative " &
kono
parents:
diff changeset
343 "X parameter value");
kono
parents:
diff changeset
344 end;
kono
parents:
diff changeset
345
kono
parents:
diff changeset
346 begin
kono
parents:
diff changeset
347 New_Float_Result := GEF.Arctan(New_Float(FXA5A00.Small),
kono
parents:
diff changeset
348 New_Float(FXA5A00.Large),
kono
parents:
diff changeset
349 --pwb-math: Next line: changed 2.0*Pi to 360.0
kono
parents:
diff changeset
350 360.0);
kono
parents:
diff changeset
351 Dont_Optimize_New_Float(New_Float_Result, 17);
kono
parents:
diff changeset
352 exception
kono
parents:
diff changeset
353 when others =>
kono
parents:
diff changeset
354 Report.Failed("Exception raised when the Arctan function with " &
kono
parents:
diff changeset
355 "specified Cycle parameter, when provided a " &
kono
parents:
diff changeset
356 "small negative Y parameter value and a large " &
kono
parents:
diff changeset
357 "positive X parameter value");
kono
parents:
diff changeset
358 end;
kono
parents:
diff changeset
359
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 -- Check that the Arctan function with specified Cycle parameter
kono
parents:
diff changeset
362 -- provides correct results when provided a variety of Y parameter
kono
parents:
diff changeset
363 -- input values.
kono
parents:
diff changeset
364
kono
parents:
diff changeset
365 --pwb-math if not FXA5A00.Result_Within_Range(EF.Arctan(Pi, Cycle => 2.0*Pi),
kono
parents:
diff changeset
366 --pwb-math 1.26,
kono
parents:
diff changeset
367 --pwb-math 0.01) or
kono
parents:
diff changeset
368 --pwb-math not FXA5A00.Result_Within_Range(EF.Arctan(-Pi, Cycle => 2.0*Pi),
kono
parents:
diff changeset
369 --pwb-math -1.26,
kono
parents:
diff changeset
370 --pwb-math 0.01) or
kono
parents:
diff changeset
371 --pwb-math not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 2.0*Pi),
kono
parents:
diff changeset
372 --pwb-math 0.785,
kono
parents:
diff changeset
373 --pwb-math 0.001) or
kono
parents:
diff changeset
374 --pwb-math not FXA5A00.Result_Within_Range(EF.Arctan(-1.0, Cycle => 2.0*Pi),
kono
parents:
diff changeset
375 --pwb-math -0.785,
kono
parents:
diff changeset
376 --pwb-math 0.001) or
kono
parents:
diff changeset
377 --pwb-math not FXA5A00.Result_Within_Range(GEF.Arctan(0.16, Cycle => 2.0*Pi),
kono
parents:
diff changeset
378 --pwb-math 0.159,
kono
parents:
diff changeset
379 --pwb-math 0.001) or
kono
parents:
diff changeset
380 --pwb-math not FXA5A00.Result_Within_Range(EF.Arctan(1.0, Cycle => 360.0),
kono
parents:
diff changeset
381 --pwb-math 45.0,
kono
parents:
diff changeset
382 --pwb-math 0.1) or
kono
parents:
diff changeset
383 --pwb-math not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 100.0),
kono
parents:
diff changeset
384 --pwb-math 12.5,
kono
parents:
diff changeset
385 --pwb-math 0.1)
kono
parents:
diff changeset
386
kono
parents:
diff changeset
387 --pwb-math Next 12 lines are replacements for 21 commented lines above
kono
parents:
diff changeset
388 if not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 2.0*180.0),
kono
parents:
diff changeset
389 45.0,
kono
parents:
diff changeset
390 0.001) or
kono
parents:
diff changeset
391 not FXA5A00.Result_Within_Range(EF.Arctan(-1.0, Cycle => 2.0*180.0),
kono
parents:
diff changeset
392 -45.0,
kono
parents:
diff changeset
393 0.001) or
kono
parents:
diff changeset
394 not FXA5A00.Result_Within_Range(EF.Arctan(1.0, Cycle => 360.0),
kono
parents:
diff changeset
395 45.0,
kono
parents:
diff changeset
396 0.1) or
kono
parents:
diff changeset
397 not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 100.0),
kono
parents:
diff changeset
398 12.5,
kono
parents:
diff changeset
399 0.1)
kono
parents:
diff changeset
400 then
kono
parents:
diff changeset
401 Report.Failed("Incorrect results from the Arctan function with " &
kono
parents:
diff changeset
402 "specified Cycle parameter when provided a variety " &
kono
parents:
diff changeset
403 "of Y parameter values");
kono
parents:
diff changeset
404 end if;
kono
parents:
diff changeset
405
kono
parents:
diff changeset
406
kono
parents:
diff changeset
407 exception
kono
parents:
diff changeset
408 when others => Report.Failed ("Exception raised in Test_Block");
kono
parents:
diff changeset
409 end Test_Block;
kono
parents:
diff changeset
410
kono
parents:
diff changeset
411 Report.Result;
kono
parents:
diff changeset
412
kono
parents:
diff changeset
413 end CXA5A07;