diff options
Diffstat (limited to 'macros/latex/required/l3kernel/l3fp-trig.dtx')
-rw-r--r-- | macros/latex/required/l3kernel/l3fp-trig.dtx | 330 |
1 files changed, 179 insertions, 151 deletions
diff --git a/macros/latex/required/l3kernel/l3fp-trig.dtx b/macros/latex/required/l3kernel/l3fp-trig.dtx index c2346ca079..501a6bf2fa 100644 --- a/macros/latex/required/l3kernel/l3fp-trig.dtx +++ b/macros/latex/required/l3kernel/l3fp-trig.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-trig.dtx % -% Copyright (C) 2011-2024 The LaTeX Project +% Copyright (C) 2011-2025 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -42,7 +42,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2024-12-25} +% \date{Released 2025-01-18} % % \maketitle % @@ -168,7 +168,7 @@ % result of the series to a floating point directly rather than taking % its inverse, since $\sin(x) = \#3 \sin\lvert x\rvert$. % \begin{macrocode} -\cs_new:Npn \@@_sin_o:w #1 \s_@@ \@@_chk:w #2#3#4; @ +\cs_new:Npn \@@_sin_o:w #1 \s_@@ \@@_chk:w #2#3#4\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_return_same_o:w @@ -181,7 +181,7 @@ { \@@_invalid_operation_o:fw { #1 { sin } { sind } } } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3 #4; + \s_@@ \@@_chk:w #2 #3 #4\@@_sep: } % \end{macrocode} % \end{macro} @@ -195,7 +195,7 @@ % sign~|0| regardless of the sign of~$x$, and with an initial octant % of~$2$, because $\cos(x) = + \sin(\pi/2 + \lvert x\rvert)$. % \begin{macrocode} -\cs_new:Npn \@@_cos_o:w #1 \s_@@ \@@_chk:w #2#3; @ +\cs_new:Npn \@@_cos_o:w #1 \s_@@ \@@_chk:w #2#3\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_return_o:Nw \c_one_fp @@ -208,7 +208,7 @@ { \@@_invalid_operation_o:fw { #1 { cos } { cosd } } } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3; + \s_@@ \@@_chk:w #2 #3\@@_sep: } % \end{macrocode} % \end{macro} @@ -225,7 +225,7 @@ % point sine to the floating point result, because $\csc(x) = \#3 % \big( \sin\lvert x\rvert\big)^{-1}$. % \begin{macrocode} -\cs_new:Npn \@@_csc_o:w #1 \s_@@ \@@_chk:w #2#3#4; @ +\cs_new:Npn \@@_csc_o:w #1 \s_@@ \@@_chk:w #2#3#4\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_cot_zero_o:Nfw #3 { #1 { csc } { cscd } } @@ -238,7 +238,7 @@ { \@@_invalid_operation_o:fw { #1 { csc } { cscd } } } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3 #4; + \s_@@ \@@_chk:w #2 #3 #4\@@_sep: } % \end{macrocode} % \end{macro} @@ -251,7 +251,7 @@ % positive sign~$0$, a starting octant of~$2$, and inverting upon % conversion, because $\sec(x) = + 1 / \sin(\pi/2 + \lvert x\rvert)$. % \begin{macrocode} -\cs_new:Npn \@@_sec_o:w #1 \s_@@ \@@_chk:w #2#3; @ +\cs_new:Npn \@@_sec_o:w #1 \s_@@ \@@_chk:w #2#3\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_return_o:Nw \c_one_fp @@ -264,7 +264,7 @@ { \@@_invalid_operation_o:fw { #1 { sec } { secd } } } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3; + \s_@@ \@@_chk:w #2 #3\@@_sep: } % \end{macrocode} % \end{macro} @@ -278,7 +278,7 @@ % of~$1$ (this shift is somewhat arbitrary). See \cs{@@_cot_o:w} for % an explanation of the $0$~argument. % \begin{macrocode} -\cs_new:Npn \@@_tan_o:w #1 \s_@@ \@@_chk:w #2#3#4; @ +\cs_new:Npn \@@_tan_o:w #1 \s_@@ \@@_chk:w #2#3#4\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_return_same_o:w @@ -291,7 +291,7 @@ { \@@_invalid_operation_o:fw { #1 { tan } { tand } } } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3 #4; + \s_@@ \@@_chk:w #2 #3 #4\@@_sep: } % \end{macrocode} % \end{macro} @@ -308,7 +308,7 @@ % sign of the argument: the first of those indicates whether we % compute tangent or cotangent. Those signs are eventually combined. % \begin{macrocode} -\cs_new:Npn \@@_cot_o:w #1 \s_@@ \@@_chk:w #2#3#4; @ +\cs_new:Npn \@@_cot_o:w #1 \s_@@ \@@_chk:w #2#3#4\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_cot_zero_o:Nfw #3 { #1 { cot } { cotd } } @@ -321,7 +321,7 @@ { \@@_invalid_operation_o:fw { #1 { cot } { cotd } } } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3 #4; + \s_@@ \@@_chk:w #2 #3 #4\@@_sep: } \cs_new:Npn \@@_cot_zero_o:Nfw #1#2#3 \fi: { @@ -362,7 +362,7 @@ % four \texttt{trig}/\texttt{trigd} auxiliaries receive the operand as % an extended-precision number. % \begin{macrocode} -\cs_new:Npn \@@_trig:NNNNNwn #1#2#3#4#5 \s_@@ \@@_chk:w 1#6#7#8; +\cs_new:Npn \@@_trig:NNNNNwn #1#2#3#4#5 \s_@@ \@@_chk:w 1#6#7#8\@@_sep: { \exp_after:wN #2 \exp_after:wN #3 @@ -374,7 +374,7 @@ \else: #1 \@@_trig_small:ww \@@_trigd_small:ww \fi: - #7,#8{0000}{0000}; + #7,#8{0000}{0000}\@@_sep: } % \end{macrocode} % \end{macro} @@ -390,8 +390,8 @@ % an extended-precision number) rather than the fixed point number. % The period serves to end the integer expression for the octant. % \begin{macrocode} -\cs_new:Npn \@@_trig_small:ww #1,#2; - { \@@_ep_to_fixed:wwn #1,#2; . #1,#2; } +\cs_new:Npn \@@_trig_small:ww #1,#2\@@_sep: + { \@@_ep_to_fixed:wwn #1,#2\@@_sep: . #1,#2\@@_sep: } % \end{macrocode} % \end{macro} % @@ -400,10 +400,10 @@ % \cs{@@_trig_small:ww} to massage it in the form appropriate for the % \texttt{_series} auxiliary. % \begin{macrocode} -\cs_new:Npn \@@_trigd_small:ww #1,#2; +\cs_new:Npn \@@_trigd_small:ww #1,#2\@@_sep: { \@@_ep_mul_raw:wwwwN - -1,{1745}{3292}{5199}{4329}{5769}{2369}; #1,#2; + -1,{1745}{3292}{5199}{4329}{5769}{2369}\@@_sep: #1,#2\@@_sep: \@@_trig_small:ww } % \end{macrocode} @@ -444,34 +444,34 @@ % those are all~$0$ and no precision is lost (|#6| and~|#7| are % four~$0$ each). % \begin{macrocode} -\cs_new:Npn \@@_trigd_large:ww #1, #2#3#4#5#6#7; +\cs_new:Npn \@@_trigd_large:ww #1, #2#3#4#5#6#7\@@_sep: { \exp_after:wN \@@_pack_eight:wNNNNNNNN \exp_after:wN \@@_pack_eight:wNNNNNNNN \exp_after:wN \@@_pack_twice_four:wNNNNNNNN \exp_after:wN \@@_pack_twice_four:wNNNNNNNN \exp_after:wN \@@_trigd_large_auxi:nnnnwNNNN - \exp_after:wN ; + \exp_after:wN \@@_sep: \exp:w \exp_end_continue_f:w \prg_replicate:nn { \int_max:nn { 22 - #1 } { 0 } } { 0 } #2#3#4#5#6#7 0000 0000 0000 ! } -\cs_new:Npn \@@_trigd_large_auxi:nnnnwNNNN #1#2#3#4#5; #6#7#8#9 +\cs_new:Npn \@@_trigd_large_auxi:nnnnwNNNN #1#2#3#4#5\@@_sep: #6#7#8#9 { \exp_after:wN \@@_trigd_large_auxii:wNw \int_value:w \@@_int_eval:w #1 + #2 - (#1 + #2 - 4) / 9 * 9 \@@_int_eval_end: - #3; - #4; #5{#6#7#8#9}; + #3\@@_sep: + #4\@@_sep: #5{#6#7#8#9}\@@_sep: } -\cs_new:Npn \@@_trigd_large_auxii:wNw #1; #2#3; +\cs_new:Npn \@@_trigd_large_auxii:wNw #1\@@_sep: #2#3\@@_sep: { + (#1#2 - 4) / 9 * 2 \exp_after:wN \@@_trigd_large_auxiii:www \int_value:w \@@_int_eval:w #1#2 - - (#1#2 - 4) / 9 * 9 \@@_int_eval_end: #3 ; + - (#1#2 - 4) / 9 * 9 \@@_int_eval_end: #3 \@@_sep: } -\cs_new:Npn \@@_trigd_large_auxiii:www #1; #2; #3! +\cs_new:Npn \@@_trigd_large_auxiii:www #1\@@_sep: #2\@@_sep: #3! { \if_int_compare:w #1 < 4500 \exp_stop_f: \exp_after:wN \@@_use_i_until_s:nw @@ -479,8 +479,8 @@ \else: + 1 \fi: - \@@_fixed_sub:wwn {9000}{0000}{0000}{0000}{0000}{0000}; - {#1}#2{0000}{0000}; + \@@_fixed_sub:wwn {9000}{0000}{0000}{0000}{0000}{0000}\@@_sep: + {#1}#2{0000}{0000}\@@_sep: { \@@_trigd_small:ww 2, } } % \end{macrocode} @@ -768,12 +768,12 @@ % between $65$ and $72$ at this point) into groups of~$4$ and the % \texttt{auxv} auxiliary is called. % \begin{macrocode} -\cs_new:Npn \@@_trig_large:ww #1, #2#3#4#5#6; +\cs_new:Npn \@@_trig_large:ww #1, #2#3#4#5#6\@@_sep: { \exp_after:wN \@@_trig_large_auxi:w \int_value:w \@@_int_eval:w (#1 - 4) / 8 \exp_after:wN , - \int_value:w #1 , ; - {#2}{#3}{#4}{#5} ; + \int_value:w #1 , \@@_sep: + {#2}{#3}{#4}{#5} \@@_sep: } \cs_new:Npn \@@_trig_large_auxi:w #1, #2, { @@ -818,7 +818,7 @@ \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN - \@@_trig_large_auxv:www ; + \@@_trig_large_auxv:www \@@_sep: } \cs_new:Npn \@@_trig_large_auxiii:w 1 { \exp_stop_f: } % \end{macrocode} @@ -848,7 +848,7 @@ % more step in the ladder. The last semicolon closes the ladder, and % we return control to the \texttt{auxvii} auxiliary. % \begin{macrocode} -\cs_new:Npn \@@_trig_large_auxv:www #1; #2; #3; +\cs_new:Npn \@@_trig_large_auxv:www #1\@@_sep: #2\@@_sep: #3\@@_sep: { \exp_after:wN \@@_use_i_until_s:nw \exp_after:wN \@@_trig_large_auxvii:w @@ -857,17 +857,17 @@ { \@@_trig_large_auxvi:wnnnnnnnn } + \c_@@_trailing_shift_int - \c_@@_middle_shift_int \@@_use_i_until_s:nw - ; #3 #1 ; ; + \@@_sep: #3 #1 \@@_sep: \@@_sep: } -\cs_new:Npn \@@_trig_large_auxvi:wnnnnnnnn #1; #2#3#4#5#6#7#8#9 +\cs_new:Npn \@@_trig_large_auxvi:wnnnnnnnn #1\@@_sep: #2#3#4#5#6#7#8#9 { \exp_after:wN \@@_trig_large_pack:NNNNNw \int_value:w \@@_int_eval:w \c_@@_middle_shift_int + #2*#9 + #3*#8 + #4*#7 + #5*#6 - #1; {#2}{#3}{#4}{#5} {#7}{#8}{#9} + #1\@@_sep: {#2}{#3}{#4}{#5} {#7}{#8}{#9} } -\cs_new:Npn \@@_trig_large_pack:NNNNNw #1#2#3#4#5#6; - { + #1#2#3#4#5 ; #6 } +\cs_new:Npn \@@_trig_large_pack:NNNNNw #1#2#3#4#5#6\@@_sep: + { + #1#2#3#4#5 \@@_sep: #6 } % \end{macrocode} % \end{macro} % @@ -900,10 +900,10 @@ \cs_new:Npn \@@_trig_large_auxvii:w #1#2#3 { \exp_after:wN \@@_trig_large_auxviii:ww - \int_value:w \@@_int_eval:w (#1#2#3 - 62) / 125 ; + \int_value:w \@@_int_eval:w (#1#2#3 - 62) / 125 \@@_sep: #1#2#3 } -\cs_new:Npn \@@_trig_large_auxviii:ww #1; +\cs_new:Npn \@@_trig_large_auxviii:ww #1\@@_sep: { + #1 \if_int_odd:w #1 \exp_stop_f: @@ -922,20 +922,20 @@ \prg_replicate:nn { 13 } { \@@_trig_large_auxx:wNNNNN } + \c_@@_trailing_shift_int - \c_@@_middle_shift_int - ; + \@@_sep: } -\cs_new:Npn \@@_trig_large_auxx:wNNNNN #1; #2 #3#4#5#6 +\cs_new:Npn \@@_trig_large_auxx:wNNNNN #1\@@_sep: #2 #3#4#5#6 { \exp_after:wN \@@_trig_large_pack:NNNNNw \int_value:w \@@_int_eval:w \c_@@_middle_shift_int #2 8 * #3#4#5#6 - #1; #2 + #1\@@_sep: #2 } -\cs_new:Npn \@@_trig_large_auxxi:w #1; +\cs_new:Npn \@@_trig_large_auxxi:w #1\@@_sep: { \exp_after:wN \@@_ep_mul_raw:wwwwN - \int_value:w \@@_int_eval:w 0 \@@_ep_to_ep_loop:N #1 ; ; ! - 0,{7853}{9816}{3397}{4483}{0961}{5661}; + \int_value:w \@@_int_eval:w 0 \@@_ep_to_ep_loop:N #1 \@@_sep: \@@_sep: ! + 0,{7853}{9816}{3397}{4483}{0961}{5661}\@@_sep: \@@_trig_small:ww } % \end{macrocode} @@ -975,9 +975,9 @@ % floating point number with the given sign, and \cs{@@_sanitize:Nw} % checks for overflow and underflow. % \begin{macrocode} -\cs_new:Npn \@@_sin_series_o:NNwwww #1#2#3. #4; +\cs_new:Npn \@@_sin_series_o:NNwwww #1#2#3. #4\@@_sep: { - \@@_fixed_mul:wwn #4; #4; + \@@_fixed_mul:wwn #4\@@_sep: #4\@@_sep: { \exp_after:wN \@@_sin_series_aux_o:NNnwww \exp_after:wN #1 @@ -990,7 +990,7 @@ {#3} } } -\cs_new:Npn \@@_sin_series_aux_o:NNnwww #1#2#3 #4; #5,#6; +\cs_new:Npn \@@_sin_series_aux_o:NNnwww #1#2#3 #4\@@_sep: #5,#6\@@_sep: { \if_int_odd:w \@@_int_eval:w #3 / 2 \@@_int_eval_end: \exp_after:wN \use_i:nn @@ -998,29 +998,46 @@ \exp_after:wN \use_ii:nn \fi: { % 1/18! - \@@_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0001}{5619}{2070}; - #4;{0000}{0000}{0000}{0477}{9477}{3324}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{0000}{0011}{4707}{4559}{7730}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{0000}{2087}{6756}{9878}{6810}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{0027}{5573}{1922}{3985}{8907}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{2480}{1587}{3015}{8730}{1587}; - \@@_fixed_mul_sub_back:wwwn #4;{0013}{8888}{8888}{8888}{8888}{8889}; - \@@_fixed_mul_sub_back:wwwn #4;{0416}{6666}{6666}{6666}{6666}{6667}; - \@@_fixed_mul_sub_back:wwwn #4;{5000}{0000}{0000}{0000}{0000}{0000}; - \@@_fixed_mul_sub_back:wwwn#4;{10000}{0000}{0000}{0000}{0000}{0000}; + \@@_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0001}{5619}{2070}\@@_sep: + #4\@@_sep: + {0000}{0000}{0000}{0477}{9477}{3324}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{0000}{0011}{4707}{4559}{7730}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{0000}{2087}{6756}{9878}{6810}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{0027}{5573}{1922}{3985}{8907}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{2480}{1587}{3015}{8730}{1587}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0013}{8888}{8888}{8888}{8888}{8889}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0416}{6666}{6666}{6666}{6666}{6667}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {5000}{0000}{0000}{0000}{0000}{0000}\@@_sep: + \@@_fixed_mul_sub_back:wwwn#4\@@_sep: + {10000}{0000}{0000}{0000}{0000}{0000}\@@_sep: { \@@_fixed_continue:wn 0, } } { % 1/17! - \@@_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0028}{1145}{7254}; - #4;{0000}{0000}{0000}{7647}{1637}{3182}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{0000}{0160}{5904}{3836}{8216}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{0002}{5052}{1083}{8544}{1719}; - \@@_fixed_mul_sub_back:wwwn #4;{0000}{0275}{5731}{9223}{9858}{9065}; - \@@_fixed_mul_sub_back:wwwn #4;{0001}{9841}{2698}{4126}{9841}{2698}; - \@@_fixed_mul_sub_back:wwwn #4;{0083}{3333}{3333}{3333}{3333}{3333}; - \@@_fixed_mul_sub_back:wwwn #4;{1666}{6666}{6666}{6666}{6666}{6667}; - \@@_fixed_mul_sub_back:wwwn#4;{10000}{0000}{0000}{0000}{0000}{0000}; - { \@@_ep_mul:wwwwn 0, } #5,#6; + \@@_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0028}{1145}{7254}\@@_sep: + #4\@@_sep: + {0000}{0000}{0000}{7647}{1637}{3182}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{0000}{0160}{5904}{3836}{8216}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{0002}{5052}{1083}{8544}{1719}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0000}{0275}{5731}{9223}{9858}{9065}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0001}{9841}{2698}{4126}{9841}{2698}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {0083}{3333}{3333}{3333}{3333}{3333}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #4\@@_sep: + {1666}{6666}{6666}{6666}{6666}{6667}\@@_sep: + \@@_fixed_mul_sub_back:wwwn#4\@@_sep: + {10000}{0000}{0000}{0000}{0000}{0000}\@@_sep: + { \@@_ep_mul:wwwwn 0, } #5,#6\@@_sep: } { \exp_after:wN \@@_sanitize:Nw @@ -1064,9 +1081,9 @@ % before computing the ratio. Note that this \cs{if_int_odd:w} test % relies on the fact that the octant is at least~$1$. % \begin{macrocode} -\cs_new:Npn \@@_tan_series_o:NNwwww #1#2#3. #4; +\cs_new:Npn \@@_tan_series_o:NNwwww #1#2#3. #4\@@_sep: { - \@@_fixed_mul:wwn #4; #4; + \@@_fixed_mul:wwn #4\@@_sep: #4\@@_sep: { \exp_after:wN \@@_tan_series_aux_o:Nnwww \int_value:w @@ -1077,22 +1094,32 @@ {#3} } } -\cs_new:Npn \@@_tan_series_aux_o:Nnwww #1 #2 #3; #4,#5; +\cs_new:Npn \@@_tan_series_aux_o:Nnwww #1 #2 #3\@@_sep: #4,#5\@@_sep: { - \@@_fixed_mul_sub_back:wwwn {0000}{0000}{1527}{3493}{0856}{7059}; - #3; {0000}{0159}{6080}{0274}{5257}{6472}; - \@@_fixed_mul_sub_back:wwwn #3; {0002}{4571}{2320}{0157}{2558}{8481}; - \@@_fixed_mul_sub_back:wwwn #3; {0115}{5830}{7533}{5397}{3168}{2147}; - \@@_fixed_mul_sub_back:wwwn #3; {1929}{8245}{6140}{3508}{7719}{2982}; - \@@_fixed_mul_sub_back:wwwn #3;{10000}{0000}{0000}{0000}{0000}{0000}; - { \@@_ep_mul:wwwwn 0, } #4,#5; + \@@_fixed_mul_sub_back:wwwn {0000}{0000}{1527}{3493}{0856}{7059}\@@_sep: + #3\@@_sep: + {0000}{0159}{6080}{0274}{5257}{6472}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {0002}{4571}{2320}{0157}{2558}{8481}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {0115}{5830}{7533}{5397}{3168}{2147}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {1929}{8245}{6140}{3508}{7719}{2982}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {10000}{0000}{0000}{0000}{0000}{0000}\@@_sep: + { \@@_ep_mul:wwwwn 0, } #4,#5\@@_sep: { - \@@_fixed_mul_sub_back:wwwn {0000}{0007}{0258}{0681}{9408}{4706}; - #3;{0000}{2343}{7175}{1399}{6151}{7670}; - \@@_fixed_mul_sub_back:wwwn #3;{0019}{2638}{4588}{9232}{8861}{3691}; - \@@_fixed_mul_sub_back:wwwn #3;{0536}{6357}{0691}{4344}{6852}{4252}; - \@@_fixed_mul_sub_back:wwwn #3;{5263}{1578}{9473}{6842}{1052}{6315}; - \@@_fixed_mul_sub_back:wwwn#3;{10000}{0000}{0000}{0000}{0000}{0000}; + \@@_fixed_mul_sub_back:wwwn {0000}{0007}{0258}{0681}{9408}{4706}\@@_sep: + #3\@@_sep: + {0000}{2343}{7175}{1399}{6151}{7670}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {0019}{2638}{4588}{9232}{8861}{3691}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {0536}{6357}{0691}{4344}{6852}{4252}\@@_sep: + \@@_fixed_mul_sub_back:wwwn #3\@@_sep: + {5263}{1578}{9473}{6842}{1052}{6315}\@@_sep: + \@@_fixed_mul_sub_back:wwwn#3\@@_sep: + {10000}{0000}{0000}{0000}{0000}{0000}\@@_sep: { \reverse_if:N \if_int_odd:w \@@_int_eval:w (#2 - 1) / 2 \@@_int_eval_end: @@ -1220,7 +1247,7 @@ % \cs{@@_acotii_o:ww} simply reverses its two arguments. % \begin{macrocode} \cs_new:Npn \@@_atanii_o:Nww - #1 \s_@@ \@@_chk:w #2#3#4; \s_@@ \@@_chk:w #5 #6 @ + #1 \s_@@ \@@_chk:w #2#3#4\@@_sep: \s_@@ \@@_chk:w #5 #6 @ { \if_meaning:w 3 #2 \@@_case_return_i_o:ww \fi: \if_meaning:w 3 #5 \@@_case_return_ii_o:ww \fi: @@ -1236,11 +1263,11 @@ \or: \@@_case_return:nw { \@@_atan_inf_o:NNNw #1 #3 0 } \fi: \@@_atan_normal_o:NNnwNnw #1 - \s_@@ \@@_chk:w #2#3#4; + \s_@@ \@@_chk:w #2#3#4\@@_sep: \s_@@ \@@_chk:w #5 #6 } -\cs_new:Npn \@@_acotii_o:Nww #1#2; #3; - { \@@_atanii_o:Nww #1#3; #2; } +\cs_new:Npn \@@_acotii_o:Nww #1#2\@@_sep: #3\@@_sep: + { \@@_atanii_o:Nww #1#3\@@_sep: #2\@@_sep: } % \end{macrocode} % \end{macro} % @@ -1257,15 +1284,15 @@ % is positive, and $[(7-|#3|)/2]\cdot\pi/4$ for negative~$x$, where % the divisions are rounded up. % \begin{macrocode} -\cs_new:Npn \@@_atan_inf_o:NNNw #1#2#3 \s_@@ \@@_chk:w #4#5#6; +\cs_new:Npn \@@_atan_inf_o:NNNw #1#2#3 \s_@@ \@@_chk:w #4#5#6\@@_sep: { \exp_after:wN \@@_atan_combine_o:NwwwwwN \exp_after:wN #2 \int_value:w \@@_int_eval:w - \if_meaning:w 2 #5 7 - \fi: #3 \exp_after:wN ; + \if_meaning:w 2 #5 7 - \fi: #3 \exp_after:wN \@@_sep: \c_@@_one_fixed_tl - {0000}{0000}{0000}{0000}{0000}{0000}; - 0,{0000}{0000}{0000}{0000}{0000}{0000}; #1 + {0000}{0000}{0000}{0000}{0000}{0000}\@@_sep: + 0,{0000}{0000}{0000}{0000}{0000}{0000}\@@_sep: #1 } % \end{macrocode} % \end{macro} @@ -1279,11 +1306,11 @@ % intermediate rounding errors. % \begin{macrocode} \cs_new_protected:Npn \@@_atan_normal_o:NNnwNnw - #1 \s_@@ \@@_chk:w 1#2#3#4; \s_@@ \@@_chk:w 1#5#6#7; + #1 \s_@@ \@@_chk:w 1#2#3#4\@@_sep: \s_@@ \@@_chk:w 1#5#6#7\@@_sep: { \@@_atan_test_o:NwwNwwN - #2 #3, #4{0000}{0000}; - #5 #6, #7{0000}{0000}; #1 + #2 #3, #4{0000}{0000}\@@_sep: + #5 #6, #7{0000}{0000}\@@_sep: #1 } % \end{macrocode} % \end{macro} @@ -1304,7 +1331,7 @@ % two numbers. The finer test with $0.41421$ is done by % \cs{@@_atan_div:wnwwnw} after the operands have been ordered. % \begin{macrocode} -\cs_new:Npn \@@_atan_test_o:NwwNwwN #1#2,#3; #4#5,#6; +\cs_new:Npn \@@_atan_test_o:NwwNwwN #1#2,#3\@@_sep: #4#5,#6\@@_sep: { \exp_after:wN \@@_atan_combine_o:NwwwwwN \exp_after:wN #1 @@ -1313,11 +1340,11 @@ 7 - \@@_int_eval:w \fi: \if_int_compare:w - \@@_ep_compare:wwww #2,#3; #5,#6; > \c_zero_int + \@@_ep_compare:wwww #2,#3\@@_sep: #5,#6\@@_sep: > \c_zero_int 3 - \exp_after:wN \@@_reverse_args:Nww \fi: - \@@_atan_div:wnwwnw #2,#3; #5,#6; + \@@_atan_div:wnwwnw #2,#3\@@_sep: #5,#6\@@_sep: } % \end{macrocode} % \end{macro} @@ -1337,7 +1364,7 @@ % followed by~$z$, as a comma-delimited exponent and a fixed point % number. % \begin{macrocode} -\cs_new:Npn \@@_atan_div:wnwwnw #1,#2#3; #4,#5#6; +\cs_new:Npn \@@_atan_div:wnwwnw #1,#2#3\@@_sep: #4,#5#6\@@_sep: { \if_int_compare:w \@@_int_eval:w 41421 * #5 < #2 000 @@ -1347,20 +1374,20 @@ \exp_after:wN \@@_atan_near:wwwn \fi: 0 - \@@_ep_div:wwwwn #1,{#2}#3; #4,{#5}#6; + \@@_ep_div:wwwwn #1,{#2}#3\@@_sep: #4,{#5}#6\@@_sep: \@@_atan_auxi:ww } \cs_new:Npn \@@_atan_near:wwwn - 0 \@@_ep_div:wwwwn #1,#2; #3, + 0 \@@_ep_div:wwwwn #1,#2\@@_sep: #3, { 1 - \@@_ep_to_fixed:wwn #1 - #3, #2; + \@@_ep_to_fixed:wwn #1 - #3, #2\@@_sep: \@@_atan_near_aux:wwn } -\cs_new:Npn \@@_atan_near_aux:wwn #1; #2; +\cs_new:Npn \@@_atan_near_aux:wwn #1\@@_sep: #2\@@_sep: { - \@@_fixed_add:wwn #1; #2; - { \@@_fixed_sub:wwn #2; #1; { \@@_ep_div:wwwwn 0, } 0, } + \@@_fixed_add:wwn #1\@@_sep: #2\@@_sep: + { \@@_fixed_sub:wwn #2\@@_sep: #1\@@_sep: { \@@_ep_div:wwwwn 0, } 0, } } % \end{macrocode} % \end{macro} @@ -1372,16 +1399,16 @@ % call to \cs{@@_atan_Taylor_loop:www}, followed by the fixed point % representation of~$z$ and the old representation. % \begin{macrocode} -\cs_new:Npn \@@_atan_auxi:ww #1,#2; - { \@@_ep_to_fixed:wwn #1,#2; \@@_atan_auxii:w #1,#2; } -\cs_new:Npn \@@_atan_auxii:w #1; +\cs_new:Npn \@@_atan_auxi:ww #1,#2\@@_sep: + { \@@_ep_to_fixed:wwn #1,#2\@@_sep: \@@_atan_auxii:w #1,#2\@@_sep: } +\cs_new:Npn \@@_atan_auxii:w #1\@@_sep: { - \@@_fixed_mul:wwn #1; #1; + \@@_fixed_mul:wwn #1\@@_sep: #1\@@_sep: { - \@@_atan_Taylor_loop:www 39 ; - {0000}{0000}{0000}{0000}{0000}{0000} ; + \@@_atan_Taylor_loop:www 39 \@@_sep: + {0000}{0000}{0000}{0000}{0000}{0000} \@@_sep: } - ! #1; + ! #1\@@_sep: } % \end{macrocode} % \end{macro} @@ -1398,22 +1425,22 @@ % computing the octant with a semicolon, and leave the result~|#2| % afterwards. % \begin{macrocode} -\cs_new:Npn \@@_atan_Taylor_loop:www #1; #2; #3; +\cs_new:Npn \@@_atan_Taylor_loop:www #1\@@_sep: #2\@@_sep: #3\@@_sep: { \if_int_compare:w #1 = - \c_one_int \@@_atan_Taylor_break:w \fi: - \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl #1; - \@@_rrot:www \@@_fixed_mul_sub_back:wwwn #2; #3; + \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl #1\@@_sep: + \@@_rrot:www \@@_fixed_mul_sub_back:wwwn #2\@@_sep: #3\@@_sep: { \exp_after:wN \@@_atan_Taylor_loop:www - \int_value:w \@@_int_eval:w #1 - 2 ; + \int_value:w \@@_int_eval:w #1 - 2 \@@_sep: } - #3; + #3\@@_sep: } \cs_new:Npn \@@_atan_Taylor_break:w - \fi: #1 \@@_fixed_mul_sub_back:wwwn #2; #3 ! - { \fi: ; #2 ; } + \fi: #1 \@@_fixed_mul_sub_back:wwwn #2\@@_sep: #3 ! + { \fi: \@@_sep: #2 \@@_sep: } % \end{macrocode} % \end{macro} % @@ -1442,7 +1469,8 @@ % both cases, convert to a floating point with % \cs{@@_fixed_to_float_o:wN}. % \begin{macrocode} -\cs_new:Npn \@@_atan_combine_o:NwwwwwN #1 #2; #3; #4; #5,#6; #7 +\cs_new:Npn \@@_atan_combine_o:NwwwwwN + #1 #2\@@_sep: #3\@@_sep: #4\@@_sep: #5,#6\@@_sep: #7 { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 @@ -1452,22 +1480,22 @@ \else: \exp_after:wN \use_ii:nn \fi: - { #5 \@@_fixed_mul:wwn #3; #6; } + { #5 \@@_fixed_mul:wwn #3\@@_sep: #6\@@_sep: } { - \@@_fixed_mul:wwn #3; #4; + \@@_fixed_mul:wwn #3\@@_sep: #4\@@_sep: { \exp_after:wN \@@_atan_combine_aux:ww - \int_value:w \@@_int_eval:w #2 / 2 ; #2; + \int_value:w \@@_int_eval:w #2 / 2 \@@_sep: #2\@@_sep: } } { #7 \@@_fixed_to_float_o:wN \@@_fixed_to_float_rad_o:wN } #1 } -\cs_new:Npn \@@_atan_combine_aux:ww #1; #2; +\cs_new:Npn \@@_atan_combine_aux:ww #1\@@_sep: #2\@@_sep: { \@@_fixed_mul_short:wwn - {7853}{9816}{3397}{4483}{0961}{5661}; - {#1}{0000}{0000}; + {7853}{9816}{3397}{4483}{0961}{5661}\@@_sep: + {#1}{0000}{0000}\@@_sep: { \if_int_odd:w #2 \exp_stop_f: \exp_after:wN \@@_fixed_sub:wwn @@ -1491,7 +1519,7 @@ % about what function is being performed (for \enquote{invalid operation} % exceptions). % \begin{macrocode} -\cs_new:Npn \@@_asin_o:w #1 \s_@@ \@@_chk:w #2#3; @ +\cs_new:Npn \@@_asin_o:w #1 \s_@@ \@@_chk:w #2#3\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_return_same_o:w @@ -1504,7 +1532,7 @@ \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3; + \s_@@ \@@_chk:w #2 #3\@@_sep: } % \end{macrocode} % \end{macro} @@ -1517,7 +1545,7 @@ % \texttt{acos} or \texttt{acosd}, and preparing to swap some % arguments down the line. % \begin{macrocode} -\cs_new:Npn \@@_acos_o:w #1 \s_@@ \@@_chk:w #2#3; @ +\cs_new:Npn \@@_acos_o:w #1 \s_@@ \@@_chk:w #2#3\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_use:nw { \@@_atan_inf_o:NNNw #1 0 4 } @@ -1533,7 +1561,7 @@ \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3; + \s_@@ \@@_chk:w #2 #3\@@_sep: } % \end{macrocode} % \end{macro} @@ -1550,7 +1578,7 @@ % outside the domain of arcsine or arccosine. % \begin{macrocode} \cs_new:Npn \@@_asin_normal_o:NfwNnnnnw - #1#2#3 \s_@@ \@@_chk:w 1#4#5#6#7#8#9; + #1#2#3 \s_@@ \@@_chk:w 1#4#5#6#7#8#9\@@_sep: { \if_int_compare:w #5 < \c_one_int \exp_after:wN \@@_use_none_until_s:w @@ -1560,9 +1588,9 @@ \fi: \@@_use_i:ww \@@_invalid_operation_o:fw {#2} - \s_@@ \@@_chk:w 1#4{#5}{#6}{#7}{#8}{#9}; + \s_@@ \@@_chk:w 1#4{#5}{#6}{#7}{#8}{#9}\@@_sep: \@@_asin_auxi_o:NnNww - #1 {#3} #4 #5,{#6}{#7}{#8}{#9}{0000}{0000}; + #1 {#3} #4 #5,{#6}{#7}{#8}{#9}{0000}{0000}\@@_sep: } % \end{macrocode} % \end{macro} @@ -1585,21 +1613,21 @@ % function requires normalized arguments, hence the need for % \texttt{ep_to_ep} and \texttt{continue} after \texttt{ep_mul}. % \begin{macrocode} -\cs_new:Npn \@@_asin_auxi_o:NnNww #1#2#3#4,#5; +\cs_new:Npn \@@_asin_auxi_o:NnNww #1#2#3#4,#5\@@_sep: { - \@@_ep_to_fixed:wwn #4,#5; + \@@_ep_to_fixed:wwn #4,#5\@@_sep: \@@_asin_isqrt:wn - \@@_ep_mul:wwwwn #4,#5; + \@@_ep_mul:wwwwn #4,#5\@@_sep: \@@_ep_to_ep:wwN \@@_fixed_continue:wn { #2 \@@_atan_test_o:NwwNwwN #3 } - 0 1,{1000}{0000}{0000}{0000}{0000}{0000}; #1 + 0 1,{1000}{0000}{0000}{0000}{0000}{0000}\@@_sep: #1 } -\cs_new:Npn \@@_asin_isqrt:wn #1; +\cs_new:Npn \@@_asin_isqrt:wn #1\@@_sep: { - \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl #1; + \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl #1\@@_sep: { - \@@_fixed_add_one:wN #1; + \@@_fixed_add_one:wN #1\@@_sep: \@@_fixed_continue:wn { \@@_ep_mul:wwwwn 0, } 0, } \@@_ep_isqrt:wwn @@ -1619,7 +1647,7 @@ % tests, keeping the function name (\texttt{acsc} or \texttt{acscd}) % as an argument for invalid operation exceptions. % \begin{macrocode} -\cs_new:Npn \@@_acsc_o:w #1 \s_@@ \@@_chk:w #2#3#4; @ +\cs_new:Npn \@@_acsc_o:w #1 \s_@@ \@@_chk:w #2#3#4\@@_sep: @ { \if_case:w \if_meaning:w 2 #2 #3 \fi: #2 \exp_stop_f: \@@_case_use:nw @@ -1630,7 +1658,7 @@ \or: \@@_case_return_same_o:w \else: \@@_case_return_o:Nw \c_minus_zero_fp \fi: - \s_@@ \@@_chk:w #2 #3 #4; + \s_@@ \@@_chk:w #2 #3 #4\@@_sep: } % \end{macrocode} % \end{macro} @@ -1644,7 +1672,7 @@ % \cs{@@_reverse_args:Nww} following precisely that appearing in % \cs{@@_acos_o:w}. % \begin{macrocode} -\cs_new:Npn \@@_asec_o:w #1 \s_@@ \@@_chk:w #2#3; @ +\cs_new:Npn \@@_asec_o:w #1 \s_@@ \@@_chk:w #2#3\@@_sep: @ { \if_case:w #2 \exp_stop_f: \@@_case_use:nw @@ -1658,7 +1686,7 @@ \or: \@@_case_use:nw { \@@_atan_inf_o:NNNw #1 0 4 } \else: \@@_case_return_same_o:w \fi: - \s_@@ \@@_chk:w #2 #3; + \s_@@ \@@_chk:w #2 #3\@@_sep: } % \end{macrocode} % \end{macro} @@ -1672,17 +1700,17 @@ % $\operatorname{acsc}(x)=\operatorname{asin}(1/x)$ and % $\operatorname{asec}(x)=\operatorname{acos}(1/x)$. % \begin{macrocode} -\cs_new:Npn \@@_acsc_normal_o:NfwNnw #1#2#3 \s_@@ \@@_chk:w 1#4#5#6; +\cs_new:Npn \@@_acsc_normal_o:NfwNnw #1#2#3 \s_@@ \@@_chk:w 1#4#5#6\@@_sep: { \int_compare:nNnTF {#5} < 1 { \@@_invalid_operation_o:fw {#2} - \s_@@ \@@_chk:w 1#4{#5}#6; + \s_@@ \@@_chk:w 1#4{#5}#6\@@_sep: } { \@@_ep_div:wwwwn - 1,{1000}{0000}{0000}{0000}{0000}{0000}; - #5,#6{0000}{0000}; + 1,{1000}{0000}{0000}{0000}{0000}{0000}\@@_sep: + #5,#6{0000}{0000}\@@_sep: { \@@_asin_auxi_o:NnNww #1 {#3} #4 } } } |