Well I have finished the excel file to implement calculations of the filmic curve that @anon41087856 provided.
I was having some problems because I was in the error of thinking that a 18% value in the raw file from white point should be mapped to a 50% value after applying the shaper function.
And then I had a bug in the formulas of the transfer function that keep me getting negative values of TD.
But I have corrected it and now it works well.
I can input the white point and black point of the camera values (and the number of bits) and get BlackEV an WhiteEV calculated.
I calculate also the output display values with a given gamma and number of bits of the display.
So I can show the shaper transform, the transfer function transform, normalize output (before gamma conversion) against camera normalize values and display data versus camera raw data.
If I understood well what @anon41087856 explained the transfer function has to be applied to the output of the shaper function.
Then you apply the gamma correction to get the display values.
For the example I give before:
RAW values (12 bits)
white clip value: 4090
black value: 4
grey 18%
this gives -7.5 BlackEV and 2.47 whiteEV. Dynamic range about 10.
lattitude: 7
contrast: 1.2
Display 8 bits, gamma 1.1
This is the shaper function against normalize camera data
This the transfer function (Hermite spline interpolation) with lattitude 7 and 1.2 contrast
What I wanted to see the normalize output of combined transfer and shaper (before final converstion to display with gamma) against normalize input of the raw sensor data.
And the final display data after gamma conversion and in display units against raw input data.
I will put it later (I had uploaded come curves but they were incorrect, I will upload them when I get them correct).
I am not sure yet if all is correct, I think this is the way filmic does its job.
If somebody is interested in the excel file in order to play his own games with numbers, no problem to provide it.