diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx | 107 |
1 files changed, 85 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index af5b1b478c7..30e849c2711 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-trig.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project +%% File: l3fp-trig.dtx Copyright (C) 2011-2014,2016,2017 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-trig.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-point trigonometric functions} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -62,7 +62,70 @@ %<@@=fp> % \end{macrocode} % -%^^A todo: check EXP/rEXP everywhere. +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_acos:N , +% \@@_parse_word_acosd:N , +% \@@_parse_word_acsc:N , +% \@@_parse_word_acscd:N , +% \@@_parse_word_asec:N , +% \@@_parse_word_asecd:N , +% \@@_parse_word_asin:N , +% \@@_parse_word_asind:N , +% \@@_parse_word_cos:N , +% \@@_parse_word_cosd:N , +% \@@_parse_word_cot:N , +% \@@_parse_word_cotd:N , +% \@@_parse_word_csc:N , +% \@@_parse_word_cscd:N , +% \@@_parse_word_sec:N , +% \@@_parse_word_secd:N , +% \@@_parse_word_sin:N , +% \@@_parse_word_sind:N , +% \@@_parse_word_tan:N , +% \@@_parse_word_tand:N , +% } +% Unary functions. +% \begin{macrocode} +\tl_map_inline:nn + { + {acos} {acsc} {asec} {asin} + {cos} {cot} {csc} {sec} {sin} {tan} + } + { + \cs_new:cpx { @@_parse_word_#1:N } + { + \exp_not:N \@@_parse_unary_function:NNN + \exp_not:c { @@_#1_o:w } + \exp_not:N \use_i:nn + } + \cs_new:cpx { @@_parse_word_#1d:N } + { + \exp_not:N \@@_parse_unary_function:NNN + \exp_not:c { @@_#1_o:w } + \exp_not:N \use_ii:nn + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_acot:N , \@@_parse_word_acotd:N, +% \@@_parse_word_atan:N , \@@_parse_word_atand:N, +% } +% Those functions may receive a variable number of arguments. +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_acot:N + { \@@_parse_function:NNN \@@_acot_o:Nw \use_i:nn } +\cs_new:Npn \@@_parse_word_acotd:N + { \@@_parse_function:NNN \@@_acot_o:Nw \use_ii:nn } +\cs_new:Npn \@@_parse_word_atan:N + { \@@_parse_function:NNN \@@_atan_o:Nw \use_i:nn } +\cs_new:Npn \@@_parse_word_atand:N + { \@@_parse_function:NNN \@@_atan_o:Nw \use_ii:nn } +% \end{macrocode} +% \end{macro} % % \subsection{Direct trigonometric functions} % @@ -101,7 +164,7 @@ % reduction and if necessary convert the reduced argument to radians. % Then, \cs{@@_sin_series_o:NNwwww} will be called to compute the % Taylor series: this function receives a sign~|#3|, an initial octant -% of~$0$, and the function \cs{@@_ep_to_float:wwN} which converts the +% of~$0$, and the function \cs{@@_ep_to_float_o:wwN} which converts the % result of the series to a floating point directly rather than taking % its inverse, since $\sin(x) = \#3 \sin\lvert x\rvert$. % \begin{macrocode} @@ -112,7 +175,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_to_float:wwN #3 0 + \@@_ep_to_float_o:wwN #3 0 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { sin } { sind } } } @@ -139,7 +202,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_to_float:wwN 0 2 + \@@_ep_to_float_o:wwN 0 2 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { cos } { cosd } } } @@ -169,7 +232,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_inv_to_float:wwN #3 0 + \@@_ep_inv_to_float_o:wwN #3 0 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { csc } { cscd } } } @@ -195,7 +258,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_inv_to_float:wwN 0 2 + \@@_ep_inv_to_float_o:wwN 0 2 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { sec } { secd } } } @@ -280,7 +343,7 @@ % what trigonometric function we compute, and |#6| to~|#8| are pieces % of a normal floating point number. Call the \texttt{_series} % function~|#2|, with arguments |#3|, either a conversion function -% (\cs{@@_ep_to_float:wN} or \cs{@@_ep_inv_to_float:wN}) or a sign $0$ +% (\cs{@@_ep_to_float_o:wN} or \cs{@@_ep_inv_to_float_o:wN}) or a sign $0$ % or~$2$ when computing tangent or cotangent; |#4|, a sign $0$ or~$2$; % the octant, computed in an integer expression starting with~|#5| and % stopped by a period; and a fixed point number obtained from the @@ -796,8 +859,8 @@ % % \begin{macro}[aux, EXP] % {\@@_sin_series_o:NNwwww, \@@_sin_series_aux_o:NNnwww} -% Here we receive a conversion function \cs{@@_ep_to_float:wwN} or -% \cs{@@_ep_inv_to_float:wwN}, a \meta{sign} ($0$ or~$2$), a +% Here we receive a conversion function \cs{@@_ep_to_float_o:wwN} or +% \cs{@@_ep_inv_to_float_o:wwN}, a \meta{sign} ($0$ or~$2$), a % (non-negative) \meta{octant} delimited by a dot, a \meta{fixed % point} number delimited by a semicolon, and an extended-precision % number. The auxiliary receives: @@ -954,7 +1017,7 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 - \__int_value:w \__int_eval:w \@@_ep_to_float:wwN + \__int_value:w \__int_eval:w \@@_ep_to_float_o:wwN } #1 } @@ -1123,7 +1186,7 @@ \exp_after:wN #2 \__int_value:w \__int_eval:w \if_meaning:w 2 #5 7 - \fi: #3 \exp_after:wN ; - \c_@@_one_fixed_tl ; + \c_@@_one_fixed_tl {0000}{0000}{0000}{0000}{0000}{0000}; 0,{0000}{0000}{0000}{0000}{0000}{0000}; #1 } @@ -1262,7 +1325,7 @@ \if_int_compare:w #1 = -1 \exp_stop_f: \@@_atan_Taylor_break:w \fi: - \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl ; #1; + \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl #1; \@@_rrot:www \@@_fixed_mul_sub_back:wwwn #2; #3; { \exp_after:wN \@@_atan_Taylor_loop:www @@ -1299,7 +1362,7 @@ % z}{z}$ with $|#4|=z$, then compute the appropriate multiple of % $\frac{\pi}{4}$ and add or subtract the product $|#3|\cdot|#4|$. In % both cases, convert to a floating point with -% \cs{@@_fixed_to_float:wN}. +% \cs{@@_fixed_to_float_o:wN}. % \begin{macrocode} \cs_new:Npn \@@_atan_combine_o:NwwwwwN #1 #2; #3; #4; #5,#6; #7 { @@ -1319,7 +1382,7 @@ \__int_value:w \__int_eval:w #2 / 2 ; #2; } } - { #7 \@@_fixed_to_float:wN \@@_fixed_to_float_rad:wN } + { #7 \@@_fixed_to_float_o:wN \@@_fixed_to_float_rad_o:wN } #1 } \cs_new:Npn \@@_atan_combine_aux:ww #1; #2; @@ -1398,12 +1461,12 @@ % \end{macro} % % \begin{macro}[aux, EXP]{\@@_asin_normal_o:NfwNnnnnw} -% If the exponent~|#5| is strictly less than~$1$, the operand lies +% If the exponent~|#5| is at most $0$, the operand lies % within $(-1,1)$ and the operation is permitted: call -% \cs{@@_asin_auxi_o:nNww} with the appropriate arguments. If the +% \cs{@@_asin_auxi_o:NnNww} with the appropriate arguments. If the % number is exactly~$\pm 1$ (the test works because we know that % $|#5|\geq 1$, $|#6#7|\geq 10000000$, $|#8#9|\geq 0$, with equality -% only for $\pm 1$), we also call \cs{@@_asin_auxi_o:nNww}. +% only for $\pm 1$), we also call \cs{@@_asin_auxi_o:NnNww}. % Otherwise, \cs{@@_use_i:ww} gets rid of the \texttt{asin} auxiliary, % and raises instead an invalid operation, because the operand is % outside the domain of arcsine or arccosine. @@ -1456,7 +1519,7 @@ } \cs_new:Npn \@@_asin_isqrt:wn #1; { - \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl ; #1; + \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl #1; { \@@_fixed_add_one:wN #1; \@@_fixed_continue:wn { \@@_ep_mul:wwwwn 0, } 0, @@ -1526,7 +1589,7 @@ % If the exponent is non-positive, the operand is less than~$1$ in % absolute value, which is always an invalid operation: complain. % Otherwise, compute the inverse of the operand, and feed it to -% \cs{@@_asin_auxi_o:nNww} (with all the appropriate arguments). This +% \cs{@@_asin_auxi_o:NnNww} (with all the appropriate arguments). This % computes what we want thanks to % $\operatorname{acsc}(x)=\operatorname{asin}(1/x)$ and % $\operatorname{asec}(x)=\operatorname{acos}(1/x)$. |