[CLN-list] exponants of floating points (or do I need it ?)

Franck Sabatié fsabatie at gmail.com
Fri Jan 14 09:40:23 CET 2011


Hello,

I have a hard time seeing how to best implement the following : I have a
complicated equation of 4 variables that I need evaluated with a certain
number of digits in precision (30 or so) :

dummy = (15/4)*(1/(pow(xi,5)*(1+i-k)*(2+i-k)*(3+i-k)*(4+i-k)*(5+i-k)))*(
( (3*pow(3+i-k,2)-(1+i-k)*(5+i-k))*pow(xi*xi-xb,2)
-2*(2+i-k)*(4+i-k)*(1-xi*xi)*(xb*xb-xi*xi) ) * ( pow((xb+xi)/(1+xi),3+i-k)-
pow((xb-xi)/(1-xi),3+i-k) ) +
6*(3+i-k)*xi*(1-xb)*(xi*xi-xb)*(pow((xb+xi)/(1+xi),3+i-k)+
pow((xb-xi)/(1-xi),3+i-k)) );


where the variables are i, k, xb and xi. Although most of the equation is
relatively easy to implement in CLN, I have a hard time figuring out how to
deal with the "pow". There appears to be no such exponant function for
floats ? Also, it is still unclear to me how to enter this equation
painlessly into my code. Do I have to put cl_float(1,30) when I use 1 for
instance ? (same for other numbers). Should I evaluate this in floating
precision or with "real numbers" ? And finally how do I evaluate expressions
such as (something)^(something else) with the (something else) NOT being an
integer.

Sorry about the very basic questions but most of the demo examples deal with
integers and the few that do not, have very little information in them.

Thank you for your time,
Franck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cebix.net/pipermail/cln-list/attachments/20110114/05a7ce0b/attachment.html>


More information about the CLN-list mailing list