Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Source uses the Microsoft .net NET framework, the problem was caused by 2 functions in the System.Math library. Both System.Math.Pow() and System.Math.Exp() can give different results for some number combinations on different machines. For individual function calls, different results occurred at <Kuan:> 0.09 % of the time with our randomly generated test data. We believe the issue is from different CPU’s implementing different optimisations to perform the operations as efficiently as possible. Within The functions are not implemented directly within the Microsoft .net NET framework, instead they are implemented in the Microsoft C run-time libraries which are used by the .NET framework, as well as by a number of other languages including C++ operations, so . So the nature of the .net NET framework, which is an interpreted language , wasn’t part of the issue and the same results would have been obtained if implemented in C++. We have since tested all available System.Math functions and these are the only two we have found that can produce different results on different machines. The vast majority of models don’t see the issue since the differences are very minor and for an individual operation, the difference is only at the last decimal place. However, for very large models with lots of feedback in the model, when the issue occurs it can snowball into meaningful result differences.

...

We have approached Microsoft about the issue and they are yet to respond.<Kuan: can you add in the link for the Microsoft post and include details about where the library currently is for plugin developers>

https://developercommunity.visualstudio.com/content/problem/502519/mathpow-and-mathexp-produce-inconsistent-results.html

We recommend plugin developers to use the new implementations of the functions which are in the TIME.Science.ConsistentMaths class within the TIME assembly.


Words from Trudy: 

Jira Legacy
serverJIRA
serverIdc4ca6e0f-9f42-3d1a-879c-870abe699ab1
keyRM-17341

...