add conv for hw2 and complement main.c
This commit is contained in:
@@ -29,7 +29,7 @@ float rtmuller(float (*func)(float), float x1, float x2, float xacc) {
|
||||
c = d2;
|
||||
|
||||
float disc = b * b - 4 * a * c;
|
||||
if (disc < 0) nrerror("Muller's method: complex roots encountered");
|
||||
if (disc < 0) nrerror("MullerMethodError: complex roots encountered");
|
||||
|
||||
float denom1 = b + sqrt(disc);
|
||||
float denom2 = b - sqrt(disc);
|
||||
@@ -46,6 +46,6 @@ float rtmuller(float (*func)(float), float x1, float x2, float xacc) {
|
||||
x_prev = x_curr;
|
||||
x_curr = x_next;
|
||||
}
|
||||
nrerror("Too many iterations in rtmuller");
|
||||
nrerror("MullerMethodError: too many iterations");
|
||||
return 0.0;
|
||||
}
|
||||
Reference in New Issue
Block a user