constant folding with infinities is wrong
```
main = let big = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
:: Double in
print (big * big - big * big)
```
prints NaN when compiled without optimizations but 0.0 when compiled with optimizations.
Or, `print (big * big / 2)` prints Infinity when compiled without optimizations but 8.98846567431158e307 when compiled with optimizations (this number is `fromRational (toRational (1/0) / 2)`).
The cause is the conversions that go on between Rational and Double in PrelRules (in the functions doubleOp2, mkDoubleVal, convFloating).
Ideally, we would have an accurate model of floating-point arithmetic on the target machine, but for now it would be an improvement to just not constant fold when the result is not a finite floating-point number.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"constant folding with infinities is wrong","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\nmain = let big = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\r\n :: Double in\r\n print (big * big - big * big)\r\n}}}\r\n\r\nprints NaN when compiled without optimizations but 0.0 when compiled with optimizations.\r\n\r\nOr, `print (big * big / 2)` prints Infinity when compiled without optimizations but 8.98846567431158e307 when compiled with optimizations (this number is `fromRational (toRational (1/0) / 2)`).\r\n\r\nThe cause is the conversions that go on between Rational and Double in PrelRules (in the functions doubleOp2, mkDoubleVal, convFloating).\r\n\r\nIdeally, we would have an accurate model of floating-point arithmetic on the target machine, but for now it would be an improvement to just not constant fold when the result is not a finite floating-point number.","type_of_failure":"OtherFailure","blocking":[]} -->
issue