News for hackers. Stuff that matters.
Re:History and Derivation of the Fast Fourier Transform by lutusp on Monday March 20, 2017 @12:56PM (#13915706)
One reason is that in floating-point processing, in some cases adding a constant to an argument can truncate and lose the original argument, so using a single function will fail in a class of pathological edge cases:

    import numpy as np
    a = np.pi/2
    print(a)
    > 1.5707963267948966
    print(a == a + 1e-15)
    > False
    print(a == a + 1e-16)
    > True
    print(np.sin(1e-16))
    > 1e-16
    print(np.cos(np.pi/2+1e-16))
    > 6.12323399574e-17
    print(np.sin(1e-16) == np.cos(np.pi/2+1e-16))
    > False

There are no comments on this comment yet.