Comment #2 on issue 980 by nicolas.pourcelot: log(8)/log(2) should
automatically simplify to 3
http://code.google.com/p/sympy/issues/detail?id=980
Similarly, ln(9)-2*ln(3), or ln(10)-ln(2)-ln(5) should return 0.
Maybe some log expansion would provide useful for simplification ; after
that log may
be gathered again.
Eg., for expansion, something like that :
def expand_log(expr):
if isinstance(expr, sympy.log) and expr.args[0].is_rational:
num, den = expr.args[0].as_numer_denom()
result = 0
for n, p in sympy.factorint(num):
result += p*sympy.log(n)
for n, p in sympy.factorint(den):
result -= p*sympy.log(n)
return result
elif expr.args:
return expr.func(*(expand_log(arg) for arg in expr.args))
else:
return expr
Collecting logs is a bit more difficult.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---