% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[a4paper,11pt]{report}

\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}

\definecolor{linkColor}{rgb}{0.0,0.0,0.554}
\definecolor{citeColor}{rgb}{0.0,0.0,0.554}
\definecolor{fileColor}{rgb}{0.0,0.0,0.554}
\definecolor{urlColor}{rgb}{0.0,0.0,0.554}
\definecolor{promptColor}{rgb}{0.0,0.0,0.589}
\definecolor{brkpromptColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapinputColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapoutputColor}{rgb}{0.0,0.0,0.0}

%%  for a long time these were red and blue by default,
%%  now black, but keep variables to overwrite
\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,0.0}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}


\usepackage{fancyvrb}

\usepackage{mathptmx,helvet}
\usepackage[T1]{fontenc}
\usepackage{textcomp}


\usepackage[
            pdftex=true,
            bookmarks=true,        
            a4paper=true,
            pdftitle={Written with GAPDoc},
            pdfcreator={LaTeX with hyperref package / GAPDoc},
            colorlinks=true,
            backref=page,
            breaklinks=true,
            linkcolor=linkColor,
            citecolor=citeColor,
            filecolor=fileColor,
            urlcolor=urlColor,
            pdfpagemode={UseNone}, 
           ]{hyperref}

\newcommand{\maintitlesize}{\fontsize{50}{55}\selectfont}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
%% were never documented, give conflicts with some additional packages

\newcommand{\GAP}{\textsf{GAP}}

%% nicer description environments, allows long labels
\usepackage{enumitem}
\setdescription{style=nextline}

%% depth of toc
\setcounter{tocdepth}{1}





