add conv for hw2 and complement main.c

This commit is contained in:
2025-09-26 20:02:31 +09:00
parent 40064d644b
commit e172984338
4 changed files with 399 additions and 8 deletions

View File

@@ -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;
}