negative number cannot be raised to a fractional power in RDF

asked 2022-04-18 12:03:07 +0100

franpena gravatar image

updated 2022-04-18 12:25:48 +0100

Hi, can anyone tell me why this evaluation is correct:

var('y')
h(x,y) = sqrt(1-(cos(2*y)*sin(2*x)))
G(x,y) = sum([comp^2 for comp in diff(h)])
diff(G)(*vector(RR,(0.1,0.75)))

(0.788319732748083, -0.281637345440034)

But this evaluation, using RDF, is not correct:

diff(G)(*vector(RDF,(0.1,0.75)))

ValueError: negative number cannot be raised to a fractional power

I am aware that the error is related with the question https://ask.sagemath.org/question/7820/fractional-power-to-negative-number/, but I would expect the same behavior in both cases, with and without RDF.

edit retag flag offensive close merge delete