## #1529 unsimplified result from rectform

closed
nobody
None
5
2012-12-04
2008-11-16
No

(%i1) logarc : true;
(%o1) true

(%i2) rectform(log(x + %i * y));
(%o2) log(y^2+x^2)/2+%i*atan2(y,x)

(%i3) expand(%,0,0);
(%o3) log(y^2+x^2)/2+(log((%i*y)/x+1)-log(1-(%i*y)/x))/2

Also (%o3) is wrong for x = 0 and in the left half plane.

## Discussion

• Dieter Kaiser - 2009-05-08
• milestone: --> Includes_proposed_fix

• Dieter Kaiser - 2009-05-08

The expression does not simplify as expected because the global flag \$logarc is set to nil in the routine risplit. It is possible to remove this from the routine risplit. Then we would get:

(%i11) rectform(log(x+%i*y)),logarc;
(%o11) log((%i*y+x)/sqrt(y^2+x^2))+log(y^2+x^2)/2

Because of revision 1.25 the result of the simplification is now correct.

I have checked this with the testsuite and the share_testsuite. There are no examples which depend on the setting of \$logargs in the routine risplit.

Should we change the routine risplit and remove the setting of the flag \$logarg?

Dieter Kaiser

• Dieter Kaiser - 2009-11-30

As discussed on the mailing list, rectform sets the option variable logarc to NIL to preserve the standard form x+%i*y for its result.

With Maxima 5.19post we get:

(%i4) rectform(log(x+%i*y));
(%o4) log(y^2+x^2)/2+%i*atan2(y,x)

logarc gives the following result, which no longer has the standard form of rectform:

(%i5) logarc(%);
(%o5) log((%i*y+x)/sqrt(y^2+x^2))+log(y^2+x^2)/2

I think we can close this bug report. The first issue has gone. The result of rectform is correct. The second issue is the expected behavior. rectform returns a standard form, which might simplify further, when the user sets the option variable logarc to TRUE.

Setting the status to pending and the resolution to "works for me".

Dieter Kaiser

• Dieter Kaiser - 2009-11-30
• status: open --> pending

• SourceForge Robot - 2009-12-14

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by

• SourceForge Robot - 2009-12-14
• status: pending --> closed