%% command for ColorPrompt style examples
\newcommand{\gapprompt}[1]{\color{promptColor}{\bfseries #1}}
\newcommand{\gapbrkprompt}[1]{\color{brkpromptColor}{\bfseries #1}}
\newcommand{\gapinput}[1]{\color{gapinputColor}{#1}}


\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\mbox{}\vfill

\begin{center}{\maintitlesize \textbf{Floating-point numbers\mbox{}}}\\
\vfill

\hypersetup{pdftitle=Floating-point numbers}
\markright{\scriptsize \mbox{}\hfill Floating-point numbers \hfill\mbox{}}
{\Huge Version 0.6.2\mbox{}}\\[1cm]
{29/08/2014\mbox{}}\\[1cm]
\mbox{}\\[2cm]
{\Large \textbf{Laurent Bartholdi   \mbox{}}}\\
\hypersetup{pdfauthor=Laurent Bartholdi   }
\mbox{}\\[2cm]
\begin{minipage}{12cm}\noindent
 MPFR- and CXSC-based library for GAP \end{minipage}

\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{Laurent Bartholdi   }  Email: \href{mailto:// laurent.bartholdi@gmail.com} {\texttt{ laurent.bartholdi@gmail.com}}\\
  Homepage: \href{http://www.uni-math.gwdg.de/laurent/} {\texttt{http://www.uni-math.gwdg.de/laurent/}}}\\

\noindent \textbf{Address: }\begin{minipage}[t]{8cm}\noindent
 Mathematisches Institut\\
Bunsenstra{\ss}e 3-5\\
D-37073 G{\"o}ttingen\\
Germany \end{minipage}
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Abstract}
\logpage{[ 0, 0, 1 ]}
 This document describes the package \textsf{Float}, which implements in \textsf{GAP} arbitrary-precision floating-point numbers.  

 For comments or questions on \textsf{Float} please contact the author. \mbox{}}\\[1cm]
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 2 ]}
{\copyright} 2011-2014 by Laurent Bartholdi \mbox{}}\\[1cm]
{\small 
\section*{Acknowledgements}
\logpage{[ 0, 0, 3 ]}
Part of this work is supported by the "Swiss National Fund for Scientific
Research (SNF)", the "German National Science Foundation (DFG)", and the
Courant Research Centre "Higher Order Structures" of the University of
G{\"o}ttingen. \mbox{}}\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 4 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{Licensing}}\logpage{[ 1, 0, 0 ]}
\hyperdef{L}{X86DB23CC834ABD71}{}
{
 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 2 of the License, or 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, in the file COPYING. If not, see \href{http://www.gnu.org/licenses/} {\texttt{http://www.gnu.org/licenses/}}. }

 
\chapter{\textcolor{Chapter }{Float package}}\label{floatpackage}
\logpage{[ 2, 0, 0 ]}
\hyperdef{L}{X7E12358984CA3111}{}
{
 
\section{\textcolor{Chapter }{A sample run}}\label{sample}
\logpage{[ 2, 1, 0 ]}
\hyperdef{L}{X7B4092CA7ABB93B0}{}
{
 The extended floating-point capabilities of \textsf{GAP} are installed by loading the package via \texttt{LoadPackage("float");} and selecting new floating-point handlers via \texttt{SetFloats(MPFR)}, \texttt{SetFloats(MPFI)}, \texttt{SetFloats(MPC)} or\texttt{SetFloats(CXSC)}, depending on whether high-precision real, interval or complex arithmetic are
desired, or whether a fast package containing all four real/complex
element/interval arithmetic is desired: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@LoadPackage("float");|
  Loading FLOAT 0.3 ...
  true
  !gapprompt@gap>| !gapinput@SetFloats(MPFR); # floating-point|
  !gapprompt@gap>| !gapinput@x := 4*Atan(1.0);|
  .314159e1
  !gapprompt@gap>| !gapinput@Sin(x);|
  .169569e-30
  !gapprompt@gap>| !gapinput@SetFloats(MPFR,1000); # 1000 bits|
  !gapprompt@gap>| !gapinput@x := 4*Atan(1.0);|
  .314159e1
  !gapprompt@gap>| !gapinput@Sin(x);|
  .125154e-300
  !gapprompt@gap>| !gapinput@String(x,300);|
  ".3141592653589793238462643383279502884197169399375105820974944592307816406286\
  208998628034825342117067982148086513282306647093844609550582231725359408128481\
  117450284102701938521105559644622948954930381964428810975665933446128475648233\
  78678316527120190914564856692346034861045432664821339360726024914127e1"
  gap>
  !gapprompt@gap>| !gapinput@SetFloats(MPFI); # intervals|
  !gapprompt@gap>| !gapinput@x := 4*Atan(1.0);|
  .314159e1(99)
  !gapprompt@gap>| !gapinput@AbsoluteDiameter(x); Sup(x); Inf(x);|
  .100441e-29
  .314159e1
  .314159e1
  !gapprompt@gap>| !gapinput@Sin(x);|
  -.140815e-29(97)
  !gapprompt@gap>| !gapinput@0.0 in last;|
  true
  !gapprompt@gap>| !gapinput@1.0; # exact representation|
  .1e1(inf)
  !gapprompt@gap>| !gapinput@IncreaseInterval(last,0.001); # now only 8 significant bits|
  .1e1(8)
  !gapprompt@gap>| !gapinput@IncreaseInterval(last,-0.002); # now becomes empty|
  \emptyset
  !gapprompt@gap>| !gapinput@MinimalPolynomial(Rationals,Sqrt(2.0));|
  -2*x_1^2+1
  !gapprompt@gap>| !gapinput@Cyc(last);|
  E(8)-E(8)^3
  gap>
  !gapprompt@gap>| !gapinput@SetFloats(MPC); # complex numbers|
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Polynomials}}\label{poly}
\logpage{[ 3, 0, 0 ]}
\hyperdef{L}{X826D8334845549EC}{}
{
 
\section{\textcolor{Chapter }{The Floats pseudo-field}}\logpage{[ 3, 1, 0 ]}
\hyperdef{L}{X7BDA2E7C85ECC18C}{}
{
 Polynomials with floating-point coefficients may be manipulated in \textsf{GAP}; though they behave, in subtle ways, quite differently than polynomials over
rings. 

 The "pseudo-field" of floating-point numbers is an object in \textsf{GAP}, called \texttt{FLOAT{\textunderscore}PSEUDOFIELD}. (It is not really a field, e.g. because addition of floating-point numbers
in not associative). It may be used to create indeterminates, for example as 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@x := Indeterminate(FLOAT_PSEUDOFIELD,"x");|
  x
  !gapprompt@gap>| !gapinput@2*x^2+3;|
  2.0*x^2+3.0
  !gapprompt@gap>| !gapinput@Value(last,10);|
  203.0
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Roots of polynomials}}\logpage{[ 3, 2, 0 ]}
\hyperdef{L}{X788CDC24834012D7}{}
{
 The Jenkins-Traub algorithm has been implemented, in arbitrary precision for
MPFR and MPC. 

 Furthermore, CXSC can provide complex enclosures for the roots of a complex
polynomial. }

 
\section{\textcolor{Chapter }{Finding integer relations}}\logpage{[ 3, 3, 0 ]}
\hyperdef{L}{X7C9EF7E27EFA3288}{}
{
 The PSLQ algorithm has been implemented by Steve A. Linton, as an external
contribution to \textsf{Float}. This algorithm receives as input a vector of floats $x$ and a required precision $\epsilon$, and seeks an integer vector $v$ such that $|x\cdot v|<\epsilon$. The implementation follows quite closely the original article \cite{MR1836930}. 

\subsection{\textcolor{Chapter }{PSLQ}}
\logpage{[ 3, 3, 1 ]}\nobreak
\hyperdef{L}{X85DEB4B584870F67}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PSLQ({\mdseries\slshape x, epsilon[, gamma]})\index{PSLQ@\texttt{PSLQ}}
\label{PSLQ}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PSLQ{\textunderscore}MP({\mdseries\slshape x, epsilon[, gamma[, beta]]})\index{PSLQMP@\texttt{PSLQ{\textunderscore}MP}}
\label{PSLQMP}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
An integer vector $v$ with $|x\cdot v|<\epsilon$.



 The PSLQ algorithm by Bailey and Broadhurst (see \cite{MR1836930}) searches for an integer relation between the entries in $x$. 

$\beta$ and $\gamma$ are algorithm tuning parameters, and default to $4/10$ and $2/\sqrt(3)$ respectively. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@PSLQ([1.0,(1+Sqrt(5.0))/2],1.e-2);
|
  [ 55, -34 ] # Fibonacci numbers
  !gapprompt@gap>| !gapinput@RootsFloat([1,-4,2]*1.0);
|
  [ 0.292893, 1.70711 ] # roots of 2x^2-4x+1
  !gapprompt@gap>| !gapinput@PSLQ(List([0..2],i->last[1]^i),1.e-7);
|
  [ 1, -4, 2 ] # a degree-2 polynomial fitting well
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{LLL lattice reduction}}\logpage{[ 3, 4, 0 ]}
\hyperdef{L}{X83445BFB7901B88F}{}
{
 A faster implementation of the LLL lattice reduction algorithm has also been
implemented. It is accessible via the commands \texttt{FPLLLReducedBasis(m)} and \texttt{FPLLLShortestVector(m)}. 

 }

 }

 
\chapter{\textcolor{Chapter }{Implemented packages}}\label{impl}
\logpage{[ 4, 0, 0 ]}
\hyperdef{L}{X82DC33E982C4D157}{}
{
 
\section{\textcolor{Chapter }{MPFR}}\logpage{[ 4, 1, 0 ]}
\hyperdef{L}{X79E38C3781F79E35}{}
{
 

\subsection{\textcolor{Chapter }{IsMPFRFloat}}
\logpage{[ 4, 1, 1 ]}\nobreak
\hyperdef{L}{X82B38FFE86A5A0B5}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMPFRFloat\index{IsMPFRFloat@\texttt{IsMPFRFloat}}
\label{IsMPFRFloat}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}MPFR\index{TYPEMPFR@\texttt{TYPE{\textunderscore}MPFR}}
\label{TYPEMPFR}
}\hfill{\scriptsize (global variable)}}\\


 The category of floating-point numbers. 

 Note that they are treated as commutative and scalar, but are not necessarily
associative. }

 }

 
\section{\textcolor{Chapter }{MPFI}}\logpage{[ 4, 2, 0 ]}
\hyperdef{L}{X8145D0A97986133C}{}
{
 

\subsection{\textcolor{Chapter }{IsMPFIFloat}}
\logpage{[ 4, 2, 1 ]}\nobreak
\hyperdef{L}{X842290DB8034BF90}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMPFIFloat\index{IsMPFIFloat@\texttt{IsMPFIFloat}}
\label{IsMPFIFloat}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}MPFI\index{TYPEMPFI@\texttt{TYPE{\textunderscore}MPFI}}
\label{TYPEMPFI}
}\hfill{\scriptsize (global variable)}}\\


 The category of intervals of floating-point numbers. 

 Note that they are treated as commutative and scalar, but are not necessarily
associative. }

 }

 
