Math::...byshev(3pm)

✨ NAME ✨

bestie, welcome to Math::GSL::Chebyshev β€” Univariate Chebyshev Series Approximation πŸ’– iykyk. this is the page for Math::...byshev(3pm), one of the User Contributed Perl Documentation girlies, and she's here to make polynomial fitting feel like a main character moment πŸŽ€


🌸 SYNOPSIS 🌸

okay so literally just look at how cute this is:

use Math::GSL::Chebyshev qw/:all/;

my $cheb             = gsl_cheb_alloc(40);
my $function         = sub { sin(cos($_[0])) };

gsl_cheb_init($cheb, $function, 0, 10);

my $x                = gsl_cheb_eval($cheb, 5.5 );
my ($status,$y,$err) = gsl_cheb_eval_err($cheb, 7.5 );
gsl_cheb_free($cheb);

that's the whole vibe πŸ”₯ alloc, init, eval, free. periodt.


πŸ‘‘ DESCRIPTION πŸ‘‘

alright bestie, here's every single function, no skips, no gatekeeping 🫢

  • gsl_cheb_alloc($size)
my $cheb = gsl_cheb_alloc(50);

this one allocates you a brand new Chebyshev object with $size sample points. go off, fresh allocation ✨

  • gsl_cheb_free($cheb)

frees up the memory chillin' with $cheb. returns void β€” nothing to report, she just cleans up and leaves πŸ’…

  • gsl_cheb_init($cheb,$function, $lower, $upper)
gsl_cheb_init($cheb, sub { sin(cos($_[0])) }, 0, 10 );

initiates a Chebyshev object with a function plus its upper and lower bounds. returns void. lowkey the glow-up phase of your object 🌈

  • gsl_cheb_eval($function, $value)
my $evaluated = gsl_cheb_eval($cheb, 5 );

hands you back a Perl scalar β€” that's your Chebyshev object $cheb evaluated at $value πŸ“

  • gsl_cheb_eval_err($cheb, $value)
my ($status,$evaluated,$err) = gsl_cheb_eval($cheb, 5 );

returns a list of three: a GSL status code, the evaluated value, and the estimated error of that evaluation. a whole trio, iconic πŸ’œ

  • gsl_cheb_eval_n β€” yep, she's here, and that's all this page has to say about her πŸ™ˆ
  • gsl_cheb_eval_n_err β€” same deal, listed and lovely ✨
  • gsl_cheb_eval_mode β€” on the list, bestie πŸ’–
  • gsl_cheb_eval_mode_e β€” also on the list 🌸
  • gsl_cheb_calc_deriv($deriv,$cheb)
my $status = gsl_cheb_calc_deriv( $deriv, $cheb );

this will calculate the derivative of $cheb and store it in $deriv, which must be pre-allocated. returns a GSL status code. get that derivative, queen πŸ‘‘

  • gsl_cheb_calc_integ($integ,$cheb)
my $status = gsl_cheb_calc_integ( $deriv, $cheb );

this will calculate the derivative of $cheb and store it in $deriv, which must be pre-allocated. returns a GSL status code. (not me noticing the doc says "derivative" here too β€” i'm just the messenger, i promise 😭 keep your pre-allocation game strong regardless.)


πŸ’« AUTHORS πŸ’«

shoutout to the icons who made this: Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com> πŸŽ€


Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

fr fr, same terms as Perl itself β€” respect the license, it's the rules πŸ’…

kisses, bestie, this page was brought to you by perl v5.42.3 on 2026-08-20, appearing in that cute little Math::...byshev(3pm) footer spot. slay, eat, no crumbs left πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from