summaryrefslogtreecommitdiffstats
path: root/lib/chebyshev_t.c
diff options
context:
space:
mode:
authorEthan Werner <mail@ethanwerner.com>2026-08-09 15:02:21 +0400
committerEthan Werner <mail@ethanwerner.com>2026-08-09 15:02:21 +0400
commit3d92926a902017e7cf1f5738e99ff62da596ce12 (patch)
tree2b55422c26a48759d56fa91f06df24449e9dfa88 /lib/chebyshev_t.c
parent07e18043145f3d91c8ea7ec3ad41b3c905585277 (diff)
Diffstat (limited to 'lib/chebyshev_t.c')
-rw-r--r--lib/chebyshev_t.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/chebyshev_t.c b/lib/chebyshev_t.c
index a0230b8..5428fa4 100644
--- a/lib/chebyshev_t.c
+++ b/lib/chebyshev_t.c
@@ -28,32 +28,32 @@ int ts_chebyshev_t(
{
TS_PROLOGUE( ts_chebyshev_t_p );
(void)c;
- for( uint_t i = 0; i < n; ++i )
- {
- fp_t xv = x[0][i];
- uint_t n_val = (uint_t)x[1][i];
- if (x[1][i] < 0 || x[1][i] > 10000) { y[0][i] = 0; continue; }
- if( n_val == 0 )
- {
- y[0][i] = 1.0;
- }
- else if( n_val == 1 )
- {
- y[0][i] = xv;
- }
- else
- {
- fp_t t0 = 1.0;
- fp_t t1 = xv;
- for( uint_t k = 2; k <= n_val; ++k )
- {
- fp_t t2 = 2.0 * xv * t1 - t0;
- t0 = t1;
- t1 = t2;
- }
- y[0][i] = t1;
- }
- }
+ for( uint_t i = 0; i < n; ++i )
+ {
+ fp_t xv = x[0][i];
+ uint_t n_val = (uint_t)x[1][i];
+ if (x[1][i] < 0 || x[1][i] > 10000) { y[0][i] = 0; continue; }
+ if( n_val == 0 )
+ {
+ y[0][i] = 1.0;
+ }
+ else if( n_val == 1 )
+ {
+ y[0][i] = xv;
+ }
+ else
+ {
+ fp_t t0 = 1.0;
+ fp_t t1 = xv;
+ for( uint_t k = 2; k <= n_val; ++k )
+ {
+ fp_t t2 = 2.0 * xv * t1 - t0;
+ t0 = t1;
+ t1 = t2;
+ }
+ y[0][i] = t1;
+ }
+ }
return 0;
}