Skip to content

Commit

Permalink
fix med computation
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Aug 2, 2024
1 parent 9fb1f32 commit 3d73aad
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bench/report/runs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ let max_clock runs =

let median_clock runs =
let n = List.length runs in
let runs = List.sort compare @@ List.map (fun run -> Run.clock run) runs in
if n = 0 then 0.
else if n mod 2 = 0 then
( Run.clock (List.nth runs (n / 2))
+. Run.clock (List.nth runs ((n / 2) + 1)) )
/. 2.
else List.nth runs (n / 2) |> Run.clock
(List.nth runs (n / 2) +. List.nth runs ((n / 2) + 1)) /. 2.
else List.nth runs (n / 2)

let sum_clock runs = List.fold_left (fun sum r -> Run.clock r +. sum) 0. runs

Expand Down

0 comments on commit 3d73aad

Please sign in to comment.