Example #1
0
File: fracexp.py Project: surban/ml
 def impl(self, re, im):
     if np_cabs(re - CP_re, im - CP_im) <= r0:
         return 1., 0.
     else:
         r_re, r_im = crecip(re, im)
         z_re, z_im = cmul(CP_re, CP_im, r_re, r_im)
         x_re, x_im = np_blog(re, im)
         y_re, y_im = self.impl(x_re, x_im)
         return cmul(z_re, z_im, y_re, y_im)
Example #2
0
File: fracexp.py Project: surban/ml
 def rec(self, re, im):
     if np_cabs(re, im) <= r0:
         return 1., 0., re + CP_re, im + CP_im
     else:
         x_re, x_im = cmul(re, im, CPR_re, CPR_im)
         d_re, d_im, ci_re, ci_im = self.rec(x_re, x_im)
         y_re, y_im = np_cexp(d_re, d_im)
         z_re, z_im = cmul(y_re, y_im, d_re, d_im)
         w_re, w_im = cmul(z_re, z_im, CPR_re, CPR_im)
         cix_re, cix_im = np_cexp(ci_re, ci_im)
         return w_re, w_im, cix_re, cix_im
Example #3
0
File: fracexp.py Project: surban/ml
 def impl(self, re, im):
     if np_cabs(re - CP_re, im - CP_im) <= r0:
         return re - CP_re, im - CP_im
     else:
         x_re, x_im = np_blog(re, im)
         y_re, y_im = self.impl(x_re, x_im)
         return cmul(CP_re, CP_im, y_re, y_im)
Example #4
0
File: fracexp.py Project: surban/ml
 def impl(self, re, im):
     if np_cabs(re, im) <= r0:
         return re + CP_re, im + CP_im
     else:
         x_re, x_im = cmul(re, im, CPR_re, CPR_im)
         y_re, y_im = self.impl(x_re, x_im)
         return np_cexp(y_re, y_im)