2026-01-27T15:19:25

This commit is contained in:
2026-01-27 15:19:22 +01:00
commit 0a9c6df070
27 changed files with 2249 additions and 0 deletions

24
integrate.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef INTEGRATE_H_
#define INTEGRATE_H_
#include <stddef.h>
typedef float (*integrand_f)(float x, void *ctx);
typedef enum
{
INTEG_OK = 0,
INTEG_ERR_BAD_ARGS = -1,
INTEG_ERR_N_EVEN_REQUIRED = -2
} integ_status_t;
integ_status_t midpoint(integrand_f f, void *ctx, float a, float b, unsigned n,
float *out);
integ_status_t trapezoid(integrand_f f, void *ctx, float a, float b, unsigned n,
float *out);
integ_status_t simpson(integrand_f f, void *ctx, float a, float b, unsigned n,
float *out);
#endif // INTEGRATE_H_