I don't know how that would get optimized by the jit at runtime though.
http://docs.oracle.com/javase/7/docs/api/java/lang/Double.ht...
Both are marked as native functions in OpenJDK 7:
http://grepcode.com/file/repository.grepcode.com/java/root/j...