big_O
big_O copied to clipboard
Floating-point precision when interpreting exponential dependence
When calculating the complexity, I got the following results:
Best : Exponential: time = 0.036 * 1^n (sec)
Constant: time = 0.5 (sec) (res: 5.5)
Linear: time = -0.43 + 0.0065*n (sec) (res: 1.7)
Quadratic: time = -0.098 + 2.4E-05*n^2 (sec) (res: 1)
Cubic: time = 0.024 + 9.6E-08*n^3 (sec) (res: 0.69)
Polynomial: time = 9.9E-05 * x^1.7 (sec) (res: 1.8)
Logarithmic: time = -2.6 + 0.64*log(n) (sec) (res: 2.7)
Linearithmic: time = -0.31 + 0.0011*n*log(n) (sec) (res: 1.5)
Exponential: time = 0.036 * 1^n (sec) (res: 0.6)
It seems to me that in the exponential dependence the value of the coefficient b should be shown in full, or the number of digits after the decimal point should be increased, since the exponent grows too quickly. The actual value of the coefficient b in this case is 1.01498.