Fwd: [maxima:bugs] #5156 radcan() rewrites sqrt(1/z) as 1/sqrt(z), which has the opposite sign for negative z

Richard Fateman <[email protected]>
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CADB8Zm4hK=cxe_toq6YPFiVvueecKt5L_y3Kfu264J4KcePTew@mail.gmail.com>
---------- Forwarded message ---------
From: Richard Fateman <[email protected]>
Date: Fri, Aug 21, 2026, 6:58 AM
Subject: Re: [maxima:bugs] #5156 radcan() rewrites sqrt(1/z) as 1/sqrt(z),
which has the opposite sign for negative z
To: Stavros Macrakis <[email protected]>


Yes, radcan()  chooses a ' positive real interpretation'   (PRI) of
radicands. This ignores 'declarations' or 'domains', which did not exist
when radcan was written.

Maybe Claude should consult Gemini, which observes:


".... Key Caveats and Behaviors

   - Branch Choices: For multi-valued functions like square roots
   (\(\sqrt{u}\)) or inverse trig functions, radcan picks a single
   consistent branch/sign and sticks with it rather than tracking all Riemann
   surfaces or returning absolute value terms like \(\text{abs}(x)\). [1
   <https://ask.sagemath.org/question/8324/simplification-errors-in-simple-expressions/>,
   2 <https://sourceforge.net/p/maxima/bugs/2123/?limit=25>]
   - Ignores Assumptions: It generally treats variables inside radicals
   uniformly as they scale up or change bounds, which can occasionally lead to
   transformations that are only true for positive real domains. [1
   <https://groups.google.com/g/sage-devel/c/rDBcSR5YpSI>]
   - ...."
   -

The details are described in my thesis
https://people.eecs.berkeley.edu/~fateman/papers/tr-95.pdf
but is not reflected in the online Maxima manual.  That text includes gobs
of info on bits and twiddles that were added to
the general simplifier, but basically fails to describe edge cases of
radcan, which is not part of that.  Obviously radcan has to deal
with multiple values of radicals, and it does so in a particular way which
may not be the same as you have
in mind, as in this example.  I'm looking around for a blurb not stuck in
PDF, and maybe it is in the old Macsyma manual.
Or some paper.  The key is to identify a branch cut by this RPI heuristic.
The manual should include this, since it should
take only a sentence or two.

RJF


On Fri, Aug 21, 2026 at 5:18 AM Stavros Macrakis <[email protected]> wrote:

> I believe this is the way *radcan* is supposed to work. Fateman, can you
> look at it?
>
> ---------- Forwarded message ---------
> From: David Scherfgen <[email protected]>
> Date: Fri, Aug 21, 2026 at 3:56 AM
> Subject: [maxima:bugs] #5156 radcan() rewrites sqrt(1/z) as 1/sqrt(z),
> which has the opposite sign for negative z
> To: Ticket #5156: radcan() rewrites sqrt(1/z) as 1/sqrt(z), which has the
> opposite sign for negative z <[email protected]>
>
>
> ------------------------------
>
> *[bugs:#5156] <https://sourceforge.net/p/maxima/bugs/5156/> radcan()
> rewrites sqrt(1/z) as 1/sqrt(z), which has the opposite sign for negative z*
>
> *Status:* open
> *Group:*
> *Labels:* radcan simplification complex
> *Created:* Fri Aug 21, 2026 07:56 AM UTC by David Scherfgen
> *Last Updated:* Fri Aug 21, 2026 07:56 AM UTC
> *Owner:* nobody
>
> (%i1) display2d:false$(%i2) domain:complex$(%i3) radcan(sqrt(1/z));(%o3) 1/sqrt(z)(%i4) [subst(z = -4,sqrt(1/z)),subst(z = -4,1/sqrt(z))];(%o4) [%i/2,-(%i/2)]
>
> sqrt(1/z) and 1/sqrt(z) are different functions on the principal branch:
> they agree for positive z and differ by a sign wherever z is negative, as
> (%o4) shows at z = -4. radcan() is a simplifier and must preserve the
> value, so it should leave sqrt(1/z) alone for a symbol of unknown sign.
> The same rewrite applies to any exponent, e.g. radcan((1/z)^(1/3)) gives
> 1/z^(1/3).
>
> Detected by Claude.
> ------------------------------
>
> Sent from sourceforge.net because you indicated interest in
> https://sourceforge.net/p/maxima/bugs/5156/
>
> To unsubscribe from further messages, please visit
> https://sourceforge.net/auth/subscriptions/
>

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.