Ask Your Question
1

complicated algebra test: infinite loop

asked 2024-10-23 07:31:21 +0100

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')
edit retag flag offensive close merge delete

Comments

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

ortollj gravatar imageortollj ( 2024-10-23 11:36:39 +0100 )edit

Is t.is_zero() any better?

Max Alekseyev gravatar imageMax Alekseyev ( 2024-10-23 14:57:37 +0100 )edit

@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 ( 2024-10-23 18:49:32 +0100 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2024-10-23 20:37:06 +0100

Emmanuel Charpentier gravatar image

updated 2024-10-23 20:46:54 +0100

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,

edit flag offensive delete link more

Comments

ortollj gravatar imageortollj ( 2024-10-24 08:12:49 +0100 )edit

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: 2024-10-23 07:31:21 +0100

Seen: 103 times

Last updated: Oct 23