diff options
Diffstat (limited to 'test/std_error.c')
| -rw-r--r-- | test/std_error.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/std_error.c b/test/std_error.c new file mode 100644 index 0000000..1bc050e --- /dev/null +++ b/test/std_error.c @@ -0,0 +1,17 @@ +#include <math.h> +#include <stddef.h> +#include "ts.h" + +bool ts_test_std_error( void ) +{ + fp_t const x[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; + fp_t const * const inp[1] = { x }; + + /* k=3, SD=sqrt(2/3)=0.81650 for all windows */ + /* StdError = SD/sqrt(3) = 0.81650/1.73205 = 0.47140 */ + fp_t const e[] = { 0.47140, 0.47140, 0.47140, 0.47140, 0.47140, 0.47140, 0.47140, 0.47140 }; + fp_t const * const exp[1] = { e }; + + uint_t k = 3; + return ts_test(ts_std_error, ts_std_error_offset, inp, exp, sizeof( x ) / sizeof( *x ), (ts_constant_t *)&k, &ts_std_error_p); +} |