Posts: 90
Threads: 29
Joined: Aug 2016
(11/21/2017, 03:05 PM)Gottfried Wrote: (11/21/2017, 01:31 PM)Xorter Wrote: I got the following error message:
*** at toplevel: subst(exp(1/x),x,1/1000)
*** ^
*** exp: domain error in exp: valuation < 0
My question is that how can we solve this problem?
Perhaps it is meaningful for you to replace 1/x by exp(u) where u=log(x) ? At least this gives a power series (more precisiely a puisieuxseries)
I tried your advice but without success:
(15:42) gp > subst(f(x),x,1/1000)
*** at toplevel: subst(f(x),x,1/1000)
*** ^
*** in function f: exp(exp(u(x)))
*** ^
*** in function u: log(x)
*** ^
*** log: domain error in log: series valuation != 0
It looked like a simple problem, but I have not be able to solve it.
Any idea?
Xorter Unizo
Posts: 757
Threads: 116
Joined: Aug 2007
11/21/2017, 08:24 PM
(This post was last modified: 11/21/2017, 08:26 PM by Gottfried.)
(11/21/2017, 03:50 PM)Xorter Wrote: (11/21/2017, 03:05 PM)Gottfried Wrote: (11/21/2017, 01:31 PM)Xorter Wrote: I got the following error message:
*** at toplevel: subst(exp(1/x),x,1/1000)
*** ^
*** exp: domain error in exp: valuation < 0
My question is that how can we solve this problem?
Perhaps it is meaningful for you to replace 1/x by exp(u) where u=log(x) ? At least this gives a power series (more precisiely a puisieuxseries)
I tried your advice but without success:
(15:42) gp > subst(f(x),x,1/1000)
*** at toplevel: subst(f(x),x,1/1000)
*** ^
*** in function f: exp(exp(u(x)))
*** ^
*** in function u: log(x)
*** ^
*** log: domain error in log: series valuation != 0
It looked like a simple problem, but I have not be able to solve it.
Any idea?
This should go like
subst ( Pol(exp(exp(u)),u) , u, log(1/1000) )
or
subst ( Pol(exp(exp(u)),u) , u, log(1000) )
Because $exp(x)$ gives series and not a polynomial, to make the "subst" working, you need to convert the series into a polynomial ("Pol(exp(x))" or "Pol(exp(u),u)" first.
However, "substituting" in a polynomial is not a very good idea, especially if the value to be substituted makes the functional value large.
Converting the exp()function into a polynomial and then substituting such a large value does not give a near estimate for the true exp(1000) which is what I think your initial subst should give. (I hope I got your initial formula correct)
Gottfried Helms, Kassel
Posts: 90
Threads: 29
Joined: Aug 2016
Aha, yes! It works... Thank you very much!
Xorter Unizo
Posts: 90
Threads: 29
Joined: Aug 2016
05/08/2018, 08:56 PM
(This post was last modified: 05/08/2018, 09:13 PM by Xorter.
Edit Reason: edit2: new formula
)
Hi, again!
I would like to algoritmize the fractional derivatives and integrals, but here are some problems.
This is my code:
Code: int1(f,a,b,h)={return(sum(k=floor(min(a*h,b*h)),ceil(max(a*h,b*h)),sign(ba)*subst(f,x,k/h)/h));}
Stein(f,n,a,h)={return(der1(int1(f,0,a,h),a,h)/gamma(1n));}
So e. g. D^2.5 x^2.5 = gamma(2.51) = Stein(x^2.5,2.5,0,1000.0), but it returns with this error message:
domain error in gpow [irrational exponent]: valuation != 0
Furthermore my Stein function return with ~0 in other cases. Why?
EDIT:
Here is the original formula:
https://wikimedia.org/api/rest_v1/media/...cc722c1f49
Oops, it looks I forgot some things from the my algorithm. It will be checked soon.
EDIT2:
Here is the new algorithm which is not working, too:
Code: Stein(f,n,a,h)={return(der1(int1(subst(f,x,u)/(xu)^n,0,a,h),a,h)/gamma(1n));}
Xorter Unizo
Posts: 90
Threads: 29
Joined: Aug 2016
Hi, there!
Does anyone have any idea how to extend the binary bittest(x,n) to other number systems?
Thanks a lot!
Xorter
Xorter Unizo
