%%
%% 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.
%% 
\expandafter\ifx\csname MFP@xfinish\endcsname\relax
\else \expandafter\endinput\fi
\expandafter\edef\csname MFP@xfinish\endcsname{%
  \catcode64=\the\catcode64 \space
  \catcode46=\the\catcode46 \space
  \catcode60=\the\catcode60 \space
  \catcode62=\the\catcode62 \space}%
\catcode64=11 % @
\catcode46=12 % . (period)
\catcode60=12 % <
\catcode62=12 % >
\ifx\MFP@Rextra\UndEfInEd \input minifp.sty \fi
\ifx\MFP@Rextra\@empty
\else
  \immediate\write16{mfpextra.tex: already loaded.^^J}%
  \MFP@xfinish
  \expandafter\endinput
\fi
\immediate\write16{%
    mfpextra.tex: extra operations for the MiniFP package.^^J}%
\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\Rrand {\MFP@stack@Unary\MFP@Rrand}%
  \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\MFPrand  {\MFP@op@Unary\MFP@Rrand}%
\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 calculate is too large for %
     8 digits. If you continue, ^^Jthe value assigned will be %
     \MaxRealInt.\MaxRealFrac.}}%
\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\MFPshowreg #1{%
\ifMFPdebug
\begingroup
  \edef\theregister{%
    #1 =  \expandafter \MFP@Sign
          \csname MFP@#1@Sgn\endcsname %
          \csname MFP@#1@Int\endcsname.%
          \csname MFP@#1@Frc\endcsname}%
  \show\theregister
\endgroup
\fi}%
\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@DPmul#1#2#3{%
  \ifnum\MFP@x@Sgn=0
    \MFP@Rzero
  \else
    \MFP@Rcopy xv%
    \MFP@Rload y1{#1}{#2}\MFP@Rmul
    \edef\MFP@w@Und{\MFP@z@Und}%
    \ifnum\MFP@z@Frc@iii>4999
      \MFP@tempa\MFP@z@Frc \advance\MFP@tempa-1
      \edef\MFP@z@Frc{\number\MFP@tempa}%
      \makeMFP@eightdigits\MFP@z@Frc
    \fi
    \MFP@Rcopyz w%
    \MFP@Rcopy vx\MFP@Rload y10{#3}\MFP@Rmul
    \MFP@Rcopyzx\MFP@Rload y\MFP@v@Sgn 0{\MFP@w@Und}\MFP@Radd
    \MFP@tempa\MFP@z@Int\relax
    \ifnum\MFP@z@Frc<50000000 \else \advance\MFP@tempa 1 \fi
    \ifnum\MFP@tempa<\MFP@ttteight\relax
      \MFP@Rload x{\ifnum\MFP@tempa>0 \MFP@z@Sgn\else0\fi}0\MFP@tempa
    \else
      \MFP@Rload x\MFP@z@Sgn10%
    \fi
    \MFP@Rcopy wy\MFP@Radd
  \fi}%
\def\MFP@Rdeg{\MFP@DPmul{57}{29577951}{30823209}}%
\def\MFP@Rrad{\MFP@DPmul{0}{01745329}{25199433}}%
\def\MFP@RbaseX{\MFP@DPmul{0}{43429448}{19032518}}%
\def\MFP@RbaseE{\MFP@DPmul{2}{30258509}{29940457}}%
\def\MFP@Rcos{%
  \MFP@Rcopy xy\MFP@Rload x1{90}0\MFP@Rsub
  \MFP@Rcopyzx\MFP@Rsin}%
\def\MFP@Rsin{%
  \MFP@tempa\MFP@x@Int
  \MFP@tempb\MFP@x@Frc
  \MFP@tempc\MFP@x@Sgn\relax
  \MFP@reduce@angle
  \ifnum\MFP@tempa>0  \MFP@@Rsin
  \else\ifnum\MFP@tempb>0  \MFP@@Rsin
  \else  \MFP@Rzero
  \fi\fi}%
\def\MFP@reduce@angle{%
  \ifnum\MFP@tempa<180
  \else
    \advance\MFP@tempa-180
    \MFP@tempc-\MFP@tempc
    \@xp\MFP@reduce@angle
  \fi}%
\def\MFP@@Rsin{%
  \ifnum\MFP@tempa<90
  \else
    \MFP@tempa -\MFP@tempa
    \ifnum\MFP@tempb>0
      \MFP@tempb -\MFP@tempb
      \advance\MFP@tempb \MFP@ttteight\relax
      \advance\MFP@tempa 179
    \else  \advance\MFP@tempa 180
    \fi
  \fi
  \ifnum\MFP@tempa=90
    \MFP@Rloadz \MFP@tempc10%
  \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 s\MFP@tempc0\MFP@tempb
      \MFP@Rcopy sx%
      \MFP@Rsq
      \ifnum \MFP@z@Frc>0
        \MFP@Rcopyz t\MFP@Rsin@prog
      \else
        \MFP@Rcopy sx%
      \fi
      \MFP@DPmul 1{74532925}{19943296}%
    \fi
  \fi}%
\def\MFP@Rsin@prog{%
  \MFP@Rcopy tx\MFP@Rload y10{01952676}\MFP@Rsmul%
  \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\edef\MFP@x@Sgn{\MFP@s@Sgn}}%
\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@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}}%
\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 xw\MFP@Rcopy yx\MFP@Rcopy wy%
    \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@x@Int<1000000
  \else
    \MFP@RdivC \MFP@Rcopyz s%
    \MFP@Rcopy tx\MFP@RdivC \MFP@Rcopyz t%
  \fi
  \ifnum\MFP@t@Sgn=0 \MFP@Rzero
  \else
    \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
  \fi}%
