﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
254	Ordinary polynomial evaluation is incorrect	Paul Price	Paul Price	"The implementation of the evaluation of ordinary polynomials is incorrect.  The
accumulation is placed inside the ""if (mask)"" test, such that accumulation does
not take place if a coefficient is masked.

This is the case both in rel_3 and the mainline (I have revision 1.71 of
psFunctions.c, dated 3 Dec, but the lines in question don't appear to have been
updated since then).

I will attach example code demonstrating the bug (I suggest that it be worked in
to unit tests to demonstrate the masking functionality).  It calculates a 1D
polynomial in two ways.  The first is to mask out one of the coefficients; the
other is to set that coefficient to zero and not mask it.  These two methods
should produce the same result.  Here's what I get:

price@mithrandir:/home/mithrandir/price/testing>./polynomialBug
Value using mask: 1.000000
Value using coefficient zeroing: 0.500000

The fix is to move lines such as ""xSum *= x;"" outside the ""if (mask)"" block.

Note that this bug applies to evaluation of single- and double-precision
versions of ordinary polynomials of all dimensions."	defect	closed	normal		types	0.3.0	major	fixed		gusciora@…
