findRoot optimization and bugfix

and minor std.math cleanup
Don't think there is any sort of formal proposal.