This commit is contained in:
AZEN-SGG 2025-05-11 17:02:30 +03:00
parent f140ae9722
commit 6efd4f5786
20 changed files with 51 additions and 34 deletions

View file

@ -3,12 +3,13 @@
#include <math.h>
#include <float.h>
int t3_solve (
double t3_solve (
double (*f) (double),
double x, double h
) {
if (h < DBL_EPSILON)
double h_2 = h * h;
if (h_2 < NUM_FPE)
return DBL_MAX;
return (f(x + h) - 2 * f(x) + f(x - h)) / (h * h);
return (f(x + h) - 2 * f(x) + f(x - h)) / h_2;
}