Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Re: Simplify and Abs


On 27 Feb 2005, at 07:29, Murray Eisenberg wrote:

> Strangely, though, the docs for version 5.1 say:
>
>    FunctionExpand is automatically called by FullSimplify


Yes, but it is a question of ComplexityFunstion in FullSimplify. 
FunctionExpand is one of the transformations used by FullSimplify, and 
FullSimplify does reach the  form -p+1 but but with the default 
ComplexityFucntion Abs[p-1] is preferred to -p+1.

One way to avoid such problems is to use the ComplexityFunction I 
suggested a while ago, which is based on what is visually the simplest 
form:


VisibleSimplify[expr_, opts___] := Simplify[
     expr, opts, ComplexityFunction ->
(StringLength[ToString[TraditionalForm[#]]] &)]


Now:


VisibleSimplify[Abs[p-1],p<1&&p>1/2]


1-p


VisibleSimplify should always return the "simplest form" from the point 
of view of traditional mathematical notation that Simplify is able to 
find (of course that also depends on TransforationFunctions) but 
VisibleSimplify is much slower than the default ComplexityFunction!



Andrzej Kozlowski



>
>
> 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: [mg54712] [mg54687] [mg54640] [mg54602] 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]
>
>
> -- 
> Murray Eisenberg                     murray at math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower      phone 413 549-1020 (H)
> University of Massachusetts                413 545-2859 (W)
> 710 North Pleasant Street            fax   413 545-1801
> Amherst, MA 01003-9305
>
>


  • Prev by Date: Re: Construcing correlation matrix from time-ordered list
  • Next by Date: Re: Construcing correlation matrix from time-ordered list
  • Previous by thread: Re: Re: Re: Simplify and Abs
  • Next by thread: Re: Simplify and Abs