I had a message-passing algorithm written in MATLAB, but our SW Dev department wanted it written in C#. After I wrote it in C#, I found a numerical instability in the C# version. Later I wanted to run the same algorithm on a Spark Cluster, so I rewrote it again in Python. The MATLAB version running on my Windows 10 machine yields the same answers as the Python version (whether I run on my local machine or a Spark Cluster in Azure). The only fix I could find for C# was to round the output of one method to 11 or 12 decimal digits so that the numbers that ought to remain identical would remain identical. I think something funky is happening to double precision (maybe all floating point) calculations in .NET. Thanks for introducing me to GodBolt.org. I think it's going to be very useful.
M
Member_15089351
@Member_15089351