%%
%% This is file `mfpextra.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% minifp.dtx  (with options: `extra')
%% 
%% -------------------------------------------------------------------
%% 
%% Copyright 2008--2010, Daniel H. Luecking
%% 
%% Minifp may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3b of this license or (at
%% your option) any later version. The latest version of this license is in
%%    <http://www.latex-project.org/lppl.txt>
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2008/12/01 or later.
%% 
%% Minifp has maintenance status "author-maintained". The Current Maintainer
%% is Daniel H. Luecking. The Base Interpreters associated
%% with minifp are plain TeX and LaTeX.
%% 
\def\MFP@Rextra{%
  \def\Rcos  {\MFP@stack@Unary\MFP@Rcos }%
  \def\Rsin  {\MFP@stack@Unary\MFP@Rsin }%
  \def\Rangle{\MFP@stack@Binary\MFP@Rangle}%
  \def\Rrad  {\MFP@stack@Unary\MFP@Rrad }%
  \def\Rdeg  {\MFP@stack@Unary\MFP@Rdeg }%
  \def\Rlog  {\MFP@stack@Unary\MFP@Rlog }%
  \def\Rln   {\MFP@stack@Unary\MFP@Rln  }%
  \def\Rexp  {\MFP@stack@Unary\MFP@Rexp }%
  \def\Rsqrt {\MFP@stack@Unary\MFP@Rsqrt}%
  \def\Rpow  {\MFP@stack@Binary\MFP@Rpow}}%
\def\MFPcos   {\MFP@op@Unary\MFP@Rcos }%
\def\MFPsin   {\MFP@op@Unary\MFP@Rsin }%
\def\MFPangle {\MFP@op@Binary\MFP@Rangle}%
\def\MFPrad   {\MFP@op@Unary\MFP@Rrad }%
\def\MFPdeg   {\MFP@op@Unary\MFP@Rdeg }%
\def\MFPlog   {\MFP@op@Unary\MFP@Rlog }%
\def\MFPln    {\MFP@op@Unary\MFP@Rln  }%
\def\MFPexp   {\MFP@op@Unary\MFP@Rexp }%
\def\MFPsqrt  {\MFP@op@Unary\MFP@Rsqrt}%
\def\MFPpow   {\MFP@op@Binary\MFP@Rpow}%
\def\MFP@logofzero@err{%
  \MFP@errmsg{logarithm of zero}%
    {You tried to take the logarithm of zero. What were you %
     thinking? If you ^^Jcontinue, the value %
     assigned will be -\LogOfZeroInt.\LogOfZeroFrac.}}%
\def\LogOfZeroInt {\MaxRealInt}%
\def\LogOfZeroFrac{\MaxRealFrac}%
\def\MFP@expoverflow@err{%
  \MFP@errmsg{Power too large}%
    {The power you tried to calcualate is too large for %
     8 digits. If you continue, ^^Jthe value assigned will be %
     \MaxRealInt.\MaxRealFrac.}}%
\def\MFP@sqrtofneg@err{%
  \MFP@errmsg{square root of a negative number}%
    {You tried to take the square root of a negative value. What %
     were you thinking? If you continue, zero will be returned.}}%
\def\MFP@badpower@err{%
  \MFP@errmsg{negative power of zero}%
    {You tried to take a negative power of zero. What were you
     thinking? If you ^^Jcontinue, the value assigned will be %
     \xOverZeroInt.\xOverZeroFrac.}}%
\def\MFP@Rcopyz#1{\MFP@Rload {#1}\MFP@z@Sgn\MFP@z@Int\MFP@z@Frc}%
\def\MFP@Rcopyzx{\MFP@Rcopyz x}%
\def\MFP@Rcopyzy{\MFP@Rcopyz y}%
\def\MFP@Rdeg{%
  \MFP@Rcopy xt\MFP@Rload y1{57}{29577951}\MFP@Rmul
  \MFP@Rcopyz s\MFP@Rcopy tx\MFP@Rload y10{30823209}\MFP@Rmul
  \MFP@tempa\MFP@z@Int\relax
  \ifnum\MFP@z@Frc<50000000 \else \advance\MFP@tempa 1 \fi
  \MFP@Rload x{\ifnum\MFP@tempa>0 \MFP@z@Sgn\else0\fi}0\MFP@tempa
  \MFP@Rcopy sy\MFP@Radd}%
