applied Cyril Briquet's patch (with slight changes) to improve FastFourierTransform efficiency JIRA: MATH-216