Apr-24-2020, 05:20 AM
what is execution time (speed) of math functions like isqrt(), exp(x), log(), log10() etc.?
what is speed of different functions of math library?
|
Apr-24-2020, 05:20 AM
what is execution time (speed) of math functions like isqrt(), exp(x), log(), log10() etc.?
Apr-24-2020, 05:27 AM
you understand this depends on particular system you run your code on, right?
care to elaborate what you are after?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link Create MCV example Debug small programs
Apr-24-2020, 07:58 AM
You can do the check by yourself:
Windows PowerShell Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. Lernen Sie das neue plattformübergreifende PowerShell kennen – https://aka.ms/pscore6 PS C:\Users\Admin> ipython.exe Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] Type 'copyright', 'credits' or 'license' for more information IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import math In [2]: isqrt = math.isqrt In [3]: %timeit isqrt(1) 76.5 ns ± 4.86 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each) In [4]:You could use the %timeit macro in IPython3 .I have done the assignment of isqrt to save lookup time.Of course the results differs between Linux/Windows/Mac and CPU +cache. You won't get always the same results, because in the background is also much happening.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians! |
|