\def\MFP@Rrad{%
  \MFP@Rcopy xt\MFP@Rload y10{0174 5329}\MFP@Rmul
  \MFP@Rcopyz s\MFP@Rcopy tx\MFP@Rload y10{25199433}\MFP@Rmul
  \MFP@tempa\MFP@z@Int\relax
  \ifnum\MFP@z@Frc<50000000 \else \advance\MFP@tempa 1 \fi
  \MFP@Rload x{\ifnum\MFP@tempa>0 \MFP@z@Sgn\else0\fi}0\MFP@tempa
  \MFP@Rcopy sy\MFP@Radd}%
\def\MFP@Rcos{%
  \MFP@Rcopy xy\MFP@Rload x1{90}0\MFP@Rsub
  \MFP@Rcopyzx\MFP@Rsin}%
\def\MFP@Rsin{%
  \ifnum \MFP@x@Sgn=0 % return 0
    \MFP@Rzero
  \else
    \MFP@tempa\MFP@x@Int\relax
    \MFP@reduce@angle
    \ifnum \MFP@tempa<180
      \edef\MFP@sin@Sgn{\MFP@x@Sgn}%
    \else
      \edef\MFP@sin@Sgn{\number-\MFP@x@Sgn}%
      \advance \MFP@tempa-180
    \fi
    \MFP@tempb\MFP@x@Frc\relax
    \ifnum\MFP@tempa>0
      \MFP@@Rsin
    \else\ifnum\MFP@tempb>0
      \MFP@@Rsin
    \else
      \MFP@Rzero
    \fi\fi
  \fi}%
\def\MFP@reduce@angle{%
  \ifnum\MFP@tempa<360
  \else
    \advance\MFP@tempa-360
    \@xp\MFP@reduce@angle
  \fi}%
\def\MFP@@Rsin{%
  \ifnum\MFP@tempa<90
  \else
    \ifnum\MFP@tempb>0
      \advance\MFP@tempa 1
      \MFP@tempb -\MFP@tempb
      \advance\MFP@tempb \MFP@ttteight\relax
    \fi
    \MFP@tempa -\MFP@tempa
    \advance\MFP@tempa 180
  \fi
  \ifnum\MFP@tempa=90
    \MFP@Rloadz \MFP@sin@Sgn10%
  \else
    \advance\MFP@tempb 50 \divide\MFP@tempb 100
    \multiply\MFP@tempa 1000000 \advance\MFP@tempb\MFP@tempa
    \ifnum\MFP@tempb=0
      \MFP@Rzero
    \else
      \MFP@Rload x10\MFP@tempb
      \MFP@Rcopy xs%
      \MFP@Rsq
      \ifnum \MFP@z@Frc>0
        \MFP@Rcopyz t\MFP@Rsin@prog
      \else
        \MFP@Rcopy sx%
      \fi
      \MFP@Rload y11{74532925}\MFP@Rmul
      \ifnum\MFP@z@Sgn=0 \else
        \let\MFP@z@Sgn\MFP@sin@Sgn
      \fi
    \fi
  \fi}%
\def\MFP@Rsin@prog{%
  \MFP@Rcopy tx%
  \MFP@Rload y10{00559959}\MFP@Rsmul\MFP@com@iter{01450559}%
  \MFP@com@iter{01952675}\MFP@com@iter{02769249}\MFP@com@iter{04230797}%
  \MFP@com@iter{07252796}\MFP@com@iter{15230871}\MFP@com@iter{50769570}%
  \MFP@flipz \MFP@Rcopyzx \MFP@Rcopy sy\MFP@Rsmul \MFP@Rcopyzx}%
\def\MFP@flipz{%
  \ifnum\MFP@z@Sgn=0
    \MFP@Rloadz 110%
  \else
      \MFP@tempa\MFP@ttteight
      \advance\MFP@tempa-\MFP@z@Frc\relax
      \MFP@Rloadz{\ifcase\MFP@tempa 0\else1\fi}0\MFP@tempa
  \fi}%
