#include <malloc.h>
#include <math.h>
Go to the source code of this file.
Functions | |
long double | ami_horner (long double *pol, int degree, long double x, long double *fp) |
function to evaluate a polynomial and its derivate using Horner Algorithm | |
long double | ami_root_bisection (long double *pol, int degree, long double a, long double b, long double TOL) |
function to compute the polynomial root in an interval. We use a combination of bisection and Newton-Raphson tecniques | |
int | ami_polynomial_root (double *pol, int degree, double *root_r, double *root_i) |
function to estimate real polynomial roots. We use a recursive procedure computing the derivative polynomial roots. This function only works for relative low polynomial degree |
long double ami_horner | ( | long double * | pol, |
int | degree, | ||
long double | x, | ||
long double * | fp | ||
) |
function to evaluate a polynomial and its derivate using Horner Algorithm
pol | coefficient polynomial vector pol[0]+pol[1]*x+pol[2]*x^2+... |
degree | polynomial degree |
x | point to evaluate the polynomial |
fp | output polynomial derivate evaluation |
Definition at line 35 of file ami_pol.c.
int ami_polynomial_root | ( | double * | pol, |
int | degree, | ||
double * | root_r, | ||
double * | root_i | ||
) |
function to estimate real polynomial roots. We use a recursive procedure computing the derivative polynomial roots. This function only works for relative low polynomial degree
pol | coefficient polynomial vector pol[degree]+pol[degree-1]*x+pol[degree-2]*x^2+... FOR HISTORICAL REASONS THE ORDER POLYNOMIAL COEFICIENT IS GIVEN IS DIFFERENT THAT IN THE OTHERS POLYNOMIAL FUNCTIONS |
degree | polynomial degree |
root_r | output real component of polynomial roots |
root_i | output complex component of polynomial roots. Since this function only real roots this complex part is fitted to 0. FOR HISTORICAL REASONS WE KEEP THIS COMPLEX PART IN THE FUNCTION |
Definition at line 119 of file ami_pol.c.
long double ami_root_bisection | ( | long double * | pol, |
int | degree, | ||
long double | a, | ||
long double | b, | ||
long double | TOL | ||
) |
function to compute the polynomial root in an interval. We use a combination of bisection and Newton-Raphson tecniques
pol | coefficient polynomial vector pol[0]+pol[1]*x+pol[2]*x^2+... |
degree | polynomial degree |
a | left interval extreme |
b | right interval extreme |
TOL | convergence accuracy |
Definition at line 60 of file ami_pol.c.