Solved by ptrblck in post #2 
              
              
                Your calculation looks correct the the small absolute error points to the floating point precision limitation, which is expected. In case you need to get a lower error, you could use float64 as the dtype.