Make fastmath use optional in a package

While at first glance such a switch seems like good solution, it has one major drawback: dependencies you use in your code won’t be affected by it. That is, functions like sum or various BLAS library functions (* on matrices, for example) will still use the non-fastmath versions. So unless you want to code everything yourself, this will likely result in confusing differences in performance & semantics (“fast math” makes some assumptions about the input data, like not having NaN or Inf, among others).

So, what effect would you like such a switch to have? As is, I’m not sure there is enough information here to give a meaningful answer.

2 Likes