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
raddenest - in git HEAD of 2024-01-22 - gets this wrong. This would be unacceptable for algsys/solve.
Reported as bug [#4256] as fix is independent.
Related
Bugs: #4256
rectform can do this if domain:complex. That will do for now.
I wonder if rectform/polarform/... should bind domain to complex.