Skip to content

Bug in PolynomialInflate? #28

Description

@lamont-granquist
template <int N, typename ftype> inline void PolynomialInflate( ftype infPoly[N+2], ftype const coef[N+1], ftype root )
{
	infPoly[N+1] = coef[N];
	for ( int i=N-1; i>=0; --i ) infPoly[i+1] = coef[i] - root*infPoly[i+1];
	infPoly[0] = -root*coef[0];
}

Should that be infPoly[i+1] = coef[i] - root * coef[i+1]?

Completely possible that I can't math or computer before caffeine this morning, but my C# version of that code isn't passing tests I wrote without that change and the fix makes sense in my head since it combines the lines before and after it, and the middle coefficients in the results are what I'm seeing being buggy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions