1 /* tatan -- test file for mpc_atan.
3 Copyright (C) 2009, 2012 INRIA
5 This file is part of GNU MPC.
7 GNU MPC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU Lesser General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
12 GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
17 You should have received a copy of the GNU Lesser General Public License
18 along with this program. If not, see http://www.gnu.org/licenses/ .
21 #include "mpc-tests.h"
24 /* tests intermediate underflow; WONTFIX */
29 mpfr_exp_t emin = mpfr_get_emin ();
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))
41 printf ("Error in test_coverage\n");
42 printf ("expected (-1066635/2^20 1687619/2^22)\n");
44 mpc_out_str (stdout, 10, 20, z, MPC_RNDNN);
57 DECL_FUNC (CC, f, mpc_atan);
61 data_check (f, "atan.dat");
62 tgeneric (f, 2, 512, 5, 128);