MCPcopy Create free account
hub / github.com/covscript/covscript / test_math_ops

Function test_math_ops

tests/benchmark.py:114–123  ·  view source on GitHub ↗
(num_tests, precision_power)

Source from the content-addressed store, hash-verified

112
113
114def test_math_ops(num_tests, precision_power):
115 total_time = 0
116 for _ in range(num_tests):
117 start_time = runtime_time()
118 do_integral(
119 lambda x: math.sin(x) * math.cos(x) + math.sqrt(x), 0, 1, precision_power
120 )
121 total_time += runtime_time() - start_time
122 # Higher score = more operations per second
123 return int(num_tests * (10**precision_power) * 1000 / total_time)
124
125
126# ---------------------- String Operations ----------------------

Callers 1

mainFunction · 0.85

Calls 3

rangeFunction · 0.85
runtime_timeFunction · 0.85
do_integralFunction · 0.85

Tested by

no test coverage detected