Saturday 11 February 2017

algebra precalculus - Combining sum of floor functions

Consider a simple sum of floor functions:
$$S = c\left\lfloor \frac{x}{a}\right\rfloor + d\left\lfloor \frac{x}{b} \right\rfloor$$




Can we combine these two terms into a single function? I am trying to simplify something like this to avoid successive divisions in a computer program.



My question, in general, is: can we combine the following $k$ terms to avoid performing $k$ divisions and multiplications of $x$:
$$S(x,k)=\sum_{i=0}^{k}c_i\left\lfloor \frac{x}{a_i}\right\rfloor$$

No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...