%%
%% This is file `xinttrig.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xint.dtx  (with options: `xinttrig')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from xinttrig.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file xint.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
%% The xint bundle 1.4 2020/01/31
%% Copyright (C) 2013-2020 by Jean-Francois Burnol
%% xinttrig: Trigonometry for the xintexpr package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \catcode94=7    % ^
  \def\z{\endgroup}%
  \def\empty{}\def\space{ }\newlinechar10
  \expandafter\let\expandafter\w\csname ver@xintexpr.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info:^^J%
                 \space\space\space\space#2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xinttrig}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\w\relax % xintexpr.sty not yet loaded.
        \y{xinttrig}%
          {Loading should be via \ifx\x\empty\string\usepackage{xintexpr.sty}
                          \else\string\input\space xintexpr.sty \fi
           rather, aborting}%
         \aftergroup\endinput
    \fi
  \fi
\z%
\catcode`_ 11 \XINT_setcatcodes \catcode`? 12
\ifcsname xintlibver@trig\endcsname
  \expandafter\xint_firstoftwo
\else
  \expandafter\xint_secondoftwo
\fi
{\immediate\write-1{Reloading xinttrig library using Digits=\xinttheDigits.}}%
{\expandafter\gdef\csname xintlibver@trig\endcsname{2020/01/31 v1.4}%
\XINT_providespackage
\ProvidesPackage{xinttrig}%
[2020/01/31 v1.4 Trigonometrical functions for xintexpr (JFB)]%
}%
\xintFor* #1 in {iDTVtuwxyzX}\do{\xintensuredummy{#1}}%
\def\xintreloadxinttrig
   {\edef\XINT_restorecatcodes_now{\XINT_restorecatcodes}%
    \XINT_setcatcodes\catcode`? 12
    \input xinttrig.sty
    \XINT_restorecatcodes_now}%
\xintdeffloatvar twoPi        := 0 +
    6.28318530717958647692528676655900576839433879875021164194989;%
\xintdeffloatvar threePiover2 := 0 +
    4.71238898038468985769396507491925432629575409906265873146242;%
\xintdeffloatvar Pi           := 0 +
    3.14159265358979323846264338327950288419716939937510582097494;%
\xintdeffloatvar Piover2      := 0 +
    1.57079632679489661923132169163975144209858469968755291048747;%
\xintdeffloatvar oneDegree := 0 +
    0.0174532925199432957692369076848861271344287188854172545609719;% Pi/180
\xintdeffloatvar oneRadian := 0 +
    57.2957795130823208767981548141051703324054724665643215491602;%   180/Pi
\xintdeffloatvar invfact\xintListWithSep{, invfact}{\xintSeq{2}{44}}%
     := \xintfloatexpr [\XINTdigits]  % force float rounding after exact evaluations
            \xintexpr rseq(1/2{;}@/i, i=3..44)\relax % need to hide inner ; from \xintdeffloatvar
        \relax;%
\xintdeffloatfunc sin_aux(X) := 1 - X(invfact3 - X(invfact5
\ifnum\XINTdigits>4
                           - X(invfact7
\ifnum\XINTdigits>6
                           - X(invfact9
\ifnum\XINTdigits>8
                           - X(invfact11
\ifnum\XINTdigits>10
                           - X(invfact13
\ifnum\XINTdigits>13
                           - X(invfact15
\ifnum\XINTdigits>15
                           - X(invfact17
\ifnum\XINTdigits>18
                           - X(invfact19
\ifnum\XINTdigits>21
                           - X(invfact21
\ifnum\XINTdigits>24
                           - X(invfact23
\ifnum\XINTdigits>27
                           - X(invfact25
\ifnum\XINTdigits>30
                           - X(invfact27
\ifnum\XINTdigits>33
                           - X(invfact29
\ifnum\XINTdigits>36
                           - X(invfact31
\ifnum\XINTdigits>39
                           - X(invfact33
\ifnum\XINTdigits>43
                           - X(invfact35
\ifnum\XINTdigits>46
                           - X(invfact37
\ifnum\XINTdigits>49
                           - X(invfact39
\ifnum\XINTdigits>53
                           - X(invfact41
\ifnum\XINTdigits>59
                           - X(invfact43
    )\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi));%
\xintdeffloatfunc cos_aux(X) := 1 - X(invfact2 - X(invfact4
\ifnum\XINTdigits>3
                           - X(invfact6
\ifnum\XINTdigits>5
                           - X(invfact8
\ifnum\XINTdigits>7
                           - X(invfact10
\ifnum\XINTdigits>9
                           - X(invfact12
\ifnum\XINTdigits>12
                           - X(invfact14
\ifnum\XINTdigits>14
                           - X(invfact16
\ifnum\XINTdigits>17
                           - X(invfact18
\ifnum\XINTdigits>20
                           - X(invfact20
\ifnum\XINTdigits>23
                           - X(invfact22
\ifnum\XINTdigits>25
                           - X(invfact24
\ifnum\XINTdigits>28
                           - X(invfact26
\ifnum\XINTdigits>32
                           - X(invfact28
\ifnum\XINTdigits>35
                           - X(invfact30
\ifnum\XINTdigits>38
                           - X(invfact32
\ifnum\XINTdigits>41
                           - X(invfact34
\ifnum\XINTdigits>44
                           - X(invfact36
\ifnum\XINTdigits>48
                           - X(invfact38
\ifnum\XINTdigits>51
                           - X(invfact40
\ifnum\XINTdigits>55
                           - X(invfact42
\ifnum\XINTdigits>58
                           - X(invfact44
    )\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi)\fi));%
\expandafter\let\csname XINT_expr_func_sin_aux\expandafter\endcsname
                \csname XINT_flexpr_func_sin_aux\endcsname
\expandafter\let\csname XINT_expr_func_cos_aux\expandafter\endcsname
                \csname XINT_flexpr_func_cos_aux\endcsname
\xintdeffloatfunc sin_(x) := x * sin_aux(sqr(x));%
\xintdeffloatfunc cos_(x) := cos_aux(sqr(x));%
\def\XINT_mod_ccclx_i #1.% input <k>.<N>. k is a non-negative exponent
{%
    \expandafter\XINT_mod_ccclx_e\the\numexpr
    \expandafter\XINT_mod_ccclx_j\the\numexpr1\ifcase#1 \or0\or00\else000\fi.%
}%
\def\XINT_mod_ccclx_j 1#1.#2.% #2=N is a non-negative mantissa
{%
    (\XINT_mod_ccclx_ja {++}#2#1\XINT_mod_ccclx_jb 0000000\relax
}%                                   1     2345678
\def\XINT_mod_ccclx_ja #1#2#3#4#5#6#7#8#9%
{%
    #9+#8+#7+#6+#5+#4+#3+#2\xint_firstoftwo{+\XINT_mod_ccclx_ja{+#9+#8+#7}}{#1}%
}%
\def\XINT_mod_ccclx_jb #1\xint_firstoftwo#2#3{#1+0)*280\XINT_mod_ccclx_jc #1#3}%
\def\XINT_mod_ccclx_jc  +#1+#2+#3#4\relax{+80*(#3+#2+#1)+#3#2#1.}%
\def\XINT_mod_ccclx_e#1.{\expandafter\XINT_mod_ccclx_z\the\numexpr(#1+180)/360-1.#1.}%
\def\XINT_mod_ccclx_z#1.#2.{#2-360*#1.}%
\def\XINT_flexpr_func_sind_ #1#2#3%
{%
    \expandafter #1\expandafter #2\expandafter{%
    \romannumeral`&&@\XINT:NEhook:f:one:from:one{\romannumeral`&&@\xintSind#3}}%
}%
\def\XINT_expr_unlock{\expandafter\xint_firstofone\romannumeral`&&@}%
\def\xintSind#1{\romannumeral`&&@\expandafter\xintsind
                \romannumeral0\XINTinfloatS[\XINTdigits]{#1}}%
\def\xintsind #1[#2#3]%
{%
    \xint_UDsignfork
      #2\XINT_sind
       -\XINT_sind_int
    \krof#2#3.#1..%<< attention extra dot
}%
\def\XINT_sind #1.#2.% NOT TO BE USED WITH VANISHING (OR NEGATIVE) #2.
{%
    \expandafter\XINT_sind_a
    \romannumeral0\xinttrunc{\XINTdigits}{#2[#1]}%
}%
\def\XINT_sind_a{\expandafter\XINT_sind_i\the\numexpr\XINT_mod_ccclx_i0.}%
\def\XINT_sind_int
{%
    \expandafter\XINT_sind_i\the\numexpr\expandafter\XINT_mod_ccclx_i
}%
\def\XINT_sind_i #1.% range reduction inside [0, 360[
{%
    \ifcase\numexpr#1/90\relax
       \expandafter\XINT_sind_A
    \or\expandafter\XINT_sind_B\the\numexpr-90+%
    \or\expandafter\XINT_sind_C\the\numexpr-180+%
    \or\expandafter\XINT_sind_D\the\numexpr-270+%
    \else\expandafter\XINT_sind_E\the\numexpr-360+%
    \fi#1.%
}%
\def\XINT_sind_A#1{%
\def\XINT_sind_A##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_sind_A\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_sind_B#1{\xint_UDsignfork#1\XINT_sind_B_n-\XINT_sind_B_p\krof #1}%
\def\XINT_tmpa#1{%
\def\XINT_sind_B_n-##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
\def\XINT_sind_B_p##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_tmpa\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_sind_C#1{\xint_UDsignfork#1\XINT_sind_C_n-\XINT_sind_C_p\krof #1}%
\def\XINT_tmpa#1{%
\def\XINT_sind_C_n-##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
\def\XINT_sind_C_p##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_tmpa\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_sind_D#1{\xint_UDsignfork#1\XINT_sind_D_n-\XINT_sind_D_p\krof #1}%
\def\XINT_tmpa#1{%
\def\XINT_sind_D_n-##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
\def\XINT_sind_D_p##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_tmpa\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_sind_E#1{%
\def\XINT_sind_E-##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
}\expandafter
\XINT_sind_E\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_flexpr_func_cosd_ #1#2#3%
{%
    \expandafter #1\expandafter #2\expandafter{%
    \romannumeral`&&@\XINT:NEhook:f:one:from:one{\romannumeral`&&@\xintCosd#3}}%
}%
\def\xintCosd#1{\romannumeral`&&@\expandafter\xintcosd
                \romannumeral0\XINTinfloatS[\XINTdigits]{#1}}%
\def\xintcosd #1[#2#3]%
{%
    \xint_UDsignfork
      #2\XINT_cosd
       -\XINT_cosd_int
    \krof#2#3.#1..%<< attention extra dot
}%
\def\XINT_cosd #1.#2.% NOT TO BE USED WITH VANISHING (OR NEGATIVE) #2.
{%
    \expandafter\XINT_cosd_a
    \romannumeral0\xinttrunc{\XINTdigits}{#2[#1]}%
}%
\def\XINT_cosd_a{\expandafter\XINT_cosd_i\the\numexpr\XINT_mod_ccclx_i0.}%
\def\XINT_cosd_int
{%
    \expandafter\XINT_cosd_i\the\numexpr\expandafter\XINT_mod_ccclx_i
}%
\def\XINT_cosd_i #1.%
{%
    \ifcase\numexpr#1/90\relax
       \expandafter\XINT_cosd_A
    \or\expandafter\XINT_cosd_B\the\numexpr-90+%
    \or\expandafter\XINT_cosd_C\the\numexpr-180+%
    \or\expandafter\XINT_cosd_D\the\numexpr-270+%
    \else\expandafter\XINT_cosd_E\the\numexpr-360+%
    \fi#1.%
}%
\def\XINT_cosd_A#1{%
\def\XINT_cosd_A##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_cosd_A\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_cosd_B#1{\xint_UDsignfork#1\XINT_cosd_B_n-\XINT_cosd_B_p\krof #1}%
\def\XINT_tmpa#1{%
\def\XINT_cosd_B_n-##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
\def\XINT_cosd_B_p##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_tmpa\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_cosd_C#1{\xint_UDsignfork#1\XINT_cosd_C_n-\XINT_cosd_C_p\krof #1}%
\def\XINT_tmpa#1{%
\def\XINT_cosd_C_n-##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
\def\XINT_cosd_C_p##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_tmpa\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_cosd_D#1{\xint_UDsignfork#1\XINT_cosd_D_n-\XINT_cosd_D_p\krof #1}%
\def\XINT_tmpa#1{%
\def\XINT_cosd_D_n-##1.##2.%
{%
    \xintiiopp\XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
\def\XINT_cosd_D_p##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_sin_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{##1.##2}#1}}%
}%
}\expandafter
\XINT_tmpa\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\def\XINT_cosd_E#1{%
\def\XINT_cosd_E-##1.##2.%
{%
    \XINT_expr_unlock\expandafter\XINT_flexpr_userfunc_cos_\expandafter
         {\romannumeral0\XINTinfloat[\XINTdigits]{\xintMul{\xintSub{##1[0]}{.##2}}#1}}%
}%
}\expandafter
\XINT_cosd_E\expandafter{\romannumeral`&&@\xintthebarefloateval oneDegree\relax}%
\xintdeffloatfunc sind(x) := (x)??
                              {(x>=-45)?
                                {sin_(x*oneDegree)}
                                {-sind_(-x)}
                              }
                              {0}
                              {(x<=45)?
                                {sin_(x*oneDegree)}
                                {sind_(x)}
                              }
                              ;%
\xintdeffloatfunc cosd(x) := (x)??
                              {(x>=-45)?
                                {cos_(x*oneDegree)}
                                {cosd_(-x)}
                              }
                              {1}
                              {(x<=45)?
                                {cos_(x*oneDegree)}
                                {cosd_(x)}
                              }
                              ;%
\xintdeffloatfunc sin(x):= (abs(x)<0.79)?
                            {sin_(x)}
                            {(x)??
                              {-sind_(-x*oneRadian)}
                              {0}
                              {sind_(x*oneRadian)}
                            }
                            ;%
\xintdeffloatfunc cos(x):= (abs(x)<0.79)?
                             {cos_(x)}
                             {cosd_(abs(x*oneRadian))}
                             ;%
\xintdeffloatfunc sinc(x):= (abs(x)<0.79) ?
                             {sin_aux(sqr(x))}
                             {sind_(abs(x)*oneRadian)/abs(x)}
                             ;%
\xintdeffloatfunc tand(x):= sind(x)/cosd(x);%
\xintdeffloatfunc cotd(x):= cosd(x)/sind(x);%
\xintdeffloatfunc tan(x) := (x)??
                             {(x>-0.79)?
                               {sin(x)/cos(x)}
                               {-cotd(90+x*oneRadian)
                               }
                             }
                             {0}
                             {(x<0.79)?
                               {sin(x)/cos(x)}
                               {cotd(90-x*oneRadian)}
                             }
                             ;%
\xintdeffloatfunc cot(x) := (abs(x)<0.79)?
                              {cos(x)/sin(x)}
                              {(x)??
                                {-tand(90+x*oneRadian)}
                                {0}
                                {tand(90-x*oneRadian)}
                              };%
\xintdeffloatfunc sec(x) := inv(cos(x));%
\xintdeffloatfunc csc(x) := inv(sin(x));%
\xintdeffloatfunc secd(x):= inv(cosd(x));%
\xintdeffloatfunc cscd(x):= inv(sind(x));%
\xintdeffloatfunc asin_aux(X) := 1
\ifnum\XINTdigits>3 % actually 4 would achieve 1ulp in place of <0.5ulp
                           + X(1/6
\ifnum\XINTdigits>9
                           + X(3/40
\ifnum\XINTdigits>16
                           + X(5/112
\ifnum\XINTdigits>25
                           + X(35/1152
\ifnum\XINTdigits>35
                           + X(63/2816
\ifnum\XINTdigits>46
                           + X(231/13312
                           )\fi)\fi)\fi)\fi)\fi)\fi;%
\xintdeffloatfunc asin_o(D, T) := T + D*asin_aux(sqr(D));%
\xintdeffloatfunc asin_n(V, T, t, u) :=% V is square of T
                   asin_o (\xintexpr t*cos_aux(V) - u*T*sin_aux(V)\relax, T);%
\xintdeffloatfunc asin_m(T, t, u) := asin_n(sqr(T), T, t, u);%
\xintdeffloatfunc asin_l(t, u)    := asin_m(t*asin_aux(sqr(t)), t, u);%
\xintdeffloatfunc asin_a(t, u) := (t<u)?
                                   {asin_l(t, u)}
                                   {Piover2 - asin_l(u, t)}
                                   ;%
\xintdeffloatfunc asind_a(t, u):= (t<u)?
                                   {asin_l(t, u) * oneRadian}
                                   {90 - asin_l(u, t) * oneRadian}
                                   ;%
\xintdeffloatfunc asin(t) := (t)??
                              {-asin_a(-t, sqrt_(1-sqr(t)))}
                              {0}
                              {asin_a(t, sqrt_(1-sqr(t)))}
                              ;%
\xintdeffloatfunc asind(t) := (t)??
                               {-asind_a(-t, sqrt_(1-sqr(t)))}
                               {0}
                               {asind_a(t, sqrt_(1-sqr(t)))}
                               ;%
\xintdeffloatfunc acos(t) := Piover2 - asin(t);%
\xintdeffloatfunc acosd(t):= 90 - asind(t);%
\xintdeffloatfunc atan_b(t, w, z):= 0.5 * (w< 0)?
                                           {Pi - asin_a(2z * t, -w*z)}
                                           {asin_a(2z * t, w*z)}
                                           ;%
\xintdeffloatfunc atan_a(t, T) := atan_b(t, 1-T, inv(1+T));%
\xintdeffloatfunc atan(t):= (t)??
                             {-atan_a(-t, sqr(t))}
                             {0}
                             {atan_a(t, sqr(t))}
                             ;%
\xintdeffloatfunc atand_b(t, w, z) := 0.5 * (w< 0)?
                                             {180 - asind_a(2z * t, -w*z)}
                                             {asind_a(2z * t, w*z)}
                                             ;%
\xintdeffloatfunc atand_a(t, T) := atand_b(t, 1-T, inv(1+T));%
\xintdeffloatfunc atand(t) := (t)??
                               {-atand_a(-t, sqr(t))}
                               {0}
                               {atand_a(t, sqr(t))}
                               ;%
\xintdeffloatfunc Arg(x, y):= (y>x)?
                               {(y>-x)?
                                 {Piover2 - atan(x/y)}
                                 {(y<0)?
                                   {-Pi + atan(y/x)}
                                   {Pi + atan(y/x)}
                                 }
                               }
                               {(y>-x)?
                                 {atan(y/x)}
                                 {-Piover2 + atan(x/-y)}
                               }
                               ;%
\xintdeffloatfunc atan2(y,x) := Arg(x, y);%
\xintdeffloatfunc Argd(x, y):= (y>x)?
                                {(y>-x)?
                                  {90 - atand(x/y)}
                                  {(y<0)?
                                    {-180 + atand(y/x)}
                                    {180 + atand(y/x)}
                                  }
                                }
                                {(y>-x)?
                                  {atand(y/x)}
                                  {-90 + atand(x/-y)}
                                }
                                ;%
\xintdeffloatfunc atan2d(y,x) := Argd(x, y);%
\xintdeffloatfunc pArg(x, y):= (y>x)?
                                {(y>-x)?
                                  {Piover2 - atan(x/y)}
                                  {Pi + atan(y/x)}
                                }
                                {(y>-x)?
                                  {(y<0)?
                                    {twoPi + atan(y/x)}
                                    {atan(y/x)}
                                  }
                                  {threePiover2 + atan(x/-y)}
                                }
                                ;%
\xintdeffloatfunc pArgd(x, y):=(y>x)?
                                {(y>-x)?
                                  {90 - atan(x/y)*oneRadian}
                                  {180 + atan(y/x)*oneRadian}
                                }
                                {(y>-x)?
                                  {(y<0)?
                                    {360 + atan(y/x)*oneRadian}
                                    {atan(y/x)*oneRadian}
                                  }
                                  {270 + atan(x/-y)*oneRadian}
                                }
                                ;%
\expandafter\let\csname XINT_flexpr_func_tg\expandafter\endcsname
                \csname XINT_flexpr_func_tan\endcsname
\expandafter\let\csname XINT_flexpr_func_cotg\expandafter\endcsname
                \csname XINT_flexpr_func_cot\endcsname
\xintFor #1 in {sin, cos, tan, sec, csc, cot,
                asin, acos, atan}\do
{%
    \xintdeffunc #1(x) := \xintfloatexpr #1(sfloat(x))\relax;%
    \xintdeffunc #1d(x):= \xintfloatexpr #1d(sfloat(x))\relax;%
}%
\xintFor #1 in {Arg, pArg, atan2}\do
{%
    \xintdeffunc #1(x, y) := \xintfloatexpr #1(sfloat(x), sfloat(y))\relax;%
    \xintdeffunc #1d(x, y):= \xintfloatexpr #1d(sfloat(x), sfloat(y))\relax;%
}%
\xintdeffunc tg(x)  := \xintfloatexpr tg(sfloat(x))\relax;%
\xintdeffunc cotg(x):= \xintfloatexpr cotg(sfloat(x))\relax;%
\xintdeffunc sinc(x):= \xintfloatexpr sinc(sfloat(x))\relax;%
\xintFor* #1 in {iDTVtuwxyzX}\do{\xintrestorevariable{#1}}%
\endinput
%%
%% End of file `xinttrig.sty'.
