Is there a way to find the maximum of a composition of floor functions?
$f(x) = \lfloor \lfloor x \times a \rfloor \times b \rfloor \times c \rfloor \times d - x$
$x \in [n, m], n \geq 0, n < m$
$a, b, c, d > 0$
I need $x$ so $f(x)$ is the highest or at least a smaller interval [n', m'] so I can iterate to find it.
A heuristic solution could be to bound each floor function above and below: $$\begin{aligned} a(x-1)&\leq\lfloor ax\rfloor\leq ax\\ b(a(x-1)-1)&\leq\lfloor b \lfloor ax\rfloor \rfloor\leq abx\\ (abcd-1)x-(cd+bcd+abcd)&\leq d\lfloor c\lfloor b \lfloor ax\rfloor \rfloor\rfloor -x\leq (abcd-1)x\\ \end{aligned}$$
Hence, the maximum of $f(x)=d\lfloor c\lfloor b \lfloor ax\rfloor \rfloor\rfloor -x$ over the interval $[n,m]$ lies in the interval:
$$[(abcd-1)m-(cd+bcd+abcd), (abcd-1)m]$$
Figure: $f(x)$ in black, the bounds of $f(x)$ in blue, $x=n,m$ in red and the bounds of the maximum in green. The tricky part is that the maximum of $f(x)$ isn't necessarily on the piece of the curve that touches $x=m$, as shown in the figure.
Graph: https://www.desmos.com/calculator/l9tiacrofk.