First time here? Check out the FAQ!

Ask Your Question
1

complicated algebra test: infinite loop

asked 0 years ago

ortollj gravatar image

Hi W11,WSL,UBUNTU 22.04 ,SAGEMATH 10.2

test if zero of complicated algebra value gives infinite loop (if second t value uncommented)

t=-1/6*(1/4)^(1/3)*(3*sqrt(35)*sqrt(3) + 31)^(1/3)*(I*sqrt(3) + 1) - 2/3*(1/4)^(2/3)*(-I*sqrt(3) + 1)/(3*sqrt(35)*sqrt(3) + 31)^(1/3) + 1/3

#t= -1/12*sqrt((36*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(2/3) + 21*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) + 91)/(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3)) - 1/2*sqrt(-(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) - 91/36/(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) - 27/2/sqrt((36*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(2/3) + 21*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) + 91)/(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3)) + 7/6) - 1/4

show(t)
if t == 0 :
    print('zero')
Preview: (hide)

Comments

Is this reproducible for someone else or is it a problem with me?

ortollj gravatar imageortollj ( 0 years ago )

Is t.is_zero() any better?

Max Alekseyev gravatar imageMax Alekseyev ( 0 years ago )

@Max Alekseyev no it does not work too, because for you it is ok ? if yes, then, this problem is only due to my configuration ? what SageMath version are you using ?

ortollj gravatar imageortollj ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 0 years ago

Emmanuel Charpentier gravatar image

updated 0 years ago

FWIW :

sage: %time t.canonicalize_radical().is_zero()
CPU times: user 4.44 s, sys: 45.4 ms, total: 4.49 s
Wall time: 3.14 s
False
sage: %time t.n()
CPU times: user 20.6 ms, sys: 29 µs, total: 20.7 ms
Wall time: 20.6 ms
-1.20465101438222 - 0.876623543196119*I

EDIT : Also :

sage: %time QQbar(t.canonicalize_radical())
CPU times: user 4.42 s, sys: 15.9 ms, total: 4.43 s
Wall time: 3.07 s
-1.204651014382222? + 0.8766235431961193?*I

whereas %time QQbar(t) "never" returns (> 1 min).

HTH,

Preview: (hide)
link

Comments

ortollj gravatar imageortollj ( 0 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 0 years ago

Seen: 129 times

Last updated: Oct 23 '24