cast freq to double for arm compatibility