Comment #31 on issue 93 by mario.pe...@gmail.com: Square root denesting
http://code.google.com/p/sympy/issues/detail?id=93


In https://github.com/sympy/sympy/pull/1131 the example in the
inspiring document Denest_en.pdf by jnebos
`sqrt(8 - sqrt(2)*sqrt(5 - sqrt(5)) - sqrt(3)*(1 + sqrt(5)))`
is denested in two ways: it is solved by _denester (as one can check
disabling sqrt_biquadratic_denest) and by sqrt_biquadratic_denest;
while _denester can denest only small radicals of sqrt_depth `3`,
sqrt_biquadratic_denest can denest fairly large radicals
`sqrt(a + b*sqrt(r))`, with `a,b,r` of sqrt_depth `1`,
to which the above example belongs;
this algorithm works on pretty large expressions, e.g. the following
is done in 1.1s on my computer Intel i7 2.80GHz

```
from sympy import *
from sympy.simplify.sqrtdenest import sqrt_depth
a,b,r=[Add(*[sqrt(i)*(i+j) for i in range(1,j+3)]) for j in range(4,7)]
w = a + b*sqrt(r)
z = sqrt((w**2).expand())
res = sqrtdenest(z)
sqrt_depth(z), len(z.base.args)
(3, 29)
sqrt_depth(res), len(res.args)
(2, 11)
res - w.expand()
0
```


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to