Show HN: Boat – Big O analysis tool
boat.algorithm.city
boat.algorithm.city
If it's given two functions, it will try to locate their crossover point (if any) using a binary search, as well as compare their growth rates to determine which will eventually grow faster. It might get some wrong (I'm curious which) as it only has a handful of function classes.
The last feature it has is an automated master/muster theorem solver. It's pretty simple - you give it the values of a recurrence relation and it tells you the big O.
Thanks for looking!
https://boat.algorithm.city/analyzer/?&f=N*lg(N)*lg(lg(N))
"The Big Theta of N * lg(N) * lg(lg(N)) is O(n * lg(n))"
The list of big O classes is the following:
var classes = [
define_func("0"),
define_func("1"),
define_func("lg(n)"),
define_func("sqrt(n)"),
define_func("n"),
define_func("n * lg(lg((n)))"),
define_func("n * lg(n)"),
define_func("n * sqrt(n)"),
define_func("n**2"),
define_func("n**3"),
define_func("n**4"),
define_func("2**n"),
define_func("n**n"),
define_func("factorial(n)"),
define_func("2**(2**n)"),
define_func("n**(n**n)"),
];
lg(lg(N)) is very small, for 1e30, the value is
approximately ~6 and at 1e60 it is ~7.6, at which point lg(lg(N)) is pretty much a constant value (or trivial), but yes - it is technically included in the growth rate, but for practical purposes can probably be ignoredSo it analyses math equations you input? I would call this a simulation, as my first impression was that it would analyse source code...
I think one could execute source code with varying size inputs to get an idea of a function's growth (assuming the function does halt), but I haven't thought about what that entails
PS: maybe I should have named it BOFAT (Big O Formula Analyzer Tool)
for n = 2, n^n^n^n returns 65536. for n = 3, javascript thinks its infinity.
i guess BOAT should start using decimal values for n so we can detect this problem.