Optimize math::smootherstep somewhat
This commit is contained in:
parent
08f62bdaf7
commit
754b279b1a
1 changed files with 2 additions and 1 deletions
|
|
@ -225,7 +225,8 @@ namespace psemek::math
|
|||
template <typename T>
|
||||
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 <typename T>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue