Re: log expression not simplified
- To: mathgroup at smc.vnet.net
- Subject: [mg115837] Re: log expression not simplified
- From: Praeceptor <gianluca.cruciani at poste.it>
- Date: Sat, 22 Jan 2011 03:22:24 -0500 (EST)
- References: <ih3rec$bhe$1@smc.vnet.net>
Thanks to everybody contributing to this thread. In particular to
Andrzej who turned my attention to the use of complexity functions in
mathematica's simplifying tools.
On 18 Gen, 11:53, Andrzej Kozlowski <a... at mimuw.edu.pl> wrote:
> [...]
> However, it is hard to get it to simplify the expression to -1 because th=
e only way to do so seems to involve temporarily increasing the default com=
plexity. Thus, to get it to work we need a craftily designed custom complex=
ity function, like, for example, this one:
>
> f[expr_] := -2 Count[expr, _Log, {0, Infinity}] + LeafCount[expr]
>
> This function "rewards" Simplify for expanding logs and, in this case, th=
e "incentive" works:
>
> Simplify[Log[a/b]/Log[b/a], Assumptions -> {a > 0, b > a},
> ComplexityFunction -> f]
>
> -1
>
> [...]
>
> Andrzej Kozlowski