\section{\textcolor{Chapter }{MPC}}\logpage{[ 4, 3, 0 ]}
\hyperdef{L}{X82C3C26F7C11A26F}{}
{
 

\subsection{\textcolor{Chapter }{IsMPCFloat}}
\logpage{[ 4, 3, 1 ]}\nobreak
\hyperdef{L}{X7D7AD4C67FF04E38}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMPCFloat\index{IsMPCFloat@\texttt{IsMPCFloat}}
\label{IsMPCFloat}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}MPC\index{TYPEMPC@\texttt{TYPE{\textunderscore}MPC}}
\label{TYPEMPC}
}\hfill{\scriptsize (global variable)}}\\


 The category of intervals of floating-point numbers. 

 Note that they are treated as commutative and scalar, but are not necessarily
associative. }

 }

 
\section{\textcolor{Chapter }{CXSC}}\logpage{[ 4, 4, 0 ]}
\hyperdef{L}{X82DF12317C250153}{}
{
 

\subsection{\textcolor{Chapter }{IsCXSCReal}}
\logpage{[ 4, 4, 1 ]}\nobreak
\hyperdef{L}{X794C3A0F7925BDA1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCXSCReal\index{IsCXSCReal@\texttt{IsCXSCReal}}
\label{IsCXSCReal}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCXSCComplex\index{IsCXSCComplex@\texttt{IsCXSCComplex}}
\label{IsCXSCComplex}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCXSCInterval\index{IsCXSCInterval@\texttt{IsCXSCInterval}}
\label{IsCXSCInterval}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCXSCBox\index{IsCXSCBox@\texttt{IsCXSCBox}}
\label{IsCXSCBox}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}CXSC{\textunderscore}RP\index{TYPECXSCRP@\texttt{TYP}\-\texttt{E{\textunderscore}}\-\texttt{C}\-\texttt{X}\-\texttt{S}\-\texttt{C{\textunderscore}RP}}
\label{TYPECXSCRP}
}\hfill{\scriptsize (global variable)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}CXSC{\textunderscore}CP\index{TYPECXSCCP@\texttt{TYP}\-\texttt{E{\textunderscore}}\-\texttt{C}\-\texttt{X}\-\texttt{S}\-\texttt{C{\textunderscore}CP}}
\label{TYPECXSCCP}
}\hfill{\scriptsize (global variable)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}CXSC{\textunderscore}RI\index{TYPECXSCRI@\texttt{TYP}\-\texttt{E{\textunderscore}}\-\texttt{C}\-\texttt{X}\-\texttt{S}\-\texttt{C{\textunderscore}RI}}
\label{TYPECXSCRI}
}\hfill{\scriptsize (global variable)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TYPE{\textunderscore}CXSC{\textunderscore}CI\index{TYPECXSCCI@\texttt{TYP}\-\texttt{E{\textunderscore}}\-\texttt{C}\-\texttt{X}\-\texttt{S}\-\texttt{C{\textunderscore}CI}}
\label{TYPECXSCCI}
}\hfill{\scriptsize (global variable)}}\\


 The category of floating-point numbers. 

 Note that they are treated as commutative and scalar, but are not necessarily
