NDArray division different in macOS and Linux

Given the same data and the same operation, the results are different for macOS and Ubuntu. The latter is a Ubuntu 64 bit VM running on my 2017 dual-core MacBook Pro 2017 with 3,5 GHz Intel Core i7.

The data:
treatment_probability = 0.17272727272727273 // (float64)
t = [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 1. 1. 0. 1. 0. 1. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0.] // <NDArray 50 @cpu(0)>

The operation to be done:
w_t = t / (2 * treatment_probability)

On macOS:
w_t = [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 2.8947368 0. 2.8947368 2.8947368 0. 2.8947368 0. 2.8947368 0. 2.8947368 0. 0. 0. 0. 0. 0. 0. 0. 0. 2.8947368 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 2.8947368 0. 0. 0. 0. 0. ] <NDArray 50 @cpu(0)>

On Ubuntu:
w_t = [nan nan nan nan nan nan nan nan nan nan inf nan inf inf nan inf nan inf nan inf nan nan nan nan nan nan nan nan nan inf nan nan nan nan nan nan nan nan nan nan nan nan nan nan inf nan nan nan nan nan] <NDArray 50 @cpu(0)>

My repo if you wish to try it: https://github.com/j1nma/counterfactuals