Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision 6e991d61d3d430d19f91624ec57c3454edee668a)
+++ doc/user/user.tex	(revision b72bad4f321cdf95d1b8160445956596cf80e191)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Thu Apr 21 08:15:37 2016
-%% Update Count     : 131
+%% Last Modified On : Wed Apr 27 22:39:40 2016
+%% Update Count     : 160
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -226,5 +226,5 @@
 
 
-\section{Compiling \CFA Program}
+\section[Compiling CFA Program]{Compiling \CFA Program}
 
 The command \lstinline@cfa@ is used to compile \CFA program(s).
@@ -269,10 +269,10 @@
 \item
 \hspace*{-4pt}\lstinline$__CFA_PATCH__$
-\index{__CFA_PATCH__@%(__CFA_PATCH__%)}\index{preprocessor variables!__CFA_PATCH__@%(__CFA_PATCH__%)}
+\index{__CFA_PATCH__@\lstinline$__CFA_PATCH__$)}\index{preprocessor variables!__CFA_PATCH__@\lstinline$__CFA_PATCH__$}
 is always available during preprocessing and its value is the current patch \Index{version number} of \CFA.
 
 \item
 \hspace*{-4pt}\lstinline$__CFORALL__$
-\index{__CFORALL__@%(__CFORALL__%)}\index{preprocessor variables!__CFORALL__@%(__CFORALL__%)}
+\index{__CFORALL__@\lstinline$__CFORALL__$}\index{preprocessor variables!__CFORALL__@\lstinline$__CFORALL__$}
 is always available during preprocessing and it has no value.
 \end{description}
@@ -781,5 +781,5 @@
 \subsection{Type Nesting}
 
-\CFA allows \Index{type nesting}, and type qualification of the nested types, where as C hoists\index{type!hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
+\CFA allows \Index{type nesting}, and type qualification of the nested types, where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
 \begin{quote2}
 \begin{tabular}{@{}l@{\hspace{30pt}}l|l@{}}
@@ -3325,5 +3325,5 @@
 
 
-\subsection{Comparing Key Features of \CFA}
+\subsection[Comparing Key Features of CFA]{Comparing Key Features of \CFA}
 
 
@@ -3699,5 +3699,5 @@
 
 \begin{comment}
-\subsubsection{Modules/Packages}
+\subsubsection{Modules / Packages}
 
 \begin{lstlisting}
@@ -3941,5 +3941,5 @@
 
 
-\subsubsection{\CC}
+\subsubsection[C++]{\CC}
 
 \CC is a general-purpose programming language.
@@ -4160,5 +4160,5 @@
 A seperator does not appear at the start or end of a line.
 \begin{lstlisting}[belowskip=0pt]
-sout 1 | 2 | 3 | endl;
+sout | 1 | 2 | 3 | endl;
 \end{lstlisting}
 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
@@ -4179,5 +4179,5 @@
 which is a local mechanism to disable insertion of the separator character.
 \item
-A seperator does not appear before a C string starting with the \Index{extended ASCII}\index{ASCII} characters: \lstinline[mathescape=off]@([{$£¥¿«@
+A seperator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off]@([{$£¥¿«@
 %$
 \begin{lstlisting}[mathescape=off]
@@ -4190,5 +4190,5 @@
 %$
 \item
-A seperator does not appear after a C string ending with the extended ASCII characters: \lstinline@,.:;!?)]}%¢»@
+A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline@,.:;!?)]}%¢»@
 \begin{lstlisting}[belowskip=0pt]
 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x"
@@ -4199,10 +4199,10 @@
 \end{lstlisting}
 \item
