TooN Algorithm Library - tag  0.2
quartic.h
Go to the documentation of this file.
1 #ifndef QUARTIC_H
2 #define QUARTIC_H
3 
4 namespace tag {
5 
7 inline double eval_quartic(double B, double C, double D, double E, double x)
8 {
9  return E + x*(D + x*(C + x*(B + x)));
10 }
11 
13 inline double newton_quartic(double B, double C, double D, double E, double x)
14 {
15  double fx = E + x*(D + x*(C + x*(B + x)));
16  double dx = D + x*(2*C + x*(3*B + x*4));
17  return x - fx/dx;
18 }
19 
31 int find_quartic_real_roots(double B, double C, double D, double E, double r[]);
32 
33 }
34 
35 #endif