Menu

#4255 sqrtdenest cannot denest sqrt(sqrt(3)*%i-1))

None
not-a-bug
5
2024-01-24
2024-01-22
No

This is a feature request to self. I hope to work on it this year.

sqrtdenest does not simplify sqrt(sqrt(3)%i-1)) => (sqrt(3)%i)/sqrt(2)+1/sqrt(2).

Related to bug [#4252], which is an algsys failure due to the use of $rectform from SIMPLIFY-AFTER-SUBST. Function SIMPLIFY-AFTER-SUBST punts to $rectform. Denesting the simple expression above may be better.

My notes in algsys.lisp say

;; $ratsimp with algebraic:true can transform
;;     sqrt(2)*sqrt(-1/(sqrt(3)*%i+1)) => (sqrt(3)*%i)/2+1/2
;; but $rectform is required for
;;     sqrt(sqrt(3)*%i-1)) => (sqrt(3)*%i)/sqrt(2)+1/sqrt(2)
;; and $rootscontract is required for
;;     sqrt(34)-sqrt(2)*sqrt(17) => 0
[...]
;; Rectform does more than is wanted.  A function that denests and
;; rationalizes nested complex radicals would be better.

I haven't found too many references to denesting complex expressions . There is
https://brownmath.com/alge/nestrad.htm and I must consult the references in https://github.com/billingd/raddenest

Related

Bugs: #4252
Bugs: #4256

Discussion

  • David Billinghurst

    • labels: --> sqrtdenest, raddenest
     
  • David Billinghurst

    raddenest - in git HEAD of 2024-01-22 - gets this wrong. This would be unacceptable for algsys/solve.

    (%i1) load("raddenest")$
    (%i2) eq1:sqrt(sqrt(3)*%i-1)$
    (%i3) sqrtdenest(eq1);
    (%o3)                        sqrt(sqrt(3) %i - 1)
    (%i4) eq2:raddenest(eq1);
                                      1      sqrt(6)
    (%o4)                          ─────── - ───────
                                   sqrt(2)      2
    (%i5) rectform(float(eq1));
    (%o5)              1.224744871391589 %i + 0.7071067811865476
    (%i6) rectform(float(eq2));
    (%o6)                        - 0.5176380902050415
    

    Reported as bug [#4256] as fix is independent.

     

    Related

    Bugs: #4256

  • David Billinghurst

    rectform can do this if domain:complex. That will do for now.

    (%i1) display2d:false$
    (%i2) eq1:sqrt(sqrt(3)*%i-1)$
    (%i3) domain:complex$
    (%i4) rectform(eq1);
    (%o4) (sqrt(3)*%i)/sqrt(2)+1/sqrt(2)
    
     
  • David Billinghurst

    • status: open --> not-a-bug
     
  • Stavros Macrakis

    I wonder if rectform/polarform/... should bind domain to complex.

     

Log in to post a comment.