Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1994
*January
*February
*March
*April
*May
*June
*July
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1994

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

Search the Archive

Neat inverting of log rule

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Neat inverting of log rule
  • From: rvs at amnesix.kfunigraz.ac.at (Reinhard V.Simonovits)
  • Date: Mon, 14 Mar 1994 19:36:43 +0100

 Dear MathGroupers!
I am looking for  a neat implementation of "inverse log rules";
I tried

Off[General::spell1]
log[a_ b_] = log[a] + log[b]; log[a_^n_] = n log[a];

expr = log[a b^2 c^3]
log[a] + 2 log[b] + 3 log[c]  

ok, it works. The goal is to invert the rules, to get log[a b^2 c^3].

Apply[ f, expr, 2]
f[a]  + f[ 2, f[b]] + f[3, f[c]]

exprtemp = Apply[f, expr, 2] //. { f[a_] + f[b_] -> f[a b],
                                   f[n_, f[a_] -> f[b^n] }
f[a b^2 c^3]

Apply[ HoldForm[log], exprtemp ]
log[a b^2 c^3]

Ok.   

I think, my changing of the label  is anyway "unfair".
Can anyone give me an advice how to obtain the same result
using only the log label? 
This means to make log forget about its two first learned
rules when inverting the expr.

Reinhard Simonovits,
Univ. Graz, Austria





  • Prev by Date: Re: Anyone knows where to find BinHex v4.0???
  • Next by Date: Integral of unbounded function.
  • Previous by thread: ScientificWord & Eps for Mma
  • Next by thread: Integral of unbounded function.