1*0bfacb9bSmrg
2*0bfacb9bSmrg
3*0bfacb9bSmrg/* Stub for defining degree-valued trigonemetric functions using MPFR.
4*0bfacb9bSmrg   Copyright (C) 2000-2020 Free Software Foundation, Inc.
5*0bfacb9bSmrg   Contributed by Fritz Reese <foreese@gcc.gnu.org>
6*0bfacb9bSmrg   and Steven G. Kargl <kargl@gcc.gnu.org>
7*0bfacb9bSmrg
8*0bfacb9bSmrgThis file is part of GCC.
9*0bfacb9bSmrg
10*0bfacb9bSmrgGCC is free software; you can redistribute it and/or modify it under
11*0bfacb9bSmrgthe terms of the GNU General Public License as published by the Free
12*0bfacb9bSmrgSoftware Foundation; either version 3, or (at your option) any later
13*0bfacb9bSmrgversion.
14*0bfacb9bSmrg
15*0bfacb9bSmrgGCC is distributed in the hope that it will be useful, but WITHOUT ANY
16*0bfacb9bSmrgWARRANTY; without even the implied warranty of MERCHANTABILITY or
17*0bfacb9bSmrgFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18*0bfacb9bSmrgfor more details.
19*0bfacb9bSmrg
20*0bfacb9bSmrgYou should have received a copy of the GNU General Public License
21*0bfacb9bSmrgalong with GCC; see the file COPYING3.  If not see
22*0bfacb9bSmrg<http://www.gnu.org/licenses/>.  */
23*0bfacb9bSmrg
24*0bfacb9bSmrg#define FTYPE mpfr_t
25*0bfacb9bSmrg#define RETTYPE void
26*0bfacb9bSmrg#define RETURN(x) do { } while (0)
27*0bfacb9bSmrg#define ITYPE mpz_t
28*0bfacb9bSmrg
29*0bfacb9bSmrg#define ISFINITE(x) mpfr_number_p(x)
30*0bfacb9bSmrg#define D2R(x) deg2rad(x)
31*0bfacb9bSmrg
32*0bfacb9bSmrg#define ENABLE_SIND
33*0bfacb9bSmrg#define ENABLE_COSD
34*0bfacb9bSmrg#define ENABLE_TAND
35*0bfacb9bSmrg
36*0bfacb9bSmrg#define SIND simplify_sind
37*0bfacb9bSmrg#define COSD simplify_cosd
38*0bfacb9bSmrg#define TAND simplify_tand
39*0bfacb9bSmrg
40*0bfacb9bSmrg/* cosd(30) === sqrt(3) / 2.  */
41*0bfacb9bSmrg#define SET_COSD30(x) do { \
42*0bfacb9bSmrg    mpfr_set_ui (x, 3, GFC_RND_MODE); \
43*0bfacb9bSmrg    mpfr_sqrt (x, x, GFC_RND_MODE); \
44*0bfacb9bSmrg    mpfr_div_ui (x, x, 2, GFC_RND_MODE); \
45*0bfacb9bSmrg  } while (0)
46*0bfacb9bSmrg
47*0bfacb9bSmrgstatic RETTYPE SIND (FTYPE);
48*0bfacb9bSmrgstatic RETTYPE COSD (FTYPE);
49*0bfacb9bSmrgstatic RETTYPE TAND (FTYPE);
50*0bfacb9bSmrg
51*0bfacb9bSmrg#include "../../libgfortran/intrinsics/trigd.inc"
52*0bfacb9bSmrg
53*0bfacb9bSmrg/* vim: set ft=c: */
54