diff --git a/libs/math/include/psemek/math/math.hpp b/libs/math/include/psemek/math/math.hpp index 8438e6c7..a19ef28d 100644 --- a/libs/math/include/psemek/math/math.hpp +++ b/libs/math/include/psemek/math/math.hpp @@ -225,7 +225,8 @@ namespace psemek::math template T smootherstep(T x) { - return x * x * x * (T{10} - x * (T{15} - T{6} * x)); + auto x2 = x * x; + return x * x2 * (T{10} - x * T{15} + x2 * T{6}); } template