Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. ```rb
  2. print 'cos '; puts Benchmark.realtime { 10000000.times { Math.cos 1 }}
  3. print 'sin '; puts Benchmark.realtime { 10000000.times { Math.sin 1 }}
  4. print 'tan '; puts Benchmark.realtime { 10000000.times { Math.tan 1 }}
  5. print 'acos '; puts Benchmark.realtime { 10000000.times { Math.acos 1 }}
  6. print 'asin '; puts Benchmark.realtime { 10000000.times { Math.asin 1 }}
  7. print 'atan '; puts Benchmark.realtime { 10000000.times { Math.atan 1 }}
  8. print 'cosh '; puts Benchmark.realtime { 10000000.times { Math.cosh 1 }}
  9. print 'sinh '; puts Benchmark.realtime { 10000000.times { Math.sinh 1 }}
  10. print 'tanh '; puts Benchmark.realtime { 10000000.times { Math.tanh 1 }}
  11. print 'acosh '; puts Benchmark.realtime { 10000000.times { Math.acosh 1 }}
  12. print 'asinh '; puts Benchmark.realtime { 10000000.times { Math.asinh 1 }}
  13. print 'atanh '; puts Benchmark.realtime { 10000000.times { Math.atanh 1 }}
  14. print 'exp '; puts Benchmark.realtime { 10000000.times { Math.exp 1 }}
  15. print 'log '; puts Benchmark.realtime { 10000000.times { Math.log 1, 1 }}
  16. print 'log2 '; puts Benchmark.realtime { 10000000.times { Math.log2 1 }}
  17. print 'log10 '; puts Benchmark.realtime { 10000000.times { Math.log10 1 }}
  18. print 'sqrt '; puts Benchmark.realtime { 10000000.times { Math.sqrt 1 }}
  19. print 'cbrt '; puts Benchmark.realtime { 10000000.times { Math.cbrt 1 }}
  20. print 'frexp '; puts Benchmark.realtime { 10000000.times { Math.frexp 1 }}
  21. print 'ldexp '; puts Benchmark.realtime { 10000000.times { Math.ldexp 1, 1 }}
  22. print 'hypot '; puts Benchmark.realtime { 10000000.times { Math.hypot 1, 1 }}
  23. print 'erf '; puts Benchmark.realtime { 10000000.times { Math.erf 1 }}
  24. print 'erfc '; puts Benchmark.realtime { 10000000.times { Math.erfc 1 }}
  25. print 'gamma '; puts Benchmark.realtime { 10000000.times { Math.gamma 1 }}
  26. print 'lgamma '; puts Benchmark.realtime { 10000000.times { Math.lgamma 1 }}
  27. print 'cbrt '; puts Benchmark.realtime { 10000000.times { Math.cbrt 1 }}
  28. print 'atan2 '; puts Benchmark.realtime { 10000000.times { Math.atan2 1, 1 }}
  29. ```
  30.  
  31. ```
  32. :Func :Before :After
  33. cos 4.254130927001825 1.4405686919926666
  34. sin 4.291027050989214 1.4243739590019686
  35. tan 5.363125992007554 1.483381660989835
  36. acos 4.32658559900301 1.2158808639942436
  37. asin 4.435602433994063 1.186041908003972
  38. atan 5.748181078990456 1.365189026997541
  39. cosh 4.990852664006525 1.2583572969888337
  40. sinh 4.523930807001307 1.29845637800463
  41. tanh 4.194435634999536 1.262307046999922
  42. acosh 4.406813007997698 1.236766300004092
  43. asinh 4.644120037002722 1.7610739079973428
  44. atanh 4.88491953999619 1.5865220309933648
  45. exp 4.4360210559971165 1.262295284002903
  46. log 8.53709495300427 2.3806999689986696
  47. log2 4.5818921600002795 1.3234373809973476
  48. log10 4.361282436992042 1.306003783000051
  49. sqrt 4.195985846003168 1.1582538549992023
  50. cbrt 4.281482355989283 1.3084301960043376
  51. frexp 4.681357052002568 1.7626637079956708
  52. ldexp 4.358438926996314 1.3060880839911988
  53. hypot 7.374471293005627 1.348440486995969
  54. erf 4.596977610999602 1.6560243620042456
  55. erfc 4.516037146997405 1.5825385909993201
  56. gamma 4.0430225580057595 1.194721624997328
  57. lgamma 4.750712952998583 1.8684836480097147
  58. cbrt 4.055364069994539 1.2893988039868418
  59. atan2 7.793055543996161 1.355327188008232
  60. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement