gave rational_func generic type instead of double