@@ -136,23 +136,23 @@ impl SeriesApproximation {
136
136
self . original_probes . push ( delta_probe) ;
137
137
self . current_probes . push ( delta_probe) ;
138
138
139
- let mut delta_probe_n = delta_probe;
139
+ let mut current_value = delta_probe;
140
140
141
- let mut delta_probe_n_2 = Vec :: with_capacity ( self . order + 1 ) ;
142
- let mut delta_probe_n_derivative_2 = Vec :: with_capacity ( self . order + 1 ) ;
141
+ let mut delta_n = Vec :: with_capacity ( self . order + 1 ) ;
142
+ let mut delta_derivative_n = Vec :: with_capacity ( self . order + 1 ) ;
143
143
144
144
// The first element will be 1, in order for the derivative to be calculated
145
- delta_probe_n_2 . push ( delta_probe_n ) ;
146
- delta_probe_n_derivative_2 . push ( ComplexExtended :: new2 ( 1.0 , 0.0 , 0 ) ) ;
145
+ delta_n . push ( current_value ) ;
146
+ delta_derivative_n . push ( ComplexExtended :: new2 ( 1.0 , 0.0 , 0 ) ) ;
147
147
148
148
for i in 1 ..=self . order {
149
- delta_probe_n_derivative_2 . push ( delta_probe_n * ( i + 1 ) as f64 ) ;
150
- delta_probe_n *= delta_probe;
151
- delta_probe_n_2 . push ( delta_probe_n ) ;
149
+ delta_derivative_n . push ( current_value * ( i + 1 ) as f64 ) ;
150
+ current_value *= delta_probe;
151
+ delta_n . push ( current_value ) ;
152
152
}
153
153
154
- self . approximation_probes . push ( delta_probe_n_2 ) ;
155
- self . approximation_probes_derivative . push ( delta_probe_n_derivative_2 ) ;
154
+ self . approximation_probes . push ( delta_n ) ;
155
+ self . approximation_probes_derivative . push ( delta_derivative_n ) ;
156
156
}
157
157
158
158
// Get the current reference, and the current number of iterations done
@@ -192,21 +192,6 @@ impl SeriesApproximation {
192
192
approximation
193
193
}
194
194
195
- fn evaluate_next ( & self , point_delta : ComplexExtended ) -> ComplexExtended {
196
- // 1907 ms packing opus 4K
197
- // Horner's rule
198
- let mut approximation = self . next_coefficients [ self . order ] ;
199
-
200
- for k in ( 1 ..=( self . order - 1 ) ) . rev ( ) {
201
- approximation *= point_delta;
202
- approximation += self . coefficients [ k] ;
203
- }
204
-
205
- approximation *= point_delta;
206
- approximation. reduce ( ) ;
207
- approximation
208
- }
209
-
210
195
// pub fn evaluate_derivative(&self, point_delta: ComplexExtended) -> FloatExtended {
211
196
// let mut original_point_derivative_n = ComplexExtended::new(1.0, 0, 0.0, 0);
212
197
// let mut approximation_derivative = ComplexExtended::new(0.0, 0, 0.0, 0);
0 commit comments