Re: Simplify and Abs
- To: mathgroup at smc.vnet.net
- Subject: [mg54728] Re: Simplify and Abs
- From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
- Date: Mon, 28 Feb 2005 03:27:18 -0500 (EST)
- References: <200502250618.BAA02358@smc.vnet.net> <cvrppa$p00$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Murray Eisenberg <murray at math.umass.edu> wrote: > Strangely, though, the docs for version 5.1 say: > > FunctionExpand is automatically called by FullSimplify Similarly, Refine is automatically called by Simplify. And, as I already pointed out, when specifically used, Refine also yields 1-p. Perhaps what seems strange is that neither Simplify nor FullSimplify yields 1-p in this problem. But that behavior is understandable when one realizes that LeafCount[1-p] is 5, its FullForm being Plus[1, Times[-1, p]], whereas LeafCount[Abs[p-1]] is only 4. Does anyone have a clever way to make Mathematica treat both p-1 and 1-p as though they had LeafCount = 3 when simplifying? By the way, this discussion brings to light another way to solve the problem: Just write "one" instead of "1"! In[3]:= Simplify[Abs[p - one], p < one && p > 1/2] Out[3]= one - p David Cantrell > Bob Hanlon wrote: > > FunctionExpand[Abs[p-1],p<1&&p>1/2] > > > > 1-p > > > >>From: Simon Anders <simon.anders at uibk.ac.at> To: mathgroup at smc.vnet.net > > > >>Date: 2005/02/24 Thu AM 03:21:06 EST > >>Subject: [mg54728] Simplify and Abs > >> > >>can it really be that this is already beyond Mathematica? > >> > >> In := FullSimplify[Abs[p - 1], p < 1 && p > 1/2] > >> > >> Out := Abs[-1 + p]
- References:
- Re: Simplify and Abs
- From: Bob Hanlon <hanlonr@cox.net>
- Re: Simplify and Abs