Suppose I have a value $a_1$ such that $-L < a_1 < L$. I need to compute $a_2$ from $a_1$ and $b$, while satisfying the following requirements:
- $-L < a_2 < L$
- if $b = 0$ then $a_2 = a_1$
- if $b < 0$ then $a_2 < a_1$
- if $b > 0$ then $a_2 > a_1$
- a chaining requirement, explained below.
The operation can be written as $a_2 = f(a_1, b)$ (with an implicit $L$ argument which I'll leave out for clarity). In this notation, the chaining requirement can be expressed as: $f(a, b+c) = f(f(a, b), c)$. In intuitive terms, adjusting $a$ by $b$ and then by $c$ produces the same result as adjusting $a$ by $b + c$.
Can you recommend a function $f$ that satisfies these requirements? If you constructed the function rather than just happened to know one that fits these, could you outline the steps?
(edited to fix the impossible $-L \le a \le $L requirement)