summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xinttrig.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-10 19:49:04 +0000
committerKarl Berry <karl@freefriends.org>2021-05-10 19:49:04 +0000
commit65bc243624a3973be87939de8f9f326a91cbcb39 (patch)
tree3250df7c151f2c5e70096d18dd526338a60a2df9 /Master/texmf-dist/tex/generic/xint/xinttrig.sty
parent36e408020a45d0bfe67eb3f524f4fdf0f4d9aefa (diff)
xint (10may21)
git-svn-id: svn://tug.org/texlive/trunk@59161 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xinttrig.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xinttrig.sty130
1 files changed, 66 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xinttrig.sty b/Master/texmf-dist/tex/generic/xint/xinttrig.sty
index c10106cb894..0b23eaed1d7 100644
--- a/Master/texmf-dist/tex/generic/xint/xinttrig.sty
+++ b/Master/texmf-dist/tex/generic/xint/xinttrig.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.4e 2021/05/05
+%% The xint bundle 1.4f 2021/05/10
%% Copyright (C) 2013-2021 by Jean-Francois Burnol
%% xinttrig: Trigonometry for the xintexpr package
%% ---------------------------------------------------------------
@@ -69,37 +69,37 @@
\expandafter\xint_secondoftwo
\fi
{\immediate\write-1{Reloading xinttrig library using Digits=\xinttheDigits.}}%
-{\expandafter\gdef\csname xintlibver@trig\endcsname{2021/05/05 v1.4e}%
+{\expandafter\gdef\csname xintlibver@trig\endcsname{2021/05/10 v1.4f}%
\XINT_providespackage
\ProvidesPackage{xinttrig}%
-[2021/05/05 v1.4e Trigonometrical functions for xintexpr (JFB)]%
+[2021/05/10 v1.4f Trigonometrical functions for xintexpr (JFB)]%
}%
\xintFor* #1 in {iDTVtuwxyzX}\do{\xintensuredummy{#1}}%
\def\xintreloadxinttrig{\input xinttrig.sty }%
\xintdefvar @twoPi :=
float(
6.2831853071795864769252867665590057683943387987502116419498891846156328125724180
- ,\xinttheDigits+4);%
+ ,\XINTdigitsormax+4);%
\xintdefvar @threePiover2 :=
float(
4.7123889803846898576939650749192543262957540990626587314624168884617246094293135
- ,\xinttheDigits+4);%
+ ,\XINTdigitsormax+4);%
\xintdefvar @Pi :=
float(
3.1415926535897932384626433832795028841971693993751058209749445923078164062862090
- ,\xinttheDigits+4);%
+ ,\XINTdigitsormax+4);%
\xintdefvar @Piover2 :=
float(
1.5707963267948966192313216916397514420985846996875529104874722961539082031431045
- ,\xinttheDigits+4);%
+ ,\XINTdigitsormax+4);%
\xintdefvar @oneDegree :=
float(
0.017453292519943295769236907684886127134428718885417254560971914401710091146034494
- ,\xinttheDigits+4);%
+ ,\XINTdigitsormax+4);%
\xintdefvar @oneRadian :=
float(
57.295779513082320876798154814105170332405472466564321549160243861202847148321553
- ,\xinttheDigits+12);%
+ ,\XINTdigitsormax+12);%
\catcode`~ 12
\def\XINT_tmpa#1#2#3.#4.%
{%
@@ -109,19 +109,19 @@
\expandafter\XINT_tmpa
\csname XINT_flexpr_exec_+_\expandafter\endcsname
\csname XINT_flexpr_exec_+\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatAdd_wopt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatAdd_wopt.%
\expandafter\XINT_tmpa
\csname XINT_flexpr_exec_-_\expandafter\endcsname
\csname XINT_flexpr_exec_-\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatSub_wopt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatSub_wopt.%
\expandafter\XINT_tmpa
\csname XINT_flexpr_exec_*_\expandafter\endcsname
\csname XINT_flexpr_exec_*\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatMul_wopt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatMul_wopt.%
\expandafter\XINT_tmpa
\csname XINT_flexpr_exec_/_\expandafter\endcsname
\csname XINT_flexpr_exec_/\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatDiv_wopt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatDiv_wopt.%
\def\XINT_tmpa#1#2#3.#4.%
{%
\let #1#2%
@@ -130,23 +130,23 @@
\expandafter\XINT_tmpa
\csname XINT_flexpr_sqrfunc\expandafter\endcsname
\csname XINT_flexpr_func_sqr\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatSqr_wopt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatSqr_wopt.%
\expandafter\XINT_tmpa
\csname XINT_flexpr_sqrtfunc\expandafter\endcsname
\csname XINT_flexpr_func_sqrt\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatSqrt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatSqrt.%
\expandafter\XINT_tmpa
\csname XINT_flexpr_invfunc\expandafter\endcsname
\csname XINT_flexpr_func_inv\expandafter\endcsname
- \the\numexpr\XINTdigits+4.~XINTinFloatInv_wopt.%
+ \the\numexpr\XINTdigitsormax+4.~XINTinFloatInv_wopt.%
\catcode`~ 3
\ifnum\XINTdigits>8
\edef\XINT_tmpG % 1/3!
- {1\xintReplicate{\XINTdigits+2}{6}7[\the\numexpr-\XINTdigits-4]}%
+ {1\xintReplicate{\XINTdigitsormax+2}{6}7[\the\numexpr-\XINTdigitsormax-4]}%
\edef\XINT_tmpH % 1/5!
- {8\xintReplicate{\XINTdigits+1}{3}[\the\numexpr-\XINTdigits-4]}%
+ {8\xintReplicate{\XINTdigitsormax+1}{3}[\the\numexpr-\XINTdigitsormax-4]}%
\edef\XINT_tmpd % 1/5!
- {8\xintReplicate{\XINTdigits+9}{3}[\the\numexpr-\XINTdigits-12]}%
+ {8\xintReplicate{\XINTdigitsormax+9}{3}[\the\numexpr-\XINTdigitsormax-12]}%
\def\XINT_tmpe#1.#2.#3.#4.#5#6#7%
{%
\def#5##1\xint:
@@ -163,8 +163,8 @@
}%
}%
\expandafter\XINT_tmpe
- \the\numexpr\XINTdigits+4\expandafter.%
- \the\numexpr\XINTdigits+2\expandafter.\expanded{%
+ \the\numexpr\XINTdigitsormax+4\expandafter.%
+ \the\numexpr\XINTdigitsormax+2\expandafter.\expanded{%
\XINT_tmpH.% 1/5!
\XINT_tmpG.% 1/3!
\expandafter}%
@@ -206,13 +206,13 @@
\csname XINT_#8Aux_series_c_\romannumeral\numexpr#1-2\expandafter\endcsname
\csname XINT_#8Aux_series_c_\romannumeral\numexpr#1-3\endcsname
\edef\XINT_tmpd
- {\XINTinFloat[\XINTdigits-#2+8]{\xintDiv{\XINT_tmpd}{\the\numexpr#5*(#5-1)\relax}}}%
+ {\XINTinFloat[\XINTdigitsormax-#2+8]{\xintDiv{\XINT_tmpd}{\the\numexpr#5*(#5-1)\relax}}}%
\let\XINT_tmpF\XINT_tmpG
\let\XINT_tmpG\XINT_tmpH
- \edef\XINT_tmpH{\XINTinFloat[\XINTdigits-#2]{\XINT_tmpd}}%
+ \edef\XINT_tmpH{\XINTinFloat[\XINTdigitsormax-#2]{\XINT_tmpd}}%
\expandafter\XINT_tmpc
- \the\numexpr\XINTdigits-#3\expandafter.%
- \the\numexpr\XINTdigits-#2\expandafter.\expanded{%
+ \the\numexpr\XINTdigitsormax-#3\expandafter.%
+ \the\numexpr\XINTdigitsormax-#2\expandafter.\expanded{%
\XINT_tmpH.%
\XINT_tmpG.%
\XINT_tmpF.%
@@ -239,13 +239,13 @@
\ifnum\XINTdigits>55 \XINT_tmpa 22 53 49 45 43 41 39 Sin \fi
\ifnum\XINTdigits>58 \XINT_tmpa 23 56 53 49 45 43 41 Sin \fi
\edef\XINT_tmpd % 1/4!
- {41\xintReplicate{\XINTdigits+8}{6}7[\the\numexpr-\XINTdigits-12]}%
+ {41\xintReplicate{\XINTdigitsormax+8}{6}7[\the\numexpr-\XINTdigitsormax-12]}%
\edef\XINT_tmpH % 1/4!
- {41\xintReplicate{\XINTdigits}{6}7[\the\numexpr-\XINTdigits-4]}%
+ {41\xintReplicate{\XINTdigitsormax}{6}7[\the\numexpr-\XINTdigitsormax-4]}%
\def\XINT_tmpG{5[-1]}% 1/2!
\expandafter\XINT_tmpe
- \the\numexpr\XINTdigits+4\expandafter.%
- \the\numexpr\XINTdigits+3\expandafter.\expanded{%
+ \the\numexpr\XINTdigitsormax+4\expandafter.%
+ \the\numexpr\XINTdigitsormax+3\expandafter.\expanded{%
\XINT_tmpH.%
\XINT_tmpG.%
\expandafter}%
@@ -278,12 +278,12 @@
\def\XINT_SinAux_series#1%
{%
\expandafter\XINT_SinAux_series_a_iii
- \romannumeral0\XINTinfloatS[\XINTdigits+4]{#1}\xint:
+ \romannumeral0\XINTinfloatS[\XINTdigitsormax+4]{#1}\xint:
}%
\def\XINT_CosAux_series#1%
{%
\expandafter\XINT_CosAux_series_a_iii
- \romannumeral0\XINTinfloatS[\XINTdigits+4]{#1}\xint:
+ \romannumeral0\XINTinfloatS[\XINTdigitsormax+4]{#1}\xint:
}%
\fi % end of \XINTdigits>8
\ifnum\XINTdigits<9
@@ -359,7 +359,7 @@
\def\xintSind##1%
{%
\romannumeral`&&@\expandafter\xintsind\romannumeral0\XINTinfloatS[#1]{##1}}%
-}\expandafter\XINT_tmpa\the\numexpr\XINTdigits+12.%
+}\expandafter\XINT_tmpa\the\numexpr\XINTdigitsormax+12.%
\def\xintsind #1[#2#3]%
{%
\xint_UDsignfork
@@ -373,7 +373,7 @@
\expandafter\XINT_sind_a
\romannumeral0\xinttrunc{#1}{##2[##1]}%
}%
-}\expandafter\XINT_tmpa\the\numexpr\XINTdigits+5.%
+}\expandafter\XINT_tmpa\the\numexpr\XINTdigitsormax+5.%
\def\XINT_sind_a{\expandafter\XINT_sind_i\the\numexpr\XINT_mod_ccclx_i0.}%
\def\XINT_sind_int
{%
@@ -431,7 +431,7 @@
{\romannumeral0\XINTinfloat[#1]{\xintMul{\xintSub{##1[0]}{.##2}}#2}}%
}%
}\expandafter\XINT_tmpa
- \the\numexpr\XINTdigits+4\expandafter.%
+ \the\numexpr\XINTdigitsormax+4\expandafter.%
\romannumeral`&&@\xintbarefloateval @oneDegree\relax.%
\def\XINT_sind_B#1{\xint_UDsignfork#1\XINT_sind_B_n-\XINT_sind_B_p\krof #1}%
\def\XINT_sind_C#1{\xint_UDsignfork#1\XINT_sind_C_n-\XINT_sind_C_p\krof #1}%
@@ -445,7 +445,7 @@
\def\xintCosd##1%
{%
\romannumeral`&&@\expandafter\xintcosd\romannumeral0\XINTinfloatS[#1]{##1}}%
-}\expandafter\XINT_tmpa\the\numexpr\XINTdigits+12.%
+}\expandafter\XINT_tmpa\the\numexpr\XINTdigitsormax+12.%
\def\xintcosd #1[#2#3]%
{%
\xint_UDsignfork
@@ -459,7 +459,7 @@
\expandafter\XINT_cosd_a
\romannumeral0\xinttrunc{#1}{##2[##1]}%
}%
-}\expandafter\XINT_tmpa\the\numexpr\XINTdigits+5.%
+}\expandafter\XINT_tmpa\the\numexpr\XINTdigitsormax+5.%
\def\XINT_cosd_a{\expandafter\XINT_cosd_i\the\numexpr\XINT_mod_ccclx_i0.}%
\def\XINT_cosd_int
{%
@@ -517,7 +517,7 @@
{\romannumeral0\XINTinfloat[#1]{\xintMul{\xintSub{##1[0]}{.##2}}#2}}%
}%
}\expandafter\XINT_tmpa
- \the\numexpr\XINTdigits+4\expandafter.%
+ \the\numexpr\XINTdigitsormax+4\expandafter.%
\romannumeral`&&@\xintbarefloateval @oneDegree\relax.%
\def\XINT_cosd_B#1{\xint_UDsignfork#1\XINT_cosd_B_n-\XINT_cosd_B_p\krof #1}%
\def\XINT_cosd_C#1{\xint_UDsignfork#1\XINT_cosd_C_n-\XINT_cosd_C_p\krof #1}%
@@ -578,7 +578,7 @@
{@cos(x)/@sin(x)}
{(x)??
{-@tand(\xintexpr9e1+x*@oneRadian\relax)}
- {0e0}
+ {0}
{@tand(\xintexpr9e1-x*@oneRadian\relax)}
};%
\xintdeffloatfunc @sec(x) := inv(@cos(x));%
@@ -607,7 +607,7 @@
\xintAdd{1/1[0]}{##1/6[##2]}%
}%
}%
-\expandafter\XINT_tmpc\the\numexpr\XINTdigits-14.%
+\expandafter\XINT_tmpc\the\numexpr\XINTdigitsormax-14.%
\fi
\ifnum\XINTdigits>34
\def\XINT_tmpc#1.#2.#3.#4.%
@@ -630,10 +630,10 @@
}%
}%
\expandafter\XINT_tmpc
- \the\numexpr\XINTdigits-14\expandafter.%
- \the\numexpr\XINTdigits-32\expandafter.\expanded{%
- \XINTinFloat[\XINTdigits-32]{3/40[0]}.%
- \XINTinFloat[\XINTdigits-14]{1/6[0]}.%
+ \the\numexpr\XINTdigitsormax-14\expandafter.%
+ \the\numexpr\XINTdigitsormax-32\expandafter.\expanded{%
+ \XINTinFloat[\XINTdigitsormax-32]{3/40[0]}.%
+ \XINTinFloat[\XINTdigitsormax-14]{1/6[0]}.%
}%
\fi
\ifnum\XINTdigits>52
@@ -659,11 +659,11 @@
}%
}%
\expandafter\XINT_tmpc
- \the\numexpr\XINTdigits-32\expandafter.%
- \the\numexpr\XINTdigits-50\expandafter.\expanded{%
- \XINTinFloat[\XINTdigits-50]{5/112[0]}.%
- \XINTinFloat[\XINTdigits-32]{3/40[0]}.%
- \XINTinFloat[\XINTdigits-14]{1/6[0]}.%
+ \the\numexpr\XINTdigitsormax-32\expandafter.%
+ \the\numexpr\XINTdigitsormax-50\expandafter.\expanded{%
+ \XINTinFloat[\XINTdigitsormax-50]{5/112[0]}.%
+ \XINTinFloat[\XINTdigitsormax-32]{3/40[0]}.%
+ \XINTinFloat[\XINTdigitsormax-14]{1/6[0]}.%
}%
\fi
\def\XINT_flexpr_func_@asin_I#1#2#3%
@@ -838,33 +838,35 @@
\expandafter\let
\csname XINT_flexpr_func_inv\expandafter\endcsname
\csname XINT_flexpr_invfunc\endcsname
+\edef\XINTinFloatdigitsormax{\noexpand\XINTinFloat[\the\numexpr\XINTdigitsormax]}%
+\edef\XINTinFloatSdigitsormax{\noexpand\XINTinFloatS[\the\numexpr\XINTdigitsormax]}%
\xintFor #1 in {sin, cos, tan, sec, csc, cot,
asin, acos, atan}\do
{%
- \xintdeffloatfunc #1(x) := float_(@#1(x));%
- \xintdeffloatfunc #1d(x) := float_(@#1d(x));%
- \xintdeffunc #1(x) := float_(\xintfloatexpr @#1(sfloat(x))\relax);%
- \xintdeffunc #1d(x):= float_(\xintfloatexpr @#1d(sfloat(x))\relax);%
+ \xintdeffloatfunc #1(x) := float_dgtormax(@#1(x));%
+ \xintdeffloatfunc #1d(x) := float_dgtormax(@#1d(x));%
+ \xintdeffunc #1(x) := float_dgtormax(\xintfloatexpr @#1(sfloat_dgtormax(x))\relax);%
+ \xintdeffunc #1d(x):= float_dgtormax(\xintfloatexpr @#1d(sfloat_dgtormax(x))\relax);%
}%
\xintFor #1 in {Arg, pArg, atan2}\do
{%
- \xintdeffloatfunc #1(x, y) := float_(@#1(x, y));%
- \xintdeffloatfunc #1d(x, y) := float_(@#1d(x, y));%
- \xintdeffunc #1(x, y) := float_(\xintfloatexpr @#1(sfloat(x), sfloat(y))\relax);%
- \xintdeffunc #1d(x, y):= float_(\xintfloatexpr @#1d(sfloat(x), sfloat(y))\relax);%
+ \xintdeffloatfunc #1(x, y) := float_dgtormax(@#1(x, y));%
+ \xintdeffloatfunc #1d(x, y) := float_dgtormax(@#1d(x, y));%
+ \xintdeffunc #1(x, y) := float_dgtormax(\xintfloatexpr @#1(sfloat_dgtormax(x), sfloat_dgtormax(y))\relax);%
+ \xintdeffunc #1d(x, y):= float_dgtormax(\xintfloatexpr @#1d(sfloat_dgtormax(x), sfloat_dgtormax(y))\relax);%
}%
-\xintdeffloatfunc sinc(x):= float_(@sinc(x));%
-\xintdeffunc sinc(x):= float_(\xintfloatexpr @sinc(sfloat(x))\relax);%
+\xintdeffloatfunc sinc(x):= float_dgtormax(@sinc(x));%
+\xintdeffunc sinc(x):= float_dgtormax(\xintfloatexpr @sinc(sfloat_dgtormax(x))\relax);%
\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
-\xintdeffloatvar twoPi := @twoPi;%
-\xintdeffloatvar threePiover2 := @threePiover2;%
-\xintdeffloatvar Pi := @Pi;%
-\xintdeffloatvar Piover2 := @Piover2;%
-\xintdeffloatvar oneDegree := @oneDegree;%
-\xintdeffloatvar oneRadian := @oneRadian;%
+\xintdefvar twoPi := float_dgtormax(@twoPi);%
+\xintdefvar threePiover2 := float_dgtormax(@threePiover2);%
+\xintdefvar Pi := float_dgtormax(@Pi);%
+\xintdefvar Piover2 := float_dgtormax(@Piover2);%
+\xintdefvar oneDegree := float_dgtormax(@oneDegree);%
+\xintdefvar oneRadian := float_dgtormax(@oneRadian);%
\xintunassignvar{@twoPi}\xintunassignvar{@threePiover2}%
\xintunassignvar{@Pi}\xintunassignvar{@Piover2}%
\xintunassignvar{@oneRadian}\xintunassignvar{@oneDegree}%