xlow =x-xmax if x<=xmax, 0
otherwise
xhigh=x-xmax if x>xmax, 0 otherwise
high=1
if x>xmax, 0 otherwise.
That sounds more complicated than it is, imagine
x=1,2,3,4,5,6,7,8,9,10 and xmax=5, the data would look like
this:
x |
xlow |
xhigh |
high |
1 |
-4 |
0 |
0 |
2 |
-3 |
0 |
0 |
3 |
-2 |
0 |
0 |
4 |
-1 |
0 |
0 |
5 |
0 |
0 |
0 |
6 |
0 |
1 |
1 |
7 |
0 |
2 |
1 |
8 |
0 |
3 |
1 |
9 |
0 |
4 |
1 |
10 |
0 |
5 |
1 |