Blame tests/tcos.c

Packit 80c72f
/* tcos -- test file for mpc_cos.
Packit 80c72f
Packit 80c72f
Copyright (C) 2008, 2009, 2011 INRIA
Packit 80c72f
Packit 80c72f
This file is part of GNU MPC.
Packit 80c72f
Packit 80c72f
GNU MPC is free software; you can redistribute it and/or modify it under
Packit 80c72f
the terms of the GNU Lesser General Public License as published by the
Packit 80c72f
Free Software Foundation; either version 3 of the License, or (at your
Packit 80c72f
option) any later version.
Packit 80c72f
Packit 80c72f
GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
Packit 80c72f
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
Packit 80c72f
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
Packit 80c72f
more details.
Packit 80c72f
Packit 80c72f
You should have received a copy of the GNU Lesser General Public License
Packit 80c72f
along with this program. If not, see http://www.gnu.org/licenses/ .
Packit 80c72f
*/
Packit 80c72f
Packit 80c72f
#include "mpc-tests.h"
Packit 80c72f
Packit 80c72f
static void
Packit 80c72f
bug20090105 (void)
Packit 80c72f
{
Packit 80c72f
  /* this bug appeared on 32-bits machines */
Packit 80c72f
  mpc_t op, expected, got;
Packit 80c72f
  mpc_init2 (op, 324);
Packit 80c72f
  mpc_init2 (expected, 324);
Packit 80c72f
  mpc_init2 (got, 324);
Packit 80c72f
Packit 80c72f
  mpfr_set_str (mpc_realref(op), "-3.f1813b1487372434fea4414a520f65a343a16d0ec1ffb"
Packit 80c72f
                "b2b880154db8d63377ce788fc4215c450300@1", 16, GMP_RNDN);
Packit 80c72f
  mpfr_set_str (mpc_imagref(op), "-2.b7a0c80bcacf1ccbbac614bf53a58b672b1b503161bee"
Packit 80c72f
                "59a82e46a23570b652f7ba5f01ef766d1c50", 16,GMP_RNDN);
Packit 80c72f
  mpfr_set_str (mpc_realref(expected), "7.57c5b08a2b11b660d906a354289b0724b9c4b237"
Packit 80c72f
                "95abe33424e8d9858e534bd5d776ddd18e34b0240", 16, GMP_RNDN);
Packit 80c72f
  mpfr_set_str (mpc_imagref(expected), "-1.f41a389646d068e0263561cb3c5d1df763945ad"
Packit 80c72f
                "ed9339f2a98387a3c4f97dbfd8a08b7d0af2f11b46", 16,GMP_RNDN);
Packit 80c72f
Packit 80c72f
  mpc_cos (got, op, MPC_RNDNN);
Packit 80c72f
  if (mpc_cmp (got, expected) != 0)
Packit 80c72f
    TEST_FAILED ("mpc_cos", op, got, expected, MPC_RNDNN);
Packit 80c72f
Packit 80c72f
  mpc_clear (got);
Packit 80c72f
  mpc_clear(expected);
Packit 80c72f
  mpc_clear (op);
Packit 80c72f
}
Packit 80c72f
Packit 80c72f
int
Packit 80c72f
main (void)
Packit 80c72f
{
Packit 80c72f
  DECL_FUNC (CC, f, mpc_cos);
Packit 80c72f
Packit 80c72f
  test_start ();
Packit 80c72f
Packit 80c72f
  data_check (f, "cos.dat");
Packit 80c72f
  tgeneric (f, 2, 512, 7, 7);
Packit 80c72f
Packit 80c72f
  bug20090105 ();
Packit 80c72f
Packit 80c72f
  test_end ();
Packit 80c72f
Packit 80c72f
  return 0;
Packit 80c72f
}