\def\MFP@twoofmany#1#2#3\MFP@end{#1#2}%
\def\MFP@gobbletwo#1#2{}%
\def\MFP@RmulC{%
  \edef\MFP@z@Int{\MFP@x@Int\@xp\MFP@twoofmany\MFP@x@Frc\MFP@end}%
  \edef\MFP@z@Frc{\@xp\MFP@gobbletwo\MFP@x@Frc00}%
  \edef\MFP@z@Sgn{\MFP@x@Sgn}}%
\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@Frc{\number\MFP@tempa}%
  \makeMFP@eightdigits\MFP@z@Frc
  \edef\MFP@z@Sgn{\MFP@x@Sgn}%
  \ifnum\MFP@tempa=0
    \ifnum\MFP@z@Int=0 \def\MFP@z@Sgn{0}\fi
  \fi}%
\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
  \ifnum \MFP@z@Sgn=0
    \MFP@Rcopy sz%
  \else
    \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
  \fi}%
\newif\ifMFP@natural
\def\MFP@Rlog{\MFP@naturalfalse\MFP@Rlog@}%
\def\MFP@Rln{\MFP@naturaltrue\MFP@Rlog@}%
\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}%
      \def\MFP@x@Sgn{1}%
    \fi
    \MFP@Rload s000%
    \ifnum \MFP@x@Int=0
      \edef\MFP@x@Tmp{\number\MFP@x@Frc}%
      \MFP@tempa=\MFP@numshiftL\MFP@x@Tmp\relax
      \def\MFP@s@Sgn{-1}%
      \edef\MFP@t@Int{\@xp\MFP@oneofmany\MFP@x@Tmp\MFP@end}%
      \edef\MFP@t@Frc{\@xp\@gobble\MFP@x@Tmp0}%
      \MFP@padtoeight\MFP@t@Frc
    \else
      \MFP@tempa\MFP@numshiftR\MFP@x@Int
      \edef\MFP@x@Tmp{\MFP@x@Int\MFP@x@Frc}%
      \ifnum\MFP@tempa>0 \def\MFP@s@Sgn{1}\fi
      \edef\MFP@t@Int{\@xp\MFP@oneofmany\MFP@x@Tmp\MFP@end}%
      \edef\MFP@x@Tmp{\@xp\@gobble\MFP@x@Tmp}%
      \edef\MFP@t@Frc{\@xp\MFP@eightofmany\MFP@x@Tmp\MFP@end}%
    \fi
    \edef\MFP@s@Int{\number\MFP@tempa}%
    \def\MFP@t@Sgn{1}%
    \MFP@Rlog@reduce
    \ifMFP@natural \MFP@Rcopy sx\MFP@RbaseE \MFP@Rcopy zs\fi
    \ifnum\MFP@t@Frc=0
      \MFP@Rcopy sz%
    \else
      \def\MFP@t@Int{0}\MFP@Rlog@prog
      \ifMFP@natural\else \MFP@Rcopyzx \MFP@RbaseX \fi
      \MFP@Rcopy sy\MFP@Rcopyzx\MFP@Radd
    \fi
  \fi}%
\def\MFP@numshiftR#1{\@xp\MFP@ninthofmany#176543210\MFP@end}%
\def\MFP@numshiftL#1{\@xp\MFP@ninthofmany#112345678\MFP@end}%
\def\MFP@Rlog@reduce{%
  \MFP@Rcopy tx\MFP@RmulC\MFP@Rcopyz t%
  \MFP@reduceonce {316}{31622776}{60168379}{50000000}%
  \MFP@reduceonce {177}{56234132}{51903491}{25000000}%
  \MFP@reduceonce {133}{74989420}{93324558}{12500000}%
  \MFP@reduceonce {115}{86596432}{33600654}{06250000}%
  \MFP@Rcopy tx\MFP@RdivC\MFP@Rcopyz t}%
