Calculation FG (final density, Final Gravity) of beer

Rather than calculating the FG, it would be more correct to estimate the FG, in fact, to determine the FG of a beer, many variables concur, often difficult to control and manage, so we can limit ourselves to estimating its value.
We have always tried to find formulas that estimate this value, in truth they are all very approximate, and most take into account only the average attenuation of yeast, so it is difficult to rely on such formulas in the design of a beer.
So how do we get the most reliable estimate possible?
Our software has introduced a calculation of the FG that is giving us great satisfactions, it is an algorithm based on a series of basic data related to the attenuation of the various yeasts, to the characteristics of the fermentable, all this is related to the temperature of the mash, and then thanks to the experience of our collaborators, everything is parameterized in a complex of formulas.

Our algorithm is applied only if certain conditions are met:

The Grist must be composed exclusively of fermentables taken from our database, can not be used custom malts of which the software ignores the characteristics of fermentability.
The chosen yeast, also he must be present in our database, and we must not change the average attenuation data that is proposed by the Calcoliamo birra app.
You must set a mash in the recipe, and this mash must comply with very specific rules, namely:

there must be at least one step whose temperature is between 62 ° C and 70 ° C whose duration is at least 45 minutes
or
two steps whose temperature is between 62 ° C and 70 ° C and the sum of the two durations is at least 45 minutes

If these conditions are not respected, the Calcoliamo birra app will still provide an FG, but applying only the average attenuation of the yeast.
The signal that the app is applying one or the other algorithm, is highlighted by a green light icon next to the value of the FG (algorithm we calculate beer), in the case instead of a yellow light icon, the algorithm applied is generic and not very reliable.