@@ -8,7 +8,7 @@ use std::mem::swap;
88pub struct SeriesApproximation {
99 pub current_iteration : usize ,
1010 maximum_iteration : usize ,
11- delta_pixel : FloatExtended ,
11+ delta_pixel_square : FloatExtended ,
1212 z : ComplexArbitrary ,
1313 c : ComplexArbitrary ,
1414 pub order : usize ,
@@ -22,7 +22,7 @@ pub struct SeriesApproximation {
2222}
2323
2424impl SeriesApproximation {
25- pub fn new ( c : ComplexArbitrary , order : usize , maximum_iteration : usize , delta_pixel : FloatExtended , delta_top_left : ComplexExtended ) -> Self {
25+ pub fn new ( c : ComplexArbitrary , order : usize , maximum_iteration : usize , delta_pixel_square : FloatExtended , delta_top_left : ComplexExtended ) -> Self {
2626 let mut coefficients = vec ! [ ComplexExtended :: new2( 0.0 , 0.0 , 0 ) ; order as usize + 1 ] ;
2727
2828 coefficients[ 0 ] = to_extended ( & c) ;
@@ -32,7 +32,7 @@ impl SeriesApproximation {
3232 SeriesApproximation {
3333 current_iteration : 1 ,
3434 maximum_iteration,
35- delta_pixel ,
35+ delta_pixel_square ,
3636 z : c. clone ( ) ,
3737 c,
3838 order,
@@ -95,16 +95,16 @@ impl SeriesApproximation {
9595 derivative_probe += self . next_coefficients [ k] * self . approximation_probes_derivative [ i] [ k - 1 ] ;
9696 } ;
9797
98- let relative_error = ( self . current_probes [ i] - series_probe) . norm ( ) ;
99- let mut derivative = derivative_probe. norm ( ) ;
98+ let relative_error = ( self . current_probes [ i] - series_probe) . norm_square ( ) ;
99+ let mut derivative = derivative_probe. norm_square ( ) ;
100100
101101 // Check to make sure that the derivative is greater than or equal to 1
102102 if derivative. to_float ( ) < 1.0 {
103103 derivative = FloatExtended :: new ( 1.0 , 0 ) ;
104104 }
105105
106106 // Check that the error over the derivative is less than the pixel spacing
107- if relative_error / derivative > self . delta_pixel {
107+ if relative_error / derivative > self . delta_pixel_square {
108108 self . z -= & self . c ;
109109 self . z . sqrt_mut ( ) ;
110110 return false ;
@@ -146,7 +146,7 @@ impl SeriesApproximation {
146146 delta_probe_n_derivative_2. push ( ComplexExtended :: new2 ( 1.0 , 0.0 , 0 ) ) ;
147147
148148 for i in 1 ..=self . order {
149- delta_probe_n_derivative_2. push ( ( delta_probe_n * ( i + 1 ) as f64 ) ) ;
149+ delta_probe_n_derivative_2. push ( delta_probe_n * ( i + 1 ) as f64 ) ;
150150 delta_probe_n *= delta_probe;
151151 delta_probe_n_2. push ( delta_probe_n) ;
152152 }
0 commit comments