W elcome to
Fintronic USA

redball.gif (326 bytes)About Fintronic USA

redball.gif (326 bytes)Main announcements

redball.gif (326 bytes)What's new at Fintronic

redball.gif (326 bytes)What our customers are saying...

redball.gif (326 bytes)Support for SystemC

redball.gif (326 bytes)Support for Verilog 2001

redball.gif (326 bytes)Third party tools integrated with FinSim(Specman, Denali, Debussy, Undertow, Vera, VirSim, HDL Score, Comet, Meteor, NelSim, Pivot, DeskPOD, @Designer 2.1)

home.htmlProductsSupportEvaluateContact

Finding roots of polynomials as well as finding polynomials given roots. A polynomial of order 12000 is exemplified


This example works on FinSim 10_07_15 and subsequent versions. It run on an Intel i3 2.3GHz processor in 18 seconds.

This example shows how to find the roots of a polynomial and how to find the polynomial given the roots. Note that the polynomial is not sparse, as all its coefficients are non-zero. Also note that the coefficients are in a close range: -6 to 15.

module top;
parameter size = 5131;
   real d, p[0:size-1], p1[0:size-1];
   VpFCartesian r[0:size-2];

   initial begin
      /* set the values of the coefficients of the polynomial p */
      $InitM(p, 1.599);
      p[0] = 15;
      p[1000] = 2;
      p [size-2] = 3;
      p [size-1] = -6;
      /* compute the roots r of polynomial p */
      r = $Roots(p);
      $PrintM(r, "%e");
      /* compute the polynomial p1 corresponding to the roots r */
      p1 = $Poly(r);
      $PrintM(p1, "%e");
      /* compare p and p1 */
      d = $VpDistAbsMax(p, p1);
      $display("distance = %e\n", d);
   end
endmodule // top


© Copyright 1999-2011, Fintronic USA, Inc.   All rights reserved.