1/* tatan -- test file for mpc_atan.
2
3Copyright (C) 2009, 2012 INRIA
4
5This file is part of GNU MPC.
6
7GNU MPC is free software; you can redistribute it and/or modify it under
8the terms of the GNU Lesser General Public License as published by the
9Free Software Foundation; either version 3 of the License, or (at your
10option) any later version.
11
12GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15more details.
16
17You should have received a copy of the GNU Lesser General Public License
18along with this program. If not, see http://www.gnu.org/licenses/ .
19*/
20
21#include "mpc-tests.h"
22
23#if 0
24/* tests intermediate underflow; WONTFIX */
25static int
26test_underflow (void)
27{
28  mpc_t z;
29  mpfr_exp_t emin = mpfr_get_emin ();
30
31  mpfr_set_emin (-10);
32  mpc_init2 (z, 21);
33  mpfr_set_si (mpc_realref(z), -1, GMP_RNDZ);
34  mpfr_set_ui_2exp (mpc_imagref(z), 1, 20, GMP_RNDZ);
35  mpfr_add_ui (mpc_imagref(z), mpc_imagref(z), 1, GMP_RNDZ);
36  mpfr_div_2exp (mpc_imagref(z), mpc_imagref(z), 20, GMP_RNDZ);
37  mpc_atan (z, z, MPC_RNDNN);
38  if (mpfr_cmp_si_2exp (mpc_realref(z), -1066635, 20) != 0 ||
39      mpfr_cmp_si_2exp (mpc_imagref(z), 1687619, 22))
40    {
41      printf ("Error in test_coverage\n");
42      printf ("expected (-1066635/2^20 1687619/2^22)\n");
43      printf ("got      ");
44      mpc_out_str (stdout, 10, 20, z, MPC_RNDNN);
45      printf ("\n");
46      exit (1);
47    }
48  mpc_clear (z);
49  mpfr_set_emin (emin);
50}
51#endif
52
53
54int
55main (void)
56{
57  DECL_FUNC (CC, f, mpc_atan);
58
59  test_start ();
60
61  data_check (f, "atan.dat");
62  tgeneric (f, 2, 512, 5, 128);
63
64  test_end ();
65
66  return 0;
67}
68
69