%mathpiper,def="YacasFactor"

// This is so YacasFactor(Sin(x)) doesn't return FWatom(Sin(x))
//YacasFactor(_p) <-- FW(YacasFactors(p));
10 # YacasFactor(p_CanBeUni) <-- FW(YacasFactors(p));

%/mathpiper



%mathpiper_docs,name="YacasFactor",categories="User Functions;Number Theory"
*CMD Factor --- factorization (in pretty form)
*STD
*CALL
	YacasFactor(x)

*PARMS

{x} -- integer or univariate polynomial

*DESC

This is the original Yacas version of the Factor() function.  It has
b een superceeded in MathPiper by the function xFactor().

This function factorizes "x", similarly to {YacasFactors}, but
it shows the result in a more human-readable format.

*E.G.

In> PrettyForm(YacasFactor(24));
	
	 3
	2  * 3
	
Result: True;
In> PrettyForm(YacasFactor(2*x^3 + 3*x^2 - 1));
	
	             2   /     1 \
	2 * ( x + 1 )  * | x - - |
	                 \     2 /
	
Result: True;

*SEE YacasFactors, xFactor, IsPrime, PrettyForm
%/mathpiper_docs