-A seperator does not appear before or after a C string begining/ending with the characters: \lstinline@\f\n\r\t\v\`'"@
+A seperator does not appear before or after a C string begining/ending with the characters: \lstinline[showspaces=true]@\`'" \f\n\r\t\v@
 \begin{lstlisting}[belowskip=0pt]
-sout | "x '" | 1 | "' x \`" | 2 | "\` x \"" | 3 | "\" x" | endl;
+sout | "x\`" | 1 | "\`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | endl;
 \end{lstlisting}
 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-x '1' x \`2\` x "3" x
+x\`1\`x'2'x"3"x x 4 x
 \end{lstlisting}
 \begin{lstlisting}[showtabs=true,aboveskip=0pt]
@@ -4240,5 +4240,5 @@
 \end{lstlisting}
 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-1 2 3
+ 1 2 3
 \end{lstlisting}
 \begin{lstlisting}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
@@ -4251,73 +4251,33 @@
 \end{lstlisting}
 %$
-\VRef[Figure]{f:ExampleIO} shows an example of input and output I/O in \CFA.
-
-\begin{figure}
-\begin{lstlisting}[mathescape=off]
+\begin{comment}
 #include <fstream>
 
 int main() {
-	char c;														// basic types
-	short int si;
-	unsigned short int usi;
-	int i;
-	unsigned int ui;
-	long int li;
-	unsigned long int uli;
-	long long int lli;
-	unsigned long long int ulli;
-	float f;
-	double d;
-	long double ld;
-	float _Complex fc;
-	double _Complex dc;
-	long double _Complex ldc;
-	char s1[10], s2[10];
-
-	ifstream in;												// create / open file
-	open( &in, "input.data", "r" );
-
-	&in | &c													// character
-		| &si | &usi | &i | &ui | &li | &uli | &lli | &ulli		// integral
-		| &f | &d | &ld											// floating point
-		| &fc | &dc | &ldc										// floating-point complex
-		| cstr( s1 ) | cstr( s2, 10 );							// C string, length unchecked and checked
-
-	sout | c | ' ' | endl										// character
-		 | si | usi | i | ui | li | uli | lli | ulli | endl		// integral
-		 | f | d | ld | endl									// floating point
-		 | fc | dc | ldc | endl;								// complex
-	sout | endl;
-	sout | f | "" | d | "" | ld | endl							// floating point without separator
-		 | sepDisable | fc | dc | ldc | sepEnable | endl		// complex without separator
-		 | sepOn | s1 | sepOff | s2 | endl						// local separator removal
-		 | s1 | "" | s2 | endl;									// C string withou separator
-	sout | endl;
-	sepSet( sout, ", $" );										// change separator, maximum of 15 characters
-	sout | f | d | ld | endl									// floating point without separator
-		 | fc | dc | ldc | endl									// complex without separator
-		 | s1 | s2 | endl;
-}
-
-$ cat input.data 
-A 1 2 3 4 5 6 7 8 1.1 1.2 1.3 1.1+2.3 1.1-2.3 1.1-2.3 abc xyz
-$ a.out
-A 
-1 2 3 4 5 6 7 8
-1.1 1.2 1.3
-1.1+2.3i 1.1-2.3i 1.1-2.3i
-
-1.11.21.3
-1.1+2.3i1.1-2.3i1.1-2.3i
- abcxyz
-abcxyz
-
-1.1, $1.2, $1.3
-1.1+2.3i, $1.1-2.3i, $1.1-2.3i
-abc, $xyz
-\end{lstlisting}
-\caption{Example I/O}
-\label{f:ExampleIO}
-\end{figure}
+	int x = 3, y = 5, z = 7;
+	sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
+	sout | 1 | 2 | 3 | endl;
+	sout | '1' | '2' | '3' | endl;
+	sout | 1 | "" | 2 | "" | 3 | endl;
+	sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¿" | 7 | "x «" | 8 | endl;
+	sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x"
+		 | 10 | "% x" | 11 | L"¢ x" | 12 | L"» x" | endl;
+	sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | endl;
+	sout | "x\t" | 1 | "\tx" | endl;
+	sout | sepOn | 1 | 2 | 3 | sepOn | endl;	// separator at start of line
+	sout | 1 | sepOff | 2 | 3 | endl;			// turn off implicit separator temporarily
+	sout | sepDisable | 1 | 2 | 3 | endl;		// turn off implicit separation, affects all subsequent prints
+	sout | 1 | sepOn | 2 | 3 | endl;			// turn on implicit separator temporarily
+	sout | sepEnable | 1 | 2 | 3 | endl;		// turn on implicit separation, affects all subsequent prints
+	sepSet( sout, ", $" );						// change separator from " " to ", $"
+	sout | 1 | 2 | 3 | endl;
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
+\end{comment}
+%$
 
 
@@ -4335,5 +4295,5 @@
 forall( otype T ) T * malloc( T * ptr, size_t size );
 forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
-forall( otype T ) T * calloc( size_t size );
+forall( otype T ) T * calloc( size_t nmemb );
 forall( otype T ) T * realloc( T * ptr, size_t size );
 forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
@@ -4348,5 +4308,5 @@
 
 
-\subsection{ato/strto}
+\subsection{ato / strto}
 
 \begin{lstlisting}
@@ -4379,5 +4339,5 @@
 
 
-\subsection{bsearch/qsort}
+\subsection{bsearch / qsort}
 
 \begin{lstlisting}
@@ -4394,7 +4354,5 @@
 \begin{lstlisting}
 char abs( char );
-extern "C" {
-int abs( int );				// use default C routine for int
-} // extern "C"
+int abs( int );
 long int abs( long int );
 long long int abs( long long int );
@@ -4402,24 +4360,7 @@
 double abs( double );
 long double abs( long double );
-float _Complex abs( float _Complex );
-double _Complex abs( double _Complex );
-long double _Complex abs( long double _Complex );
-\end{lstlisting}
-
-
-\subsection{floor/ceil}
-
-\begin{lstlisting}
-float floor( float );
-extern "C" {
-double floor( double );		// use C routine for double
-} // extern "C"
-long double floor( long double );
-
-float ceil( float );
-extern "C" {
-double ceil( double );		// use C routine for double
-} // extern "C"
-long double ceil( long double );
+float abs( float _Complex );
+double abs( double _Complex );
+long double abs( long double _Complex );
 \end{lstlisting}
 
@@ -4442,5 +4383,5 @@
 
 
-\subsection{min/max/swap}
+\subsection{min / max / swap}
 
 \begin{lstlisting}
@@ -4453,4 +4394,367 @@
 forall( otype T )
 void swap( T * t1, T * t2 );
+\end{lstlisting}
+
+
+\section{Math Library}
+\label{s:Math Library}
+
+The goal of the \CFA math-library is to wrap many of the existing C math library-routines that are explicitly polymorphic into implicitly polymorphic versions.
+
+
+\subsection{General}
+
+\begin{lstlisting}
+float fabs( float );
+double fabs( double );
+long double fabs( long double );
+float cabs( float _Complex );
+double cabs( double _Complex );
+long double cabs( long double _Complex );
+
+float ?%?( float, float );
+float fmod( float, float );
+double ?%?( double, double );
+double fmod( double, double );
+long double ?%?( long double, long double );
+long double fmod( long double, long double );
+
+float remainder( float, float );
+double remainder( double, double );
+long double remainder( long double, long double );
+
+[ int, float ] remquo( float, float );
+float remquo( float, float, int * );
+[ int, double ] remquo( double, double );
+double remquo( double, double, int * );
+[ int, long double ] remquo( long double, long double );
+long double remquo( long double, long double, int * );
+
+[ int, float ] div( float, float );						// alternative name for remquo
+float div( float, float, int * );
+[ int, double ] div( double, double );
+double div( double, double, int * );
+[ int, long double ] div( long double, long double );
+long double div( long double, long double, int * );
+
+float fma( float, float, float );
+double fma( double, double, double );
+long double fma( long double, long double, long double );
+
+float fdim( float, float );
+double fdim( double, double );
+long double fdim( long double, long double );
+
+float nan( const char * );
+double nan( const char * );
+long double nan( const char * );
+\end{lstlisting}
+
+
+\subsection{Exponential}
+
+\begin{lstlisting}
+float exp( float );
+double exp( double );
+long double exp( long double );
+float _Complex exp( float _Complex );
+double _Complex exp( double _Complex );
+long double _Complex exp( long double _Complex );
+
+float exp2( float );
+double exp2( double );
+long double exp2( long double );
+// float _Complex exp2( float _Complex );
+// double _Complex exp2( double _Complex );
+// long double _Complex exp2( long double _Complex );
+
+float expm1( float );
+double expm1( double );
+long double expm1( long double );
+
+float log( float );
+double log( double );
+long double log( long double );
+float _Complex log( float _Complex );
+double _Complex log( double _Complex );
+long double _Complex log( long double _Complex );
+
+float log2( float );
+double log2( double );
+long double log2( long double );
+// float _Complex log2( float _Complex );
+// double _Complex log2( double _Complex );
+// long double _Complex log2( long double _Complex );
+
+float log10( float );
+double log10( double );
+long double log10( long double );
+// float _Complex log10( float _Complex );
+// double _Complex log10( double _Complex );
+// long double _Complex log10( long double _Complex );
+
+float log1p( float );
+double log1p( double );
+long double log1p( long double );
+
+int ilogb( float );
+int ilogb( double );
+int ilogb( long double );
+
+float logb( float );
+double logb( double );
+long double logb( long double );
+\end{lstlisting}
+
+
+\subsection{Power}
+
+\begin{lstlisting}
+float sqrt( float );
+double sqrt( double );
+long double sqrt( long double );
+float _Complex sqrt( float _Complex );
+double _Complex sqrt( double _Complex );
+long double _Complex sqrt( long double _Complex );
+
+float cbrt( float );
+double cbrt( double );
+long double cbrt( long double );
+
+float hypot( float, float );
+double hypot( double, double );
+long double hypot( long double, long double );
+
+float pow( float, float );
+double pow( double, double );
+long double pow( long double, long double );
+float _Complex pow( float _Complex, float _Complex );
+double _Complex pow( double _Complex, double _Complex );
+long double _Complex pow( long double _Complex, long double _Complex );
+\end{lstlisting}
+
+
+\subsection{Trigonometric}
+
+\begin{lstlisting}
+float sin( float );
+double sin( double );
+long double sin( long double );
+float _Complex sin( float _Complex );
+double _Complex sin( double _Complex );
+long double _Complex sin( long double _Complex );
+
+float cos( float );
+double cos( double );
+long double cos( long double );
+float _Complex cos( float _Complex );
+double _Complex cos( double _Complex );
+long double _Complex cos( long double _Complex );
+
+float tan( float );
+double tan( double );
+long double tan( long double );
+float _Complex tan( float _Complex );
+double _Complex tan( double _Complex );
+long double _Complex tan( long double _Complex );
+
+float asin( float );
+double asin( double );
+long double asin( long double );
+float _Complex asin( float _Complex );
+double _Complex asin( double _Complex );
+long double _Complex asin( long double _Complex );
+
+float acos( float );
+double acos( double );
+long double acos( long double );
+float _Complex acos( float _Complex );
+double _Complex acos( double _Complex );
+long double _Complex acos( long double _Complex );
+
+float atan( float );
+double atan( double );
+long double atan( long double );
+float _Complex atan( float _Complex );
+double _Complex atan( double _Complex );
+long double _Complex atan( long double _Complex );
+
+float atan2( float, float );
+double atan2( double, double );
+long double atan2( long double, long double );
+
+float atan( float, float );								// alternative name for atan2
+double atan( double, double );
+long double atan( long double, long double );
+\end{lstlisting}
+
+
+\subsection{Hyperbolic}
+
+\begin{lstlisting}
+float sinh( float );
+double sinh( double );
+long double sinh( long double );
+float _Complex sinh( float _Complex );
+double _Complex sinh( double _Complex );
+long double _Complex sinh( long double _Complex );
+
+float cosh( float );
+double cosh( double );
+long double cosh( long double );
+float _Complex cosh( float _Complex );
+double _Complex cosh( double _Complex );
+long double _Complex cosh( long double _Complex );
+
+float tanh( float );
+double tanh( double );
+long double tanh( long double );
+float _Complex tanh( float _Complex );
+double _Complex tanh( double _Complex );
+long double _Complex tanh( long double _Complex );
+
+float asinh( float );
+double asinh( double );
+long double asinh( long double );
+float _Complex asinh( float _Complex );
+double _Complex asinh( double _Complex );
+long double _Complex asinh( long double _Complex );
+
+float acosh( float );
+double acosh( double );
+long double acosh( long double );
+float _Complex acosh( float _Complex );
+double _Complex acosh( double _Complex );
+long double _Complex acosh( long double _Complex );
+
+float atanh( float );
+double atanh( double );
+long double atanh( long double );
+float _Complex atanh( float _Complex );
+double _Complex atanh( double _Complex );
+long double _Complex atanh( long double _Complex );
+\end{lstlisting}
+
+
+\subsection{Error / Gamma}
+
+\begin{lstlisting}
+float erf( float );
+double erf( double );
+long double erf( long double );
+// float _Complex erf( float _Complex );
+// double _Complex erf( double _Complex );
+// long double _Complex erf( long double _Complex );
+
+float erfc( float );
+double erfc( double );
+long double erfc( long double );
+// float _Complex erfc( float _Complex );
+// double _Complex erfc( double _Complex );
+// long double _Complex erfc( long double _Complex );
+
+float lgamma( float );
+double lgamma( double );
+long double lgamma( long double );
+float lgamma( float, int * );
+double lgamma( double, int * );
+long double lgamma( long double, int * );
+
+float tgamma( float );
+double tgamma( double );
+long double tgamma( long double );
+\end{lstlisting}
+
+
+\subsection{Nearest Integer}
+
+\begin{lstlisting}[escapechar=^]
+float floor( float );^\index{floor@\lstinline$floor$}^
+double floor( double );
+long double floor( long double );
+
+float ceil( float );^\index{ceil@\lstinline$ceil$}^
+double ceil( double );
+long double ceil( long double );
+
+float trunc( float );^\index{trunc@\lstinline$trunc$}^
+double trunc( double );
+long double trunc( long double );
+
+float rint( float );^\index{rint@\lstinline$rint$}^
+long double rint( long double );
+long int rint( float );
+long int rint( double );
+long int rint( long double );
+long long int rint( float );
+long long int rint( double );
+long long int rint( long double );
+
+long int lrint( float );^\index{lrint@\lstinline$lrint$}^
+long int lrint( double );
+long int lrint( long double );
+long long int llrint( float );
+long long int llrint( double );
+long long int llrint( long double );
+
+float nearbyint( float );^\index{nearbyint@\lstinline$nearbyint$}^
+double nearbyint( double );
+long double nearbyint( long double );
+
+float round( float );^\index{round@\lstinline$round$}^
+long double round( long double );
+long int round( float );
+long int round( double );
+long int round( long double );
+long long int round( float );
+long long int round( double );
+long long int round( long double );
+
+long int lround( float );^\index{lround@\lstinline$lround$}^
+long int lround( double );
+long int lround( long double );
+long long int llround( float );
+long long int llround( double );
+long long int llround( long double );
+\end{lstlisting}
+
+
+\subsection{Manipulation}
+
+\begin{lstlisting}[escapechar=^]
+float copysign( float, float );^\index{copysign@\lstinline$copysign$}^
+double copysign( double, double );
+long double copysign( long double, long double );
+
+float frexp( float, int * );^\index{frexp@\lstinline$frexp$}^
+double frexp( double, int * );
+long double frexp( long double, int * );
+
+float ldexp( float, int );^\index{ldexp@\lstinline$ldexp$}^
+double ldexp( double, int );
+long double ldexp( long double, int );
+
+[ float, float ] modf( float );^\index{modf@\lstinline$modf$}^
+float modf( float, float * );
+[ double, double ] modf( double );
+double modf( double, double * );
+[ long double, long double ] modf( long double );
+long double modf( long double, long double * );
+
+float nextafter( float, float );^\index{nextafter@\lstinline$nextafter$}^
+double nextafter( double, double );
+long double nextafter( long double, long double );
+
+float nexttoward( float, long double );^\index{nexttoward@\lstinline$nexttoward$}^
+double nexttoward( double, long double );
+long double nexttoward( long double, long double );
+
+float scalbn( float, int );^\index{scalbn@\lstinline$scalbn$}^
+double scalbn( double, int );
+long double scalbn( long double, int );
+
+float scalbln( float, long int );^\index{scalbln@\lstinline$scalbln$}^
+double scalbln( double, long int );
+long double scalbln( long double, long int );
 \end{lstlisting}
 
