summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pgfplots/pgfmathlog.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgfplots/pgfmathlog.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pgfplots/pgfmathlog.sty215
1 files changed, 0 insertions, 215 deletions
diff --git a/Master/texmf-dist/tex/latex/pgfplots/pgfmathlog.sty b/Master/texmf-dist/tex/latex/pgfplots/pgfmathlog.sty
deleted file mode 100644
index 9e9b57ea137..00000000000
--- a/Master/texmf-dist/tex/latex/pgfplots/pgfmathlog.sty
+++ /dev/null
@@ -1,215 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Package pgfmathlog.sty.
-%
-% This file provides the public functions
-%
-% \pgfmathnormalisedfloatingpoint#1\to#2\powten#3
-% like
-% \pgfmathnormalisedfloatingpoint 412.02451e-5to\M\powten\E
-%
-% and
-% \pgfmathlog
-% \pgfmathlog@
-% which both assign \pgfmathresult to the natural number of a given
-% number (without units).
-%
-% It is based on Till Tantaus pgfmath package which comes as part of
-% the PGF bundle, but it provides its own number parsing routines to
-% circumvent TeXs limited real number representations.
-%
-% Copyright 2007/2008 by Christian Feuersänger.
-%
-% This program is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% This program is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with this program. If not, see <http://www.gnu.org/licenses/>.
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\ProvidesPackage{pgfmathlog}[2008/02/17 Version 0.9.4]
-\RequirePackage{pgf}[2007/01/01]
-\RequirePackage{sciformat}[2008/02/17]
-\RequirePackage{pgfplotshelpers}[2008/02/17]
-
-% See \sciparse docs
-\def\pgfmathnormalisedfloatingpoint#1\to#2\powten#3{%
- \sciparse#1\to#2\powten{#3}%
-}
-
-% Evaluates the natural logarithm, log(x) for 0.1<=x<=1.
-% @see \pgfmathlog@ for the general method.
-% NON ACCURATE ENOUGH!
-\def\pgfmathlogzeroone#1{%
- \begingroup%
- \message{EVAL log(#1) STARTS:}%
- \pgfmath@x=#1pt\relax
- \pgfmath@y=\pgfmath@x
- \advance\pgfmath@x by-1pt
- \advance\pgfmath@y by 1pt
- \pgfmathdivide{\pgfmath@x}{\pgfmath@y}%
- % pgfmath@ya = tmp := (#1 -1)/ (#1+1)
- \expandafter\pgfmath@ya\pgfmathresult pt
- % pgfmath@xa := [ (#1 -1)/ (#1+1) ]^2
- \pgfmathmultiply{\pgfmathresult}{\pgfmathresult}%
- \expandafter\pgfmath@xa\pgfmathresult pt
- % returnvalue:
- \pgfmath@y=0pt
- % loop counter:
- \c@pgfmath@counta=0
- % j:
- \c@pgfmath@countb=1
- \loop
- \ifnum\c@pgfmath@counta<6
- \let\multmp=\pgfmath@ya
- \divide\pgfmath@ya by\c@pgfmath@countb
- \advance\pgfmath@y by\pgfmath@ya
- \let\pgfmath@ya=\multmp
- \advance\c@pgfmath@countb by2
- \message{[tmp *= x*x tmp =\the\pgfmath@ya, x*x=\the\pgfmath@xa]}%
- \pgfmathmultiply{\pgfmath@ya}{\pgfmath@xa}%
- \expandafter\pgfmath@ya\pgfmathresult pt
- \advance\c@pgfmath@counta by1
- \message{[cur/2 = \the\pgfmath@y]}%
- \repeat
- \multiply\pgfmath@y by2
- \message{fertiges Resultat fuer log(#1): \the\pgfmath@y}%
- \pgfmath@returnone\pgfmath@y%
- \endgroup%
-}
-
-
-% Computes a good guess for log(X.XXXX) where the input number should
-% be between 0 < x < 10.
-%
-% If it is not in this range, the returned value will be bad.
-%
-% For use in the newton implementation of log(x). Please note that we
-% first compute a normalized floating point representation of x, and
-% the mantisse is always between 0 and 10.
-\def\pgfmathlog@smaller@ten@newton@startval#1#2#3\to#4{%
- \ifnum0<#1\relax
- \def\axis@TMP{#2}%
- \def\axis@TMPB{.}%
- \ifx\axis@TMP\axis@TMPB
- \ifcase#1
- \errmessage{pgfmathlog.sty: INTERNAL ERROR: should not happen!
- [\#1=0 should have been caught before!]}%
- \or#4=0.53062825106217pt
- \or#4=0.993pt
- \or#4=1.308pt
- \or#4=1.5pt
- \or#4=1.71pt
- \or#4=1.872pt
- \or#4=2.01pt
- \or#4=2.145pt
- \or#4=2.24pt
- \fi
-% \message{Newton: Start value \the#4 assigned}%
- \else
-% \message{Kein Komma an zweiter stelle (statt dessen: #2); Nehme standardstartwert.}%
- #4=0.1pt
- \fi
- \else
-% \message{Argument #1 <= 0. Nehme standardstartwert.}%
- #4=0.1pt
- \fi
-}
-
-% Computes log(x) into \pgfmathresult.
-%
-% REMARK
-% This method does NOT use TeX Registers to represent the numbers! The
-% computation is COMPLETELY STRING BASED.
-% This allows numbers such at 10000000 or 5.23e-10 to be represented
-% properly, although TeX-registers would produce overflow/underflow
-% errors in these cases.
-%
-% The natural logarithm is computed using log(X*10^Y) = log(X) + log(10)*Y
-\def\pgfmathlog@#1{%
- \pgfmathlog@newton{#1}%
-}
-
-% Public interface method. This is expected to use \pgfmathparse but
-% it DOESN'T do that. \pgfmathparse naturally can't handle numbers
-% which exceed TeX's numerical capabilities. However, exponentials are
-% typically either too large or too small for TeX.
-%
-% @see \pgfmathnormalisedfloatingpoint for how we parse arguments.
-% @see \pgfmathlog@
-\def\pgfmathlog#1{%
- \pgfmathlog@newton{#1}%
-}
-
-% This implementation of log(X) is done with a newton method applied to x-exp(y) = 0.
-% The implementation \pgfmathexp is used for exp(y).
-%
-% see \pgfmathlog@
-\def\pgfmathlog@newton#1{%
- \begingroup%
- % compute #1 = M*10^E with normalised mantisse M = [+-]*[1-9].XXXXX
- \sciparse#1\to\newtoninput@mantisse\powten\newtoninput@exponent
- %
- % Now, compute log(#1) = log(M) + E*log(10)
-% \message{EVAL log(#1) = log(\newtoninput@mantisse) + \newtoninput@exponent*log(10) mit newton STARTS:}%
- % input argument into \pgfmath@x
- \expandafter\pgfmath@x\newtoninput@mantisse pt
- \ifdim\pgfmath@x>0pt
- % return value:
- \expandafter\pgfmathlog@smaller@ten@newton@startval\newtoninput@mantisse\to\pgfmath@y
- % loop counter:
- \c@pgfmath@counta=0
- \loop
- %\message{Newton iter \#\the\c@pgfmath@counta: log(\newtoninput@mantisse) = \the\pgfmath@y }%
- \ifnum\c@pgfmath@counta<2
- % \pgfmathexp\pgfmath@y%
- \pgfmathlog@invoke@expanded\pgfmathexp@{{\pgf@sys@tonumber{\pgfmath@y}}}%
- \let\tmp=\pgfmathresult
- %\pgfmathdivide\pgfmath@x\tmp%
- \pgfmathlog@invoke@expanded\pgfmathdivide@{{\pgf@sys@tonumber{\pgfmath@x}}{\tmp}}%
- \expandafter\pgfmath@ya\pgfmathresult pt
- \advance\pgfmath@y by\pgfmath@ya
- \advance\pgfmath@y by-1pt
- \advance\c@pgfmath@counta by1
- \repeat
- \pgfmath@x=2.302585pt% = log(10)
- \multiply\expandafter\pgfmath@x\newtoninput@exponent
- \advance\pgfmath@y by\pgfmath@x
-%\message{Newton final result: log(\newtoninput@mantisse)+\newtoninput@exponent*log(10) = \the\pgfmath@y [ nur \newtoninput@exponent * log(10) = \the\pgfmath@x]}%
- \pgfmath@returnone\pgfmath@y%
- \else
- \global\let\pgfmathresult=\empty%
- \fi
- \endgroup%
-}
-
-% Usage:
-% \pgfmathapproxequalto@macro\argone\argtwo\result
-%
-% -> will set \resulttrue or \resultfalse
-% -> check with \ifresult
-\def\pgfmathlog@approxequalto@macro#1#2#3{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \expandafter\pgfmath@y#2pt\relax%
- \advance\pgfmath@x-\pgfmath@y%
- \ifdim\pgfmath@x<0pt
- \multiply\pgfmath@x by-1
- \fi
- \ifdim\pgfmath@x<0.0001pt\relax%
- \expandafter\aftergroup\csname #3true\endcsname
- \else%
- \expandafter\aftergroup\csname #3false\endcsname
- \fi%
- \endgroup%
-}
-