All the formulae in the world are not going to give the most accurate results.
I don't believe there is a single tank in the world that conforms exactly to the "design specifications", both in dimensions, and shape conformity along length or height.
Add to that, dished ends on horizontal tanks are often at least 2 different radii, and you have an extremely complex bit of maths to do, and likely not yielding a good result because of the above.
Another factor to take into consideration is a tank's dimensions will change with temperature.
One way of determining the contents of a tank is to put the tank on load cells, and measure the tared weight. However, that can only be done for contents that have a known and consistent density.
For those, and other, reasons, accurate volume measurement in tanks is most often done by having the tank "dipped", "strapped", or other names, where the tank is pre-calibrated by filling and recording the height at intervals. The more measurements that are taken, the greater the accuracy between the points (interpolation).
There are several ways of measuring the height of the contents, a float on a wire, capacitive probes, ultrasonics, laser, even radar, failing that, a long wooden stick with a scale on it (UK brewing used to use this method, done by the then "Weights & Measures" government department).