On Monday, February 26, 2018 at 9:08:47 AM UTC+1, Simon King wrote:
>
> Question: How can one get the exact value of arccos(1/2*sqrt(sqrt(2) + 2)) 
> (which is pi/8)? I tried .simplify_full() and so on, but to no avail. 
>

First, there is no such ready functionality. There are probably several 
ways to enable this for you as user, the simplest being a function that 
builds up a dict with (expr : expr) pairs that gets pre-filled with things 
like (1/2*sqrt(sqrt(2) + 2) : pi/8) which you just look up. This is 
possible because the simplification from cos(pi/8) to 1/2*sqrt(sqrt(2) + 2) 
is one of only a finite number of cases implemented.

A more mathematical solution would be to convert 1/2*sqrt(sqrt(2) + 2) to 
an algebraic number (QQbar) and look at the degree d of its minimal 
polynomial. I'm not an expert but pretty sure that d divides n in 
cos(m/n*pi). From experience n / d is probably not greater than 4, so maybe 
it suffices to check d, 2d, and 4d as candidates for n, and loop through 
all m coprime to n. This algorithm is slow however, so it's better to put 
it in as part of ex.simplify_full().

Improvements appreciated,

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to