findRoot optimization and bugfix

and minor std.math cleanup
Just a preference, but if's on one line throw me off.  I'd prefer to do:
```
if ((b - a) < T(0.25) * (b0 - a0))
    baditer = 1;

foreach (int QQ; 0..baditer) {
```