cargo fmt

This commit is contained in:
sharkdp committed 2018-09-27 23:07:24 +02:00
1 parent 156933489b
commit f85e61dc39
5 files changed
+20 -16

No files matched your search

+5 -4
View File
@@ -71,12 +71,13 @@ pub fn write_benchmark_comparison(results: &Vec<BenchmarkResult>) {
let ratio = item.mean / fastest_item.mean;
// https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulas
// Covariance asssumed to be 0, i.e. variables are assumed to be independent
let ratio_stddev = ratio * ( (item.stddev/item.mean).powi(2) + (fastest_item.stddev/fastest_item.mean).powi(2) ).sqrt();
let ratio_stddev = ratio
* ((item.stddev / item.mean).powi(2)
+ (fastest_item.stddev / fastest_item.mean).powi(2))
.sqrt();
println!(
"{} ± {} times faster than '{}'",
format!("{:8.2}", ratio)
.bold()
.green(),
format!("{:8.2}", ratio).bold().green(),
format!("{:.2}", ratio_stddev).green(),
&item.command.magenta()
);