I have a very large (and old and ugly structured, ported from Fortran to C#) mathematical library, where all calculations are now done using doubles (as there were inaccuracies). However, to compare the results with the results from the old implementation, we sometimes have to switch back to floats - to check that the ported code is correct.
My idea would be to somehow generate a second library from the first one, where all variables and called methods are replaced by the corresponding float implementation. Is there any automatic solution to allow switching between floats and doubles without manually implementing all the code twice? I am talking about more than 30000 lines of code.