1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
\subsection{autosimplify}
\label{labautosimplify}
\noindent Name: \textbf{autosimplify}\\
\phantom{aaa}activates, deactivates or inspects the value of the automatic simplification state variable\\[0.2cm]
\noindent Library names:\\
\verb| void sollya_lib_set_autosimplify_and_print(sollya_obj_t)|\\
\verb| void sollya_lib_set_autosimplify(sollya_obj_t)|\\
\verb| sollya_obj_t sollya_lib_get_autosimplify()|\\[0.2cm]
\noindent Usage:
\begin{center}
\textbf{autosimplify} = \emph{activation value} : \textsf{on$|$off} $\rightarrow$ \textsf{void}\\
\textbf{autosimplify} = \emph{activation value} ! : \textsf{on$|$off} $\rightarrow$ \textsf{void}\\
\textbf{autosimplify} : \textsf{on$|$off}\\
\end{center}
Parameters:
\begin{itemize}
\item \emph{activation value} represents \textbf{on} or \textbf{off}, i.e. activation or deactivation
\end{itemize}
\noindent Description: \begin{itemize}
\item An assignment \textbf{autosimplify} = \emph{activation value}, where \emph{activation value}
is one of \textbf{on} or \textbf{off}, activates respectively deactivates the
automatic safe simplification of expressions of functions generated by
the evaluation of commands or in argument of other commands.
\sollya commands like \textbf{remez}, \textbf{taylor} or \textbf{rationalapprox} sometimes
produce expressions that can be simplified. Constant subexpressions
can be evaluated to dyadic floating-point numbers, monomials with
coefficients $0$ can be eliminated. Further, expressions
indicated by the user perform better in many commands when simplified
before being passed in argument to a command. When the automatic
simplification of expressions is activated, \sollya automatically
performs a safe (not value changing) simplification process on such
expressions.
The automatic generation of subexpressions can be annoying, in
particular if it takes too much time for not enough benefit. Further the
user might want to inspect the structure of the expression tree
returned by a command. In this case, the automatic simplification
should be deactivated.
If the assignment \textbf{autosimplify} = \emph{activation value} is followed by an
exclamation mark, no message indicating the new state is
displayed. Otherwise the user is informed of the new state of the
global mode by an indication.
\end{itemize}
\noindent Example 1:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> autosimplify = on !;
> print(x - x);
0
> autosimplify = off ;
Automatic pure tree simplification has been deactivated.
> print(x - x);
x - x
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> autosimplify = on !;
> print(rationalapprox(sin(pi/5.9),7));
33 / 65
> autosimplify = off !;
> print(rationalapprox(sin(pi/5.9),7));
33 / 65
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{print} (\ref{labprint}), \textbf{$==$} (\ref{labequal}), \textbf{!$=$} (\ref{labneq}), \textbf{prec} (\ref{labprec}), \textbf{points} (\ref{labpoints}), \textbf{diam} (\ref{labdiam}), \textbf{display} (\ref{labdisplay}), \textbf{verbosity} (\ref{labverbosity}), \textbf{canonical} (\ref{labcanonical}), \textbf{taylorrecursions} (\ref{labtaylorrecursions}), \textbf{timing} (\ref{labtiming}), \textbf{fullparentheses} (\ref{labfullparentheses}), \textbf{midpointmode} (\ref{labmidpointmode}), \textbf{hopitalrecursions} (\ref{labhopitalrecursions}), \textbf{remez} (\ref{labremez}), \textbf{rationalapprox} (\ref{labrationalapprox}), \textbf{taylor} (\ref{labtaylor})
|