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)
This would be easy, if it weren't impossible :-)
It's impossible because if (say) $a_1 = L$ and $b > 0$, then a suitable $a_2$ would have to be both $\le L$ and $\gt a_1$.
But suppose we restate the problem, so that $-L \lt a_1 \lt L$ and we require $-L \lt a_2 \lt L$. Now it's easy. All we need is a strictly increasing, invertible function
$g: (-L,L) \rightarrow \mathbb{R}$
For instance: $g(x) = \tan(\frac{\pi x}{2L})$, with inverse $g^{-1}(y)=\frac{2L}{\pi}tan^{-1}(y)$
Now define
$f(a,b) = g^{-1}(g(a)+b)$
and we're done.