(kill(all),0);
0$

/*--- numbers ----*/

abs(-5);
5$

abs(0);
0$

abs(42);
42$

abs(-7/8);
7/8$

abs(27/5);
27/5$

abs(-2.4);
2.4$

abs(0.0);
0.0$

abs(6.022e23);
6.022e23;

abs(-6.022b23);
6.022b23$

abs(1066.0b3);
1066.0b3$

abs(inf);
inf$

abs(minf);
inf$

abs(infinity);
inf$

abs(und);
und$

abs(ind);
ind$

abs(%pi);
%pi$

abs(%phi);
%phi$

abs(%i);
1$

abs(1 + %i);
sqrt(2)$

abs(cos(1));
cos(1)$

abs((1 + %i) / (1-%i));
1$

abs((1 + %i) * (1-%i));
2$

/*--reflection simplification ----*/

abs(x) - abs(-x);
0$

abs(x*y) - abs(-x*y);
0$

abs(sin(x)) - abs(sin(-x));
0$

expand(abs(14 * a*(b - c)) - abs(-14 * a * (c - b)));
0$

ratsubst(c,b,abs(x*(a+b)) - abs(x*(a+c)));
0$

/*--database facts -----*/

(assume(equal(zip,0)),0);
0$

abs(zip * x);
0$

is(equal(abs(1 + zip),1));
true$

(forget(equal(zip,0)),0);
0$


/*--absolute value of products and quotients ---*/

abs((1+%i) * x);
sqrt(2) * abs(x)$

abs((1+%i) * %pi);
sqrt(2) * %pi$

abs((1+%i) / x);
sqrt(2) / abs(x)$

/*-- absolute value of lists and other mbags---*/

abs([a,b]), listarith : true;
[abs(a),abs(b)]$

abs([%i,-6]), listarith : true;
[1,6]$

abs(x = 1), listarith : true;
abs(x) = 1$

abs(-x = 1), listarith : true;
abs(x) = 1$


/*---- declared complex stuff ---*/

(declare(z, complex),0);
0$

abs(conjugate(z));
abs(z)$

abs(exp(z));
exp(realpart(z))$

subst(z = %i, abs(z^2));
1$

(remove(z,complex),0);
0$

/*--- abs and tellsimp ---- */

(tellsimp(abs(a), a+1), abs_rules : tellsimp(abs(b), b+1), 0);
0$

abs(a);
a+1$

abs(a * x);
(a+1) * abs(x)$

abs([a]), listarith : true;
[a+1]$

abs(a*b);
(a+1)*(b+1)$

abs(a^7);
(a+1)^7$

abs((a*b)^5);
(a+1)^5 * (b + 1)^5$

(remrule(abs, first(abs_rules)), remrule(abs, second(abs_rules)),0);
0$

(remvalue(abs_rules),0);
0$

/*--- abs flatten  ---*/

abs(abs(x));
abs(x)$

abs(abs(-x));
abs(x)$

abs(abs(abs(x)));
abs(x)$

abs(abs(abs(x))+1);
abs(abs(x) + 1)$

/*--- simplify noun form ---*/

'abs(1);
1$

'abs(1+x^2);
1 + x^2$

'abs(abs(x));
abs(x)$


/*-- subst into abs ---*/

ratsubst(x,x^2,abs(1+x^3));
1+x^2$

ratsubst(0,a,abs(%pi + a));
%pi$

/*-- CRE tests ---*/

abs(rat(x) + 1);
abs(x+1)$

abs(rat(1));
1$

/*-- misc -----*/

abs(signum(1/x));
1$

is(equal(op(abs(a.b)), abs));
true$

is(equal(op(abs(a^^7)), abs));
true$

abs(taylor(exp(x),x,0,3)) - taylor(exp(x),x,0,3);
''(taylor(0,x,0,3));

























 	  	 
