Update equalize function to work with special numbers

- Double/NaN
- Double/POSITIVE_INFINITY
- Double/NEGATIVE_INFINITY