Hi Jean and Roberto - I've been reading Lilly's section on the Trutine of Hermes. He sets out the method quite methodically, but at points it is somewhat difficult to follow.
The first stage, which seems relatively clear, is to work out the distance from the Moon to the horizon in the unrectified chart in the following way.
If the Moon is below the horizon, add one day to 273 days for every twelve degrees the moon is distant from the ascendant.
If the Moon is above the horizon, subtract one day from 273 days for every twelve degrees the moon is distant from the descendant.
So for example, if the Moon is below the horizon in a horoscope, and it is 120 degrees from the ascendant, the adjustment figure in days would be 273 + 10 = 283 days. In this case, the day of conception would be 283 days before the date of birth.
If the Moon is above the horizon and it is 120 degrees from the descendant, the adjustment figure in days would be 273 - 10 = 263 days. In this case the day of conception would be 263 days before the date of birth.
In your script Jean the output gives five options of conception dates, only one of which is within Lilly's range of 273 days +/- 15 days. These additional alternatives could potentially be misleading so it might be best to remove them.
In my chart I get the correct figure of 274 days since my Moon is just over 12 degrees from the ascendant that I use, but I'm not sure if your algorithm works as above Jean. I would need to take a closer look at the code. The degree, minute and second of the conception ascendant then is matched to the degree, minute and second of the natal moon.
I think the rectification process would then be to move the ascendant of the natal chart until it matches the exact degree, minute and second of the position of the conception moon.
My guess is that the position of the unrectified natal moon needs to be pretty close to correct for this method to work, so it only seems to be for fine tuning a chart that is very nearly correct. If the unrectified natal moon is two or three or more degrees from its 'correct' position I can't see how the method would be useful. Of course, the position of the unrectified natal moon is, by definition, uncertain, so the logic seems quite circular to me.
Perhaps Roberto can clarify this for us.
I'll keep working on this in the background.
Ed