[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Fix for bug 294
From: |
Waldek Hebisch |
Subject: |
[Axiom-developer] Fix for bug 294 |
Date: |
Sat, 7 Oct 2006 20:18:15 +0200 (CEST) |
Below is a fix for bug 294. Some extra comments:
1) the patch correct problem in goodCoef, there are other bugs in
integrator, I will work on them separately.
2) AFAICS goodCoef is an optimization, it should be safe to return
"failed" always (but since we take different path in the other
part we hit different bugs). I tried to preserve optimization
done by goodCoef whenever it is safe.
3) I would like to use higher level constructs, but I keept hitting
into problems with SPAD compiler, so finally I used a rather low
level way
4) without the patch the AXIOM recurses infinitely handling the
few integrals below (first I previosly gave in the bug report).
With the patch the first two are correctly handled, the other
two quickly hit into unimplemented part of Risch algorithm:
integrate(simplify(D((log((x)+1)+a)/(2*((((x*(exp(exp(x)/2)))-(a*(x+exp(-x/2))))*(2/x))-3)),
x)), x)
integrate(simplify(D((((((sqrt((sqrt((x)/(x)))/(a)))/(sqrt(x)))*((((x)-(1))*(1))-(1)))*(a))*(((log((x)*((a)/(log(sqrt((x)/(((x)*(x))*(x))))))))+(((x)/(sqrt(2)))*(exp(exp(x)))))+((x)-(exp(2)))))+((1)*(2)),
x)), x)
-- Function not supported by Risch d.e.
integrate(simplify(D(((((((a)/(sqrt((sqrt(x))-(x))))+(x))*(x))+(1))*((((((1)-(log(x)))+(1))*(exp(exp(2))))*(2))*(((1)*((log((a)*(1)))*(a)))*(exp(((exp(x))*(x))-(exp(x)))))))*(a),
x)), x)
-- intef: failed1 - cannot handle that integrand
integrate(simplify(D((((((((x)+(log(x)))*(((x)/(x))/(sqrt(x))))/((a)*(x)))-(sqrt(sqrt(((exp(x))/((x)-(sqrt(x))))-(log(x))))))-(x))-(((exp((sqrt(log(1)))*((x)*((x)/(log(x))))))/(exp((1)+((2)-((x)-(x))))))*(((((x)/(1))-(log(x)))*(1))+(((2)+(a))/(exp(sqrt(x)))))))/(2),
x)), x)
------------ The patch ---------------
--- pp/build-improvements/src/algebra/efstruc.spad.pamphlet 2006-09-08
02:57:48.000000000 +0200
+++ build-improvements.nn5/src/algebra/efstruc.spad.pamphlet 2006-10-07
19:51:18.000000000 +0200
@@ -347,8 +347,28 @@
true
goodCoef(v, l, s) ==
- for i in minIndex v .. maxIndex v for k in l repeat
- is?(k, s) and
+ -- if k1 is part of k2 we should not express k1 in terms of k2
+ -- (othewise we would get infinite recursion)
+ -- below we impose a stronger condition: we require
+ -- height(k1) to be maximal
+ h:NonNegativeInteger := 0
+ j:Integer := 0
+ ll : List K := [];
+ for k in l repeat
+ if (is?(k, "log"::SY) or is?(k, "exp"::SY)
+ or is?(k, "tan"::SY) or is?(k, "atan"::SY)) then
+ ll := [k, :ll]
+ h := h + 1
+ not (h = (maxIndex(v) - minIndex(v) + 1)) => "failed"
+ h := 0
+ ll := reverse(ll)
+ for i in minIndex v .. maxIndex v for k in ll repeat
+ h1 := height(k)
+ if (h1 > h) then
+ j := i
+ h := h1
+ for i in minIndex v .. maxIndex v for k in ll repeat
+ is?(k, s) and (i >= j) and
((r:=recip(qelt(v,i))) case Q) and
(retractIfCan(r::Q)@Union(Z, "failed") case Z)
and gdCoef?(qelt(v, i), v) => return([i, k])
--
Waldek Hebisch
address@hidden
- [Axiom-developer] Fix for bug 294,
Waldek Hebisch <=