Skip to main content
Spelling error
Source Link
Chris
  • 5.8k
  • 1
  • 7
  • 39

I was only able to find three points this time:

  1. Mean precision: You still accumulate meanDuration as a long. Dividing later truncates precision. Switching to double throughout would avoid loss.
  2. Standard deviation formula: You’re using population SD (n in denominator). If you want sample SD, IMO, you should use (n - 1). Right now, results may understate variability for small samples.
  3. Formatting consistency: toString() mixes formatted longs with raw doubles. Consider formatting all values with NumberFormat or DecimalFormat for uniformity.

You might as well put MINIMUM_ITERATIONS high enough to get reasonnablereasonable results. That is all I was able to spot.

I was only able to find three points this time:

  1. Mean precision: You still accumulate meanDuration as a long. Dividing later truncates precision. Switching to double throughout would avoid loss.
  2. Standard deviation formula: You’re using population SD (n in denominator). If you want sample SD, IMO, you should use (n - 1). Right now, results may understate variability for small samples.
  3. Formatting consistency: toString() mixes formatted longs with raw doubles. Consider formatting all values with NumberFormat or DecimalFormat for uniformity.

You might as well put MINIMUM_ITERATIONS high enough to get reasonnable results. That is all I was able to spot.

I was only able to find three points this time:

  1. Mean precision: You still accumulate meanDuration as a long. Dividing later truncates precision. Switching to double throughout would avoid loss.
  2. Standard deviation formula: You’re using population SD (n in denominator). If you want sample SD, IMO, you should use (n - 1). Right now, results may understate variability for small samples.
  3. Formatting consistency: toString() mixes formatted longs with raw doubles. Consider formatting all values with NumberFormat or DecimalFormat for uniformity.

You might as well put MINIMUM_ITERATIONS high enough to get reasonable results. That is all I was able to spot.

Source Link
Chip01
  • 553
  • 1
  • 11

I was only able to find three points this time:

  1. Mean precision: You still accumulate meanDuration as a long. Dividing later truncates precision. Switching to double throughout would avoid loss.
  2. Standard deviation formula: You’re using population SD (n in denominator). If you want sample SD, IMO, you should use (n - 1). Right now, results may understate variability for small samples.
  3. Formatting consistency: toString() mixes formatted longs with raw doubles. Consider formatting all values with NumberFormat or DecimalFormat for uniformity.

You might as well put MINIMUM_ITERATIONS high enough to get reasonnable results. That is all I was able to spot.