Is your question about making a LUT when you have limited memory?
Example:
'X' is incoming variable.
'Y' is returned result.
'A' is first address of memory where the LUT resides.
'J' is the total quantity of expected X and Y values.
For K = 1 to J, calculate what Y(K) results from X(K). You will store the Y results in the LUT.
You will need to devise a scaling formula... so that you can start with a given X, multiply it by the scaler up or down, and arrive at a number K, which you will use to locate the Y result in the LUT.
See if you can store each Y value in the fewest bytes possible. Store them in contiguous memory, one after the other.
'N' is the amount of memory occupied by each result.
Take an incoming X, multiply it by the scaling formula, to obtain an integer K.
Calculate K x N + A.
The Y result is stored there.
Read N bytes.
- - - Updated - - -
If you have sufficient memory, you can make a LUT for X values too. Put it at the first byte AX.
Then you will take an incoming X, search the LUT for the next lower X value, starting at K x N +AX.
Stop when you find the next lower X value. The Y result is at K x N +AY, where AY is the first byte where the Y LUT resides.