Patrick Bos
1 min readAug 8, 2018

--

I think it depends a bit on the exact numbers you want to compare. In some cases differences of order 10^-17 can occur with regular double precision numbers as well.

One example I have seen often is when you do a Fourier transformation followed by an inverse one and compare the differences.

For instance, try this in Numpy:

import numpy as np
a = np.random.rand(4,4) # may need to try a few random calls
a_f = np.fft.fft2(a)
a_prime = np.fft.ifft2(a_f)
print(a - a_prime)

Most of the time, you’ll see a few numbers in the e-17 range.

--

--

Patrick Bos
Patrick Bos

Written by Patrick Bos

eScientist / freelancer / HPC & data science / Physics & Humanities / C++ & Python

Responses (1)