Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaxin Gao committed Apr 10, 2024
1 parent 4363b92 commit 20e213b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions core/src/execution/datafusion/expressions/covariance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,12 @@ impl Accumulator for CovarianceAccumulator {
continue;
}
let new_count = self.count + c;
let new_mean1 = self.mean1 * self.count / new_count
+ means1.value(i) * c / new_count;
let new_mean2 = self.mean2 * self.count / new_count
+ means2.value(i) * c / new_count;
let new_mean1 = self.mean1 * self.count / new_count + means1.value(i) * c / new_count;
let new_mean2 = self.mean2 * self.count / new_count + means2.value(i) * c / new_count;
let delta1 = self.mean1 - means1.value(i);
let delta2 = self.mean2 - means2.value(i);
let new_c = self.algo_const
+ cs.value(i)
+ delta1 * delta2 * self.count * c / new_count;
let new_c =
self.algo_const + cs.value(i) + delta1 * delta2 * self.count * c / new_count;

self.count = new_count;
self.mean1 = new_mean1;
Expand Down

0 comments on commit 20e213b

Please sign in to comment.