diff --git a/tools/generate_rational_code.cpp b/tools/generate_rational_code.cpp index 833f2790b..2da7e000e 100644 --- a/tools/generate_rational_code.cpp +++ b/tools/generate_rational_code.cpp @@ -298,7 +298,7 @@ void print_rationals(int max_order) "template \n" "inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const std::integral_constant*)\n" "{\n" - " if(x <= 1)\n" + " if((-1 <= x) && (x <= 1))\n" " return static_cast(("; for(int bracket = 2; bracket < order; ++bracket) @@ -393,7 +393,7 @@ void print_rationals(int max_order) "template \n" "inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const std::integral_constant*)\n" "{\n" - " if(x <= 1)\n {\n" + " if((-1 <= x) && (x <= 1))\n {\n" " V x2 = x * x;\n" " return static_cast(("; @@ -609,7 +609,7 @@ void print_rationals(int max_order) "template \n" "inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const std::integral_constant*)\n" "{\n" - " if(x <= 1)\n {\n" + " if((-1 <= x) && (x <= 1))\n {\n" " V x2 = x * x;\n" " V t[4];\n";