Removed all tests that required values to be identical after a
mathematical operation. This resulted in non-identical results when
testing on R without long doubles. There were some other places in
the code where tests did not fail but could under simple
circumstances and this was also improved to allow a tolerance of
1e-7.