Math::Cephes::Polynomial

Math::Cephes::Polynomial is a Perl interface to the cephes math polynomial routines.
Download

Math::Cephes::Polynomial Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Randy Kobes
  • Publisher web site:
  • http://search.cpan.org/~rkobes/

Math::Cephes::Polynomial Tags


Math::Cephes::Polynomial Description

Math::Cephes::Polynomial is a Perl interface to the cephes math polynomial routines. Math::Cephes::Polynomial is a Perl interface to the cephes math polynomial routines.SYNOPSIS use Math::Cephes::Polynomial qw(poly); # 'poly' is a shortcut for Math::Cephes::Polynomial->new require Math::Cephes::Fraction; # if coefficients are fractions require Math::Cephes::Complex; # if coefficients are complex my $a = poly(); # a(x) = 1 + 2x + 3x^2 my $b = poly(; # b(x) = 4 + 5x + 6x^2 + 7x^3 my $c = $a->add($b); # c(x) = 5 + 7x + 9x^2 + 7x^3 my $cc = $c->coef; for (my $i=0; $ieval($x); print "At x=$x, c(x) is $rn"; my $u1 = Math::Cephes::Complex->new(2,1); my $u2 = Math::Cephes::Complex->new(1,-3); my $v1 = Math::Cephes::Complex->new(1,3); my $v2 = Math::Cephes::Complex->new(2,4); my $z1 = Math::Cephes::Polynomial->new(); my $z2 = Math::Cephes::Polynomial->new(); my $z3 = $z1->add($z2); my $z3c = $z3->coef; for (my $i=0; $ieval($x); print "At x=$x, z3(x) has real=", $r->r, " and imag=", $r->i, "n"; my $a1 = Math::Cephes::Fraction->new(1,2); my $a2 = Math::Cephes::Fraction->new(2,1); my $b1 = Math::Cephes::Fraction->new(1,2); my $b2 = Math::Cephes::Fraction->new(2,2); my $f1 = Math::Cephes::Polynomial->new(); my $f2 = Math::Cephes::Polynomial->new(); my $f3 = $f1->add($f2); my $f3c = $f3->coef; for (my $i=0; $ieval($x); print "At x=$x, f3(x) has num=", $r->n, " and den=", $r->d, "n"; $r = $f3->eval($a1); print "At x=", $a1->n, "/", $a1->d, ", f3(x) has num=", $r->n, " and den=", $r->d, "n";Requirements:· Perl Requirements: · Perl


Math::Cephes::Polynomial Related Software