[Maxima] Simplifications of 3*sqrt(2)/sqrt(3)/sqrt(6)
drdieterkaiser at web.de
Thu Jul 2 17:05:54 CDT 2009
I had a look at the bug report ID: 1639678 "3*sqrt(2)/sqrt(3)/sqrt(6) !=
1". Because I have done some work on TMS and TIMESIN I have tried to
optimize the algorithm to simplify such expressions.
First my results.
This is the example of the bug report. It simplifies immediately:
Other examples are:
Furthermore the following example simplifies nicely:
With the CVS code we have the result sqrt(2)*4^(n/2).
This is a result for big numbers we have now;
(%o7) sqrt(31450696910808591132148340194) /
And this is the result we would get:
I have run the testsuite and the share_testsuite and got no problems.
Only some examples are better simplified.
To achieve these simplifications I have added the following code to TMS:
((and (mexptp factor)
(integerp (cadr factor))
(not (atom (setq tem ($factor (cadr factor))))))
(tms tem (mul (caddr factor) power) product))
The idea is to factor an integer which is the base of a mexpt-expression
and multiply the factored form into the list of products. I do not know
if this method is the fastest way to get the factors of an integer. But
the code is only called a few times within the testsuite and
share_testsuite and therefore the much better simplified results might
overweight the effort to get the factors.
One change of the behavior of Maxima is, that we always get more
factored results, e.g.
and no longer sqrt(6) or sqrt(10).
More information about the Maxima