\def\MFP@com@iter#1{\MFP@flipz
  \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul
  \MFP@Rcopyzx\MFP@Rload y10{#1}\MFP@Rsmul}%
\def\MFP@Rsmul{%
  \ifnum \MFP@x@Sgn=0
    \MFP@Rzero
  \else\ifnum \MFP@y@Sgn=0
    \MFP@Rzero
  \else\ifnum\MFP@x@Int>0
    \MFP@Rcopy yz%
  \else\ifnum\MFP@y@Int>0
    \MFP@Rcopy xz%
  \else
    \MFP@@Rsmul
  \fi\fi\fi\fi}%
\def\MFP@@Rsmul{%
  \MFP@split\MFP@x@Frc\MFP@x@Frc@i\MFP@x@Frc@ii
  \MFP@split\MFP@y@Frc\MFP@y@Frc@i\MFP@y@Frc@ii
  \def\MFP@z@Frc@i  {0}\def\MFP@z@Frc@ii {0}%
  \def\MFP@z@Frc@iii{0}\def\MFP@z@Frc@iv {0}%
  \MFP@tempb\MFP@y@Frc@ii\relax
  \MFP@multiplyone\MFP@x@Frc@ii\MFP@z@Frc@iv
  \MFP@multiplyone\MFP@x@Frc@i\MFP@z@Frc@iii
  \MFP@tempb\MFP@y@Frc@i\relax
  \MFP@multiplyone\MFP@x@Frc@ii\MFP@z@Frc@iii
  \MFP@multiplyone\MFP@x@Frc@i\MFP@z@Frc@ii
  \MFP@carrym\MFP@z@Frc@iv\MFP@z@Frc@iii
  \MFP@carrym\MFP@z@Frc@iii\MFP@z@Frc@ii
  \ifnum\MFP@z@Frc@iii<5000 \else
    \MFP@tempb\MFP@z@Frc@ii
    \advance\MFP@tempb1
    \edef\MFP@z@Frc@ii{\number\MFP@tempb}\fi
  \MFP@carrym\MFP@z@Frc@ii\MFP@z@Frc@i
  \makeMFP@fourdigits\MFP@z@Frc@iv
  \makeMFP@fourdigits\MFP@z@Frc@iii
  \makeMFP@fourdigits\MFP@z@Frc@ii
  \makeMFP@fourdigits\MFP@z@Frc@i
  \def\MFP@z@Int{0}%
  \edef\MFP@z@Frc{\MFP@z@Frc@i\MFP@z@Frc@ii}%
  \edef\MFP@z@Sgn{\ifnum\MFP@z@Frc=0 0\else 1\fi}%
  \edef\MFP@z@Und{\MFP@z@Frc@iii\MFP@z@Frc@iv}%
  \edef\MFP@z@Ovr{0}}%
\def\MFP@Rangle{%
  \ifcase\MFP@y@Sgn\relax
    \ifcase\MFP@x@Sgn\relax
      \MFP@warn{Point (0,0) has no angle. Returning 0 anyway}%
      \MFP@Rzero
    \or
      \MFP@Rzero
    \else
      \MFP@Rloadz 1{180}0%
    \fi
    \@xp\@gobble
  \or
    \def\MFP@angle@Sgn{1}\@xp\@firstofone
  \else
    \def\MFP@y@Sgn{1}%
    \def\MFP@angle@Sgn{-1}\@xp\@firstofone
  \fi
 {\ifcase\MFP@x@Sgn\relax
    \MFP@Rloadz1{90}0%
  \or  \MFP@@Rangle
  \else
    \def\MFP@x@Sgn{1}\MFP@@Rangle
    \MFP@Rcopyzy\MFP@Rload x1{180}0\MFP@Rsub
  \fi
  \let\MFP@z@Sgn\MFP@angle@Sgn
 }}%
\def\MFP@@Rangle{%
  \MFP@Rcmp
  \ifMFP@neg
    \MFP@Rcopy xs\MFP@Rcopy yx\MFP@Rcopy sy%
    \MFP@@@Rangle
    \MFP@Rload x1{90}0\MFP@Rcopyzy\MFP@Rsub
  \else
    \MFP@@@Rangle
  \fi
}%
\def\MFP@Rquad{\MFP@Rdbl\MFP@Rcopyzx\MFP@Rdbl}%
\def\MFP@@@Rangle{%
  \MFP@Rcopy xs\MFP@Rcopy yt%
  \ifnum\MFP@y@Int<500000
  \else
     \MFP@Rload y1{200}0\MFP@Rdiv
     \MFP@Rcopyz s\MFP@Rcopy tx%
     \MFP@Rload y1{200}0\MFP@Rdiv
     \MFP@Rcopyz t%
  \fi
  \MFP@Rcopy tx\MFP@Rdbl\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rcmp
  \ifMFP@pos
    \MFP@Rsub\MFP@Rcopyz u\MFP@Rcopy sx\MFP@Rdbl
    \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd
    \MFP@Rcopyz s\MFP@Rcopy ut%
    \MFP@Rload a1{2656}{50511771}%
  \else
    \MFP@Rload a000%
  \fi
  \MFP@Rcopy tx\MFP@Rquad\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rcmp
  \ifMFP@pos
    \MFP@Rsub\MFP@Rcopyz u\MFP@Rcopy sx\MFP@Rquad
    \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd
    \MFP@Rcopyz s\MFP@Rcopy ut%
    \MFP@Rcopy ax\MFP@Rload y1{1403}{62434679}%
    \MFP@Radd\MFP@Rcopy za%
  \fi
  \MFP@Rcopy tx\MFP@RmulC
  \MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rdiv
  \MFP@Rcopyzx\MFP@Ratanc
  \MFP@Rcopyzx\MFP@Rdeg
  \MFP@Rcopyzx\MFP@Rcopy ay\MFP@Radd
  \MFP@Rcopyzx\MFP@RdivC}%
\def\MFP@RmulC{%
  \makeMFP@eightdigits\MFP@x@Frc
  \edef\MFP@Tmp{\number\MFP@x@Int.\MFP@x@Frc}%
  \@xp\MFP@@RmulC\MFP@Tmp\mfp@end}%
\def\MFP@@RmulC#1.#2#3#4\mfp@end{%
  \MFP@Rloadz\MFP@x@Sgn{#1#2#3}{#400}}%
\def\MFP@RdivC{%
  \makeMFP@eightdigits\MFP@x@Int
  \makeMFP@eightdigits\MFP@x@Frc
  \@XP\MFP@@RdivC\@xp\MFP@x@Int\MFP@x@Frc\mfp@end}%
\def\MFP@@RdivC#1#2#3#4#5#6{%
  \edef\MFP@z@Int{\number#1#2#3#4#5#6}%
  \MFP@@@RdivC}%
\def\MFP@@@RdivC#1#2#3#4#5#6#7#8#9\mfp@end{%
  \MFP@tempa#1#2#3#4#5#6#7#8\relax
  \ifnum#9>49 \advance\MFP@tempa1 \fi
  \edef\MFP@z@Sgn{\MFP@x@Sgn}%
  \ifnum\MFP@tempa=0 \ifnum\MFP@x@Int=0 \def\MFP@z@Sgn{0}\fi\fi
  \MFP@Rloadz\MFP@z@Sgn\MFP@z@Int\MFP@tempa}%
\def\MFP@scaledmul{\MFP@Rmul\MFP@Rcopyzx\MFP@RdivC}%
\def\MFP@atan@iter#1#2{%
  \MFP@Rcopy uy\MFP@scaledmul
  \MFP@Rcopyzx\MFP@Rload y1{#1}{#2}\MFP@scaledmul
  \MFP@Rcopyzy\MFP@Rload x1{100}{00000000}%
  \MFP@Rsub\MFP@Rcopyzx}%
\def\MFP@Ratanc{%
  \MFP@Rcopy xs%
  \MFP@Rcopy xy\MFP@scaledmul\MFP@Rcopyz u%
  \MFP@Rcopyzx\MFP@Rload y1{86}{66666667}%
  \MFP@scaledmul
  \MFP@Rcopyzy\MFP@Rload x1{100}{00000000}%
  \MFP@Rsub\MFP@Rcopyzx
  \MFP@atan@iter{84}{61538462}\MFP@atan@iter{81}{81818182}%
  \MFP@atan@iter{77}{77777778}\MFP@atan@iter{71}{42857143}%
  \MFP@atan@iter{60}{00000000}\MFP@atan@iter{33}{33333333}%
  \MFP@Rcopy sy\MFP@scaledmul}%
\def\MFP@Rlog{%
  \ifnum\MFP@x@Sgn=0
    \MFP@logofzero@err
    \MFP@Rloadz{-1}\LogOfZeroInt\LogOfZeroFrac
  \else
    \ifnum \MFP@x@Sgn<0
      \MFP@warn{The logarithm of a negative number is complex.%
      \MFP@msgbreak Only the real part will be computed}%
    \fi
    \MFP@Rload s000%
    \ifnum \MFP@x@Int=0
      \edef\MFP@x@Tmp{\number\MFP@x@Frc}%
      \MFP@tempa=\MFP@numzeros\MFP@x@Tmp\relax
      \def\MFP@s@Sgn{-1}%
      \edef\MFP@t@Int{\@xp\MFP@firstofmany\MFP@x@Tmp\mfp@end}%
      \edef\MFP@t@Frc{\@xp\@gobble\MFP@x@Tmp0}%
      \MFPpadto@eight\MFP@t@Frc
    \else
      \MFP@tempa\MFP@numdigits\MFP@x@Int
      \edef\MFP@x@Tmp{\MFP@x@Int\MFP@x@Frc}% gather all digits
      \edef\MFP@s@Sgn{1}%
      \edef\MFP@t@Int{\@xp\MFP@firstofmany\MFP@x@Tmp\mfp@end}%
      \edef\MFP@x@Tmp{\@xp\@gobble\MFP@x@Tmp}%
      \edef\MFP@t@Frc{\@xp\MFP@firsteightofmany\MFP@x@Tmp\mfp@end}%
    \fi
    \edef\MFP@s@Int{\number\MFP@tempa}%
    \def\MFP@t@Sgn{1}%
    \MFP@Rlog@reduce
    \ifnum\MFP@t@Frc=0
      \MFP@Rcopy sz%
    \else
      \MFP@Rlog@prog
    \fi
  \fi}%
\def\showreg #1{% for debugging
\begingroup
  \edef\reg{%
    #1 = (\csname MFP@#1@Sgn\endcsname)%
          \csname MFP@#1@Int\endcsname.%
          \csname MFP@#1@Frc\endcsname}%
  \show\reg
\endgroup}%
\def\MFP@numdigits#1{\@xp\MFP@ninthofmany#176543210\mfp@end}%
\def\MFP@numzeros#1{%
  \@xp\MFP@ninthofmany#112345678\mfp@end}%
\def\MFP@Rlog@reduce{%
  \MFP@reduceonce 3{16227766}{31622777}{50000000}%
  \MFP@reduceonce 1{77827941}{56234133}{25000000}%
  \MFP@reduceonce 1{33352143}{74989421}{12500000}%
  \MFP@reduceonce 1{15478198}{86596433}{06250000}}%
\def\MFP@reduceonce#1#2#3#4{%
  \MFP@Rcopy tx\MFP@Rload y1{#1}{#2}\MFP@Rcmp
  \ifMFP@neg\else
    \MFP@Rload y10{#3}\MFP@Rmul
    \MFP@Rcopyz t\MFP@Rcopy sx\MFP@Rload y10{#4}\MFP@Radd
    \MFP@Rcopyz s%
  \fi}%
\def\MFP@Rlog@prog{%
  \MFP@Rcopy tx\MFP@Rdecr
  \MFP@Rcopyz t%
  \MFP@Rcopyzx\MFP@Rload y10{43750000}\MFP@Rsmul
  \MFP@com@iter{85714286}\MFP@com@iter{83333333}\MFP@com@iter{80000000}%
  \MFP@com@iter{75000000}\MFP@com@iter{66666667}\MFP@com@iter{50000000}%
  \MFP@com@iter{43429448}\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Radd}%
\def\MFP@Rln{%
  \MFP@Rlog\MFP@Rcopyzx\MFP@Rload y12{30258509}\MFP@Rmul}%
\def\MFP@Rexp{%
  \ifcase\MFP@x@Sgn\relax
    \MFP@Rloadz 110%
  \or
    \MFP@Rexp@pos
  \else
    \def\MFP@x@Sgn{1}%
    \MFP@Rexp@neg
  \fi}%
\def\MFP@Rexp@pos{%
  \MFP@Rload y1{18}{42068074}\MFP@Rcmp
  \ifMFP@pos % overflow
    \MFP@expoverflow@err
    \MFP@Rloadz 1\MaxRealInt\MaxRealFrac
  \else % handle integer part
    \MFP@tempa\MFP@x@Int
    \edef\MFP@powerof@e{%
     1\ifcase\MFP@tempa
      10\or
      2{71828183}\or
      7{38905610}\or
      {20}{08553692}\or
      {54}{59815003}\or
      {148}{41315910}\or
      {403}{42879349}\or
      {1096}{63315843}\or
      {2980}{95798704}\or
      {8103}{08392758}\or
      {22026}{46579481}\or
      {59874}{14171520}\or
      {162754}{79141900}\or
      {442413}{39200892}\or
      {1202604}{28416478}\or
      {3269017}{37247211}\or
      {8886110}{52050787}\or
      {24154952}{75357530}\or
      {65659969}{13733051}\else
      {\MaxRealInt}{\MaxRealFrac}\fi}%
    \@xp\MFP@Rloadz\MFP@powerof@e
    \ifnum\MFP@x@Frc=0
    \else
      \MFP@Rcopyz s%
      \MFP@tempa=\@xp\MFP@firstofmany\MFP@x@Frc\mfp@end
      \edef\MFP@powerof@e{%
      y1\ifcase\MFP@tempa
        10\or
        1{10517092}\or
        1{22140276}\or
        1{34985881}\or
        1{49182470}\or
        1{64872127}\or
        1{82211880}\or
        2{01375271}\or
        2{22554093}\or
        2{45960311}\else
        10\fi}%
      \edef\MFP@t@Frc{0\@xp\@gobble\MFP@x@Frc}%
      \MFP@Rcopy sx\@xp\MFP@Rload\MFP@powerof@e\MFP@Rmul
      \ifnum\MFP@t@Frc=0
      \else % handle the rest
        \MFP@Rcopyz s\MFP@Rload t10\MFP@t@Frc
        \MFP@Rexp@pos@prog
        \MFP@Rcopy sx\MFP@Rcopyzy\MFP@Rmul
      \fi
    \fi
  \fi}%
\def\MFP@Rexp@pos@prog{%
  \MFP@Rcopy tz\MFP@Rexp@iter{16666667}\MFP@Rexp@iter{20000000}%
  \MFP@Rexp@iter{25000000}\MFP@Rexp@iter{33333333}%
  \MFP@Rexp@iter{50000000}\MFP@Rcopyzx\MFP@Rincr}%
\def\MFP@Rexp@iter#1{%
  \MFP@Rcopyzx\MFP@Rload y10{#1}\MFP@Rsmul
  \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul
  \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd}%
\def\MFP@Rexp@neg{%
  \MFP@Rload y1{19}{11382792}%
  \MFP@Rcmp
  \ifMFP@pos
    \MFP@Rloadz 000%
  \else % handle integer part
    \MFP@tempa\MFP@x@Int
    \edef\MFP@powerof@e{%
      \ifcase\MFP@tempa
      11{0}\or
      10{36787944}\or
      10{13533528}\or
      10{04978707}\or
      10{01831564}\or
      10{00673795}\or
      10{00247875}\or
      10{00091188}\or
      10{00033546}\or
      10{00012341}\or
      10{00004540}\or
      10{00001670}\or
      10{00000614}\or
      10{00000226}\or
      10{00000083}\or
      10{00000031}\or
      10{00000011}\or
      10{00000004}\or
      10{00000002}\or
      10{00000001}\else
      000\fi}%
    \@xp\MFP@Rloadz\MFP@powerof@e
    \ifnum\MFP@x@Frc=0
    \else % handle first decimal digit
      \MFP@Rcopyz s%
      \MFP@tempa=\@xp\MFP@firstofmany\MFP@x@Frc\mfp@end
      \edef\MFP@powerof@e{%
      y1\ifcase\MFP@tempa
        10\or
        0{90483742}\or
        0{81873075}\or
        0{74081822}\or
        0{67032005}\or
        0{60653066}\or
        0{54881164}\or
        0{49658530}\or
        0{44932896}\or
        0{40656966}\else
        10\fi}%
      \edef\MFP@t@Frc{0\@xp\@gobble\MFP@x@Frc}%
      \MFP@Rcopy sx\@xp\MFP@Rload\MFP@powerof@e\MFP@Rmul
      \ifnum\MFP@t@Frc=0
      \else % handle the rest
        \MFP@Rcopyz s\MFP@Rload t10\MFP@t@Frc
        \MFP@Rexp@neg@prog
        \MFP@Rcopy sx\MFP@Rcopyzy\MFP@Rmul
      \fi
    \fi
  \fi}%
\def\MFP@Rexp@neg@prog{%
  \MFP@Rcopy tx\MFP@Rload y10{16666667}\MFP@Rsmul
  \MFP@com@iter{20000000}\MFP@com@iter{25000000}%
  \MFP@com@iter{33333333}\MFP@com@iter{50000000}%
  \MFP@flipz\MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul\MFP@flipz}%
\def\MFP@Rpow{%
  \ifnum\MFP@y@Frc>0
    \MFP@warn{The "pow" function requires an integer power.
      \MFP@msgbreak The fractional part will be ignored}%
  \fi
  \MFP@loopctr=\MFP@y@Int\relax
  \ifnum\MFP@loopctr=0
    \MFP@Rloadz 110%
  \else
    \ifnum\MFP@x@Sgn=0
      \ifnum\MFP@y@Sgn>0
        \MFP@Rloadz 000%
      \else
        \MFP@badpower@err
        \MFP@Rloadz 1\xOverZeroInt\xOverZeroFrac
      \fi
    \else % integer power of nonzero number
      % get the sign in case an overflow interrupts the calculations.
      \ifnum\MFP@x@Sgn>0
        \def\MFP@power@Sgn{1}%
      \else
        \edef\MFP@power@Sgn{\ifodd\MFP@loopctr -\fi 1}%
\ifMFPdebug
        \show\MFP@power@Sgn
\fi
      \fi
      \ifnum\MFP@y@Sgn<0 \MFP@Rinv \MFP@Rcopyzx\fi
      \ifnum\MFP@loopctr=1
        \MFP@Rloadz \MFP@power@Sgn\MFP@x@Int\MFP@x@Frc
      \else
        \MFP@@Rpow
\ifMFPdebug
        \showreg z%
\fi
      \fi
    \fi
  \fi}%                     %
\def\MFP@@Rpow{%
  \MFP@Rcopy xq% initialize register to be squared
  \MFP@Rload p110% initialize register to hold partial products
  \MFP@Rpow@loop}%
\def\MFP@Rpow@loop{%
  \ifodd\MFP@loopctr
    \MFP@Rcopy px\MFP@Rcopy qy\MFP@Rmul
    \ifnum \MFP@z@Ovr>0 \MFP@handle@expoverflow
    \else
      \ifnum\MFP@loopctr>1 \MFP@Rcopyz p\fi
    \fi
  \fi
  \ifnum\MFP@loopctr>1
    \MFP@Rcopy qx\MFP@Rsq
    \ifnum \MFP@z@Ovr>0 \MFP@handle@expoverflow
    \else
      \MFP@Rcopyz q%
      \divide\MFP@loopctr 2
      \@XP\MFP@Rpow@loop
    \fi
  \fi}%
\def\MFP@handle@expoverflow{%
  \MFP@expoverflow@err
  \MFP@loopctr=0
  \MFP@Rloadz\MFP@power@Sgn\MaxRealInt\MaxRealFrac
}%
\def\MFP@Rsqrt{%
  \ifcase\MFP@x@Sgn\relax
    \MFP@Rzero
  \or
    \ifnum\MFP@x@Int=0
      \let\MFP@sqrt@reduce=Y%
      \edef\MFP@x@Int{\number\MFP@x@Frc}%
      \edef\MFP@x@Frc{00000000}%
    \else
      \let\MFP@sqrt@reduce=N%
    \fi
    \MFP@Rcopy xt%
    \MFP@Isqrt
    \MFP@Rcopyz s\MFP@Rcopyzy
    \MFP@Rcopy tx\MFP@Rdiv
    \MFP@Rcopy sx\MFP@Rcopyzy\MFP@Radd
    \MFP@Rcopyzx\MFP@Rhalve
    \ifx Y\MFP@sqrt@reduce
      \MFP@Rcopyzx\MFP@Rload y10{10000}\MFP@Rmul
    \fi
  \else
    \MFP@sqrtofneg@err
    \MFP@Rzero
  \fi}%
\def\MFP@ItoQ#1#2{%
  \MFP@tempa#1\relax\MFP@tempb#2\relax
  \def\MFP@ItoQ@Tmp{}\MFP@ItoQ@loop}%
\def\MFP@ItoQ@loop{%
  \ifodd\MFP@tempb
    \ifodd\MFP@tempa \advance\MFP@tempb \MFP@ttteight\relax\fi
    \divide\MFP@tempa2 \divide\MFP@tempb2
    \edef\MFP@ItoQ@Tmp{\ifodd\MFP@tempb 3\else 1\fi\MFP@ItoQ@Tmp}%
  \else
    \ifodd\MFP@tempa \advance\MFP@tempb \MFP@ttteight\relax\fi
    \divide\MFP@tempa2 \divide\MFP@tempb2
    \edef\MFP@ItoQ@Tmp{\ifodd\MFP@tempb 2\else 0\fi\MFP@ItoQ@Tmp}%
  \fi
  \ifodd\MFP@tempa \advance\MFP@tempb \MFP@ttteight\relax\fi
  \divide\MFP@tempa 2 \divide\MFP@tempb 2
  \ifnum\MFP@tempa>0
    \@xp\MFP@ItoQ@loop
  \else\ifnum\MFP@tempb>0
    \@XP\MFP@ItoQ@loop
  \fi\fi}%
\def\MFP@Isqrt{%
  \MFP@ItoQ\MFP@x@Int\MFP@x@Frc
  \MFP@tempa=0 \MFP@tempb=0 \MFP@tempc=0
  \expandafter\MFP@Isqrt@loop\MFP@ItoQ@Tmp\mfp@end
  \MFP@tempa=\MFP@tempc
  \divide\MFP@tempc\MFP@tttfour
  \edef\MFP@z@Int{\number\MFP@tempc}%
  \multiply\MFP@tempc \MFP@tttfour
  \advance\MFP@tempa -\MFP@tempc
  \edef\MFP@z@Frc{\number\MFP@tempa}%
  \makeMFP@fourdigits\MFP@z@Frc
  \edef\MFP@z@Frc{\MFP@z@Frc0000}%
  \def\MFP@z@Sgn{1}}%
\def\MFP@Isqrt@loop#1{%
  \ifx\mfp@end #1%
  \else
    \multiply\MFP@tempa 2 \multiply\MFP@tempb 4 \multiply\MFP@tempc 2
    \advance \MFP@tempb#1\relax
    \ifnum\MFP@tempa<\MFP@tempb
       \advance\MFP@tempc 1 \advance\MFP@tempa 1
       \advance\MFP@tempb -\MFP@tempa
       \advance\MFP@tempa 1
    \fi
    \expandafter\MFP@Isqrt@loop
  \fi
}%
\endinput
%%
%% End of file `mfpextra.tex'.
