what is the difference between turn out and come out

As indicated by @FumbleFingers in his comment, turned out is appropriate, and came out is not in the example given.

There is a related meaning for come out that seems as if it might apply

to yield a satisfactory solution ⇒ these sums just won't come out

However, come out is usually used to describe the result of an active process, such as the calculation in the example, rather than a more theoretical analysis by Galileo. It is often used to describe recipes or manufacturing operations.

How did the pie come out?

In almost all cases, turn out can be used in place of come out, but the obverse is not true.