#ff0000 08  2008 . - #000655     j2me (exp, ln, log, arcsin, arccos, arctn, power, root)
#def  CDLC 1.1     ,   double.    Math        : sin, cos, tan, sqrt.      (, Real.java,      http://sourceforge.net/projects/real-java).            .

          .          .  ,          ,        .             ,      ,    .
 

    ,        .
 ,    x,         .  x>706 exp(x)      double,        x    .      ,        :
,  x<706     :

  a    0  1,  b<1.
       .    x (b)   .         .  ai ,     x   .          a0,     a0,   .    ,   :

private double MExp(double x0){ 
    double x=x0;
    if (x0<0){x=-x0;} 
   //   . 
   double ExpConst[]={
        2.718281828459045, //e^1
        7.389056098930649, //e^2
        54.59815003314422, //e^4
        2980.957987041726, //e^8
        8886110.520507860, //e^16
        78962960182680.61, //e^32
        6.235149080811582e27, //e^64
        3.887708405994552e55, //e^128
        1.511427665004070e111, //e^256
        2.284413586539655e222 //e^512 
    };
   int x1=(int)x; //   
   //     
   int long n=1;
   double b=1;
   double sn=1; 
   while (sn>1E-16){
        sn=sn*(x-x1)/n;
        b=b+sn;
        n=n++;
   }
   //     .
   StringBuffer s1=new StringBuffer(10);
   s1.append(Integer.toBinaryString(x1)); 
   int len=s1.length();
   for (int i=s1.length(); i>0;i--)
   {
       if (s1.charAt(i-1)=='1'){b=b*ExpConst[len-i];}
   }
    if (x0<0){b=1/b;}
    return b;
}
 

    ,     .

, , .

     exp(x)   ,       .
  

      :
         .        
  x  
 b<1, a-, 
     x   ,     E     x,  a  ,    E  1, a b     E,   10.

  ,     :

private double MLn(double x0){
    double x=x0;
    double y=0;
        //  .
        String s0=""+x;
        int i=s0.indexOf("E");
        String s1=s0.substring(i+1, s0.length());// E 
        String s2=s0.substring(0, i);// E
        double a=0,b=0; 
        a=Double.parseDouble(s1)+1;
        b=Double.parseDouble(s2)/10; 
  //  b    
       int n=1;
       double sn=1;
       while (sn>(1E-16)*n){
          sn=-sn*(b-1);
          y=y+sn/n;
          n=n++;
      }
    y=y+a*2.302585092994046;
    return y;
}

 ,   

     ,    :
   

    arcsin  arcos    :
    .

private double Marcsin(double x0){
    double x=x0;
    if (x0<0){x=-x0;}
    double y=x;
    int n=1;
    double sn=x; 
    while (sn>1E-16){
            sn=sn*(2+1.0/n)*0.5*x*x;
            y=y+sn/(2*n+1)/(2*n+1); 
            n=n+1;
    }
    if (x0<0){y=-y;}
    return y; 
}
  
       .         x,   :
    java ,    Nikitin V.F.  2000 .
    x,  x<0,   ,   .
  x>1,  : x=1/x.
    (   ),  : 
  ,  x     [0,pi/12]. 
    y=arctg(x)   .
  y  p/6   
 x   1,   
 x  ,   

private double MArctg(double x0) {
  int sp=0;
  double x,x2,y;
  x=x0;
  if(x<0) {x=-x;}
  if(x>1) {x=1.0/x;}
  //   
  while(x>0.2617993877991495) {
    sp++; //   
    x=(x*1.732050807569-1)/(x+1.732050807569);
  }
  //  
    y=x;
    int n=1;
    double sn=x; 
    while (sn>1E-16){
            sn=sn*(2+1.0/n)*0.5*x*x;
            y=y+sn/(2*n+1)/(2*n+1); 
            n=n+1;
    }
        
  //   pi/6    
  y=y+sp*0.523598775598 
 
  if(x0>1) a=0.2617993877991495-a;
  if(x0<0) y=-y;
 
  return y;
}