SageMath crashes when doing simple function arithmetics
Hello,
I'm trying to run the following code which computes a simple rational function.
d = 4
p = (d+2)/(d-2)
W(r) = (1+r^2/(d*(d-2)))^(-(d-2)/2)
print(p*W(r)^(p-1))
This code works fine in "sagecell dot sagemath dot org" (it takes only a few seconds). But if I run it on my SageMath terminal (which I've installed yesterday, so it's up-to-date), I get : ' /usr/share/sagemath/bin/sage-python : ligne 2 : 3988 Processus arrêté sage -python "$@" '
The code works fine in my SageMath terminal if I replace d by d = 3, d = 5, d = 6 or even d = 100. I've identified that the problem is due to p = (d+2)/(d-2). When d = 4, if I replace p = (d+2)/(d-2) by p = 3 or p = RR((d+2)/(d-2)), it works. But I don't understand why it does not work otherwise ?
EDIT :
This code was run on Ubuntu 20.04.3 (from Windows 10 using VirtualBox). SageMath 9.0 was installed using the command "sudo apt-get install sagemath". I didn't know this would not install the latest version. I'll try to update SageMath first and then we'll see.
Could you please give us some informations so that someone can try to reproduce your problem:
sagemath 9.2 is not up to date at all ! La version 9.4 est sortie récemment.
@tmonteil@FrédéricC I've updated my post. You're right, my SageMath is not up to date. I thought that the sudo apt-get install command would install the latest version. I'll try to update first and then I'll come back.