associative. }

 }

 
\section{\textcolor{Chapter }{FPLLL}}\logpage{[ 4, 5, 0 ]}
\hyperdef{L}{X7CD9EDF079B439BC}{}
{
 

\subsection{\textcolor{Chapter }{FPLLLReducedBasis}}
\logpage{[ 4, 5, 1 ]}\nobreak
\hyperdef{L}{X832DFC257C5C4D32}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FPLLLReducedBasis({\mdseries\slshape m})\index{FPLLLReducedBasis@\texttt{FPLLLReducedBasis}}
\label{FPLLLReducedBasis}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A matrix spanning the same lattice as \mbox{\texttt{\mdseries\slshape m}}.



 This function implements the LLL (Lenstra-Lenstra-Lov{\a'a}sz) lattice
reduction algorithm via the external library \textsf{fplll}. 

 The result is guaranteed to be optimal up to 1\%. }

 

\subsection{\textcolor{Chapter }{FPLLLShortestVector}}
\logpage{[ 4, 5, 2 ]}\nobreak
\hyperdef{L}{X7C759DED84B77805}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FPLLLShortestVector({\mdseries\slshape m})\index{FPLLLShortestVector@\texttt{FPLLLShortestVector}}
\label{FPLLLShortestVector}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A short vector in the lattice spanned by \mbox{\texttt{\mdseries\slshape m}}.



 This function implements the LLL (Lenstra-Lenstra-Lov{\a'a}sz) lattice
reduction algorithm via the external library \textsf{fplll}, and then computes a short vector in this lattice. 

 The result is guaranteed to be optimal up to 1\%. }

 }

 }

 \def\bibname{References\logpage{[ "Bib", 0, 0 ]}
\hyperdef{L}{X7A6F98FD85F02BFE}{}
}

\bibliographystyle{alpha}
\bibliography{floatbib.xml}

\addcontentsline{toc}{chapter}{References}

\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}
\hyperdef{L}{X83A0356F839C696F}{}
}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
