@egallesio since you suggested that we had sqrt call expt, I have been looking into it, and I think it would make sense to rewrite expt completely, and indeed make sqrt call it. I'm working on it, and I opened this issue to let you know.
So far the first version of expt would work like the following (things may be changed later for more precision or efficiency, but this would be a good start):
static SCM my_expt_new(SCM x, SCM y) {
/*
x y result
============================
---------------------------- y = 0:
0 1
---------------------------- x = 0, 1:
1 1
0 < 0 error
0 >=0 0
---------------------------- y = 1, 1.0:
1 x
1.0 inex(x)
---------------------------- x REAL:
] 0.0,+1.0[ +big +0.0
]-1.0, 0.0[ +big 0.0 * parity(y)
+real +big +inf.0
-real +big +inf.0 * parity(y)
real +fixnum expt_real_positivefixnum
real real pow(x,y)
+-0.0 +rational 0.0
+-0.0 -rational +inf.0
+real +rational pow(x,inexact(y)) or exp( log(x) * y )
-real +rational make-rect(0, real_part( exp( log(x) * y ) ) )
real complex exp( log(x) * y )
real < 0 1 / exp(x,-y)
---------------------------- x EXACT except 0, 1:
exact +big error
exact +fixnum expt_exact_positivefixnum
exact -fixnum 1 / exp(x,-y)
exact rational TODO
exact real make-rect(0, real_part( exp( log(x) * y ) ) )
exact complex exp( log(x) * y )
---------------------------- x COMPLEX:
complex exp( log(x) * y )
*/
@egallesio since you suggested that we had
sqrtcallexpt, I have been looking into it, and I think it would make sense to rewriteexptcompletely, and indeed makesqrtcall it. I'm working on it, and I opened this issue to let you know.So far the first version of
exptwould work like the following (things may be changed later for more precision or efficiency, but this would be a good start):