Benchmark Operations | 37
AlgorithmsThe Math of
To refute hypothesis H2, we conduct an experiment that pre-computes the value
of 2nand then evaluates the time to compute 3.14159*2n. We executed 50 trials
that performed 10,000 evaluations of the equation 3.14159*2n. We discarded the
best and worst performers, leaving 48 trials. The average time of these 48 trials is
shown in Figure 2-9 (these results are essentially the same, even if we multiply by
1.0000001 instead of 3.14159).
Figure 2-8. Execution times for computing 2x
Figure 2-9. Execution times for computing large multiplication
Algorithms in a Nutshell
Algorithms in a Nutshell By Gary Pollice, George T. Heineman, Stanley Selkow ISBN:
9780596516246 Publisher: O'Reilly Media, Inc.
Prepared for Ming Yi, Safari ID: [email protected]
Licensed by Ming Yi
Print Publication Date: 2008/10/21 User number: 594243
© 2009 Safari Books Online, LLC. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use