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
|
\subsection{simplify}
\label{labsimplify}
\noindent Name: \textbf{simplify}\\
\phantom{aaa}simplifies an expression representing a function\\[0.2cm]
\noindent Library name:\\
\verb| sollya_obj_t sollya_lib_simplify(sollya_obj_t)|\\[0.2cm]
\noindent Usage:
\begin{center}
\textbf{simplify}(\emph{function}) : \textsf{function} $\rightarrow$ \textsf{function}\\
\end{center}
Parameters:
\begin{itemize}
\item \emph{function} represents the expression to be simplified
\end{itemize}
\noindent Description: \begin{itemize}
\item The command \textbf{simplify} simplifies the expression given in argument
representing the function \emph{function}. The command \textbf{simplify} does not
endanger the safety of computations even in \sollya's floating-point
environment: the function returned is mathematically equal to the
function \emph{function}.
Remark that the simplification provided by \textbf{simplify} is not perfect:
they may exist simpler equivalent expressions for expressions returned
by \textbf{simplify}.
\end{itemize}
\noindent Example 1:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> print(simplify((6 + 2) + (5 + exp(0)) * x));
8 + 6 * x
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> print(simplify((log(x - x + 1) + asin(1))));
(pi) / 2
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 3:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> print(simplify((log(x - x + 1) + asin(1)) - (atan(1) * 2)));
(pi) / 2 - (pi) / 4 * 2
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{dirtysimplify} (\ref{labdirtysimplify}), \textbf{autosimplify} (\ref{labautosimplify}), \textbf{rationalmode} (\ref{labrationalmode}), \textbf{horner} (\ref{labhorner})
|