Is this type stable? Seeks like it returns something with the type of `x` if `x` is not in `[0, 1]` and returns a Float64 otherwise.