\def\MFP@reduceonce#1#2#3#4{%
  \ifnum\MFP@t@Int>#1\relax
    \MFP@Rcopy tx%
    \MFP@DPmul 0{#2}{#3}\MFP@Rcopyz t%
    \MFP@Rcopy sx\MFP@Rload y10{#4}\MFP@Radd
    \MFP@Rcopyz s%
  \fi}%
\def\MFP@Rlog@prog{%
  \MFP@Rcopy tx\MFP@Rload y10{88888889}\MFP@Rsmul
  \MFP@com@iter{87500000}\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@flipz\MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul}%
\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
    \MFP@expoverflow@err
    \MFP@Rloadz 1\MaxRealInt\MaxRealFrac
  \else
    \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@oneofmany\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
        \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{14285714}\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
    \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
      \MFP@Rcopyz s%
      \MFP@tempa=\@xp\MFP@oneofmany\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
        \MFP@Rcopyz s\MFP@Rload t10\MFP@t@Frc
        \MFP@Rexp@neg@prog
        \MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rmul
      \fi
    \fi
  \fi}%
\def\MFP@Rexp@neg@prog{%
  \MFP@Rcopy tx\MFP@Rload y10{14285712}\MFP@Rsmul
  \MFP@com@iter{16666667}\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
      \ifnum\MFP@x@Sgn>0
        \def\MFP@power@Sgn{1}%
      \else
        \edef\MFP@power@Sgn{\ifodd\MFP@loopctr -\fi 1}%
      \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
      \fi
    \fi
  \fi}%
\def\MFP@@Rpow{%
  \MFP@Rcopy xq%
  \MFP@Rload p110%
  \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
      \def\MFP@sqrt@reduce{2}%
      \edef\MFP@x@Int{\number\MFP@x@Frc}%
      \edef\MFP@x@Frc{00000000}%
    \else\ifnum\MFP@x@Int<10000
      \def\MFP@sqrt@reduce{1}%
      \edef\MFP@x@Int{\MFP@x@Int\@xp\MFP@fourofmany\MFP@x@Frc\MFP@end}%
      \edef\MFP@x@Frc{\@xp\MFP@gobblefour\MFP@x@Frc0000}%
    \else
      \def\MFP@sqrt@reduce{0}%
    \fi\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
    \ifcase \MFP@sqrt@reduce\relax
    \or
      \MFP@Rcopyzx\MFP@Rload y10{01000000}\MFP@Rmul
    \or
      \MFP@Rcopyzx\MFP@Rload y10{00010000}\MFP@Rmul
    \fi
  \else
    \MFP@warn{Square root of a negative number. Zero will be returned.}%
    \MFP@Rzero
  \fi}%
\def\MFP@fourofmany#1#2#3#4#5\MFP@end{#1#2#3#4}%
\def\MFP@gobblefour#1#2#3#4{}%
\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}%
\newcount\MFP@randseed % the random number (and starting seed)
\def\MFP@nextrand{\begingroup
  \ifnum\MFP@randseed<1
    \global\MFP@randseed\time
    \global\multiply\MFP@randseed388 \global\advance\MFP@randseed\year
    \global\multiply\MFP@randseed31 \global\advance\MFP@randseed\day
    \global\multiply\MFP@randseed97 \global\advance\MFP@randseed\month
    \MFP@nextrand \MFP@nextrand \MFP@nextrand
  \fi
  \MFP@tempa\MFP@randseed
  \divide\MFP@tempa \MFP@rand@q % modulus = m*q + r
  \MFP@tempb\MFP@tempa
  \multiply\MFP@tempa \MFP@rand@q
  \global\advance\MFP@randseed-\MFP@tempa % seed mod q
  \global\multiply\MFP@randseed \MFP@rand@m
  \multiply\MFP@tempb \MFP@rand@r
  \global\advance\MFP@randseed-\MFP@tempb
  \ifnum\MFP@randseed<\z@ \global\advance\MFP@randseed "7FFFFFFF\relax\fi
  \endgroup}%
\def\MFPrandgenA{\def\MFP@rand@m{16807 }\def\MFP@rand@q{127773 }%
  \def\MFP@rand@r{2836 }}%
\def\MFPrandgenB{\def\MFP@rand@m{48271 }\def\MFP@rand@q{44488 }%
  \def\MFP@rand@r{3399 }}%
\def\MFPrandgenC{\def\MFP@rand@m{69621 }\def\MFP@rand@q{30845 }%
  \def\MFP@rand@r{23902 }}%
\MFPrandgenA
\def\MFP@getrand{% leaves result in \MFP@tempa
  \MFP@nextrand
  \MFP@tempa\MFP@randseed
  \advance\MFP@tempa-1
  \divide\MFP@tempa 21 % (2^31-3)= 100000000*21 + r
  \ifnum \MFP@ttteight> \MFP@tempa
  \else \@xp\MFP@getrand\fi}%
\def\MFP@Rrand{%
  \MFP@getrand \edef\MFP@a@Tmp{\number\MFP@tempa}%
  \MFP@getrand \edef\MFP@b@Tmp{\number\MFP@tempa}%
  \MFP@DPmul0\MFP@a@Tmp\MFP@b@Tmp}%
\def\MFPsetseed#1{\global\MFP@randseed #1\relax}%
\MFP@xfinish
\endinput
%%
%% End of file `mfpextra.tex'.
