A dyadic polynomial product for sign tests #
The product of the factors 2 ^ j + x dominates its reflection for positive
x in the dyadic range. One factor uses a power of two within a factor of two
of x, and the other factors preserve the comparison. Scaling the input covers
the reciprocal range, while an even power amplifies the comparison.
Adapted from DyadicSignFactor, RationalSignProduct, and RationalSignError
in lean-canny at commit 970f28a5ecefc1327402ade16c068aa4b1b2c183.
The integer factors use the common argument 2 ^ B * x. This scales each
of the original factors by a positive power of two shared by both reflections.
On the positive dyadic range, the product of 2 ^ j + x dominates the
absolute value of the reflected product by a factor of at least three.
The integer polynomial obtained by scaling the input to the dyadic product
and raising the result to the even exponent 2 * s.
The product evaluates by casting the integer factors and using the same scale in every factor.
Reflection is exponentially suppressed for positive inputs in the advertised dyadic range.
The sum of the two reflected values is at least one at every real input. This is the denominator of the normalized sign approximation.