---
name: "Math::GSL::Poly"
section: "3pm"
platform: "linux"
package: "libmath-gsl-perl"
version: "0.45-2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Math::GSL::Poly"
---

# Math::GSL::Poly(3pm)

Solve and evaluate polynomials

## NAME

Math::GSL::Poly - Solve and evaluate polynomials

## SYNOPSIS

```
    use Math::GSL::Poly qw/:all/;
    my ($a,$b,$c) = (1,6,9);
    my ($x0, $x1) = (0,0);
    my $num_roots = gsl_poly_solve_quadratic( $a, $b, $c, \$x0, \$x1);
    print "${a}*x**2 + ${b}*x + $c contains $num_roots roots which are $x0 and $x1. \n";
```

## DESCRIPTION

Here is a list of all the functions included in this module :

- •

  gsl\_poly\_eval(@values, `$length`, `$x`)

  This function evaluates a polynomial with real coefficients for the real variable `$x`. `$length` is the number of elements inside `@values`. The function returns a complex number.

- •

  gsl\_poly\_complex\_eval(@values, `$length`, `$z`)

  This function evaluates a polynomial with real coefficients for the complex variable `$z`. `$length` is the number of elements inside `@valuesi`. The function returns a complex number.

- •

  gsl\_complex\_poly\_complex\_eval(@values, `$length`, `$z`)

  This function evaluates a polynomial with real coefficients for the complex variable `$z`. `$length` is the number of elements inside `@values`. `$length` is the number of elements inside `@values`. The function returns a complex number.

- •

  gsl\_poly\_dd\_init

- •

  gsl\_poly\_dd\_eval

- •

  gsl\_poly\_dd\_taylor

- •

  gsl\_poly\_solve\_quadratic( `$a`, `$b`, `$c`, \\$x0, \\$x1)

  Find the real roots of the quadratic equation `$a`\*x\*\*2+$b\*x+$c = 0, return the number of real root (either zero, one or two) and the real roots are returned by `$x0`, `$x1` and `$x2` which are deferenced.

- •

  gsl\_poly\_complex\_solve\_quadratic

- •

  gsl\_poly\_solve\_cubic($a, `$b`, `$c`, \\$x0, \\$x1, \\$x2)

  find the real roots of the cubic equation x\*\*3+$a\*x\*\*2+$b\*x+$c = 0, return the number of real root (either one or three) and the real roots are returned by `$x0`, `$x1` and `$x2` which are deferenced.

- •

  gsl\_poly\_complex\_solve\_cubic

- •

  gsl\_poly\_complex\_workspace\_alloc($n)

  This function allocates space for a gsl\_poly\_complex\_workspace struct and a workspace suitable for solving a polynomial with `$n` coefficients using the routine gsl\_poly\_complex\_solve.

- •

  gsl\_poly\_complex\_workspace\_free($w)

  This function frees all the memory associated with the workspace `$w`.

- •

  **gsl\_poly\_complex\_solve()**

For more information on the functions, we refer you to the GSL official documentation: \<http://www.gnu.org/software/gsl/manual/html\_node/\>

## AUTHORS

Jonathan "Duke" Leto \<jonathan@leto.net\> and Thierry Moisan \<thierry.moisan@gmail.com\>

## COPYRIGHT AND LICENSE

Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
