Math::GSL::Sum(3pm)

✨ NAME ✨

Math::GSL::Sum β€” bestie, this is the module that sums series with the Levin u-transform πŸ’– it makes slow-ass series converge faster, no cap.


🌸 SYNOPSIS 🌸

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

my $w = gsl_sum_levin_u_alloc(5);
$values = [8,2,3,4,6];
my ($status, $sum_accel, $abserr) = gsl_sum_levin_u_accel($values, 5, $w);
gsl_sum_levin_u_free($w);

my $w2 = gsl_sum_levin_utrunc_alloc(5);
my ($status2, $sum_accel2, $abserr_trunc) = gsl_sum_levin_utrunc_accel($values, 5, $w2);
gsl_sum_levin_utrunc_free($w);
ok so literally copy that vibe, it's the whole workflow: alloc a workspace, accelerate, free it. do NOT skip the free, that's the girlies leaving memory everywhere πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

These functions accelerate the convergence of a series using the Levin u-transform. Translation: when your series is taking forever to settle down, this gives it main character energy and makes it snap into place sooner. ✨

  • gsl_sum_levin_u_alloc($n) β€” allocates a workspace for a Levin u-transform of $n terms. it's giving "reserve your table in advance" πŸŽ€
  • gsl_sum_levin_u_free($w) β€” this function frees the memory associated with the workspace $w. let it go, bestie 🫢
  • gsl_sum_levin_u_accel($array, $array_size, $w) β€” takes the terms of a series in the array reference $array of size $array_size and computes the extrapolated limit of the series using a Levin u-transform. Additional working space must be provided in $w. The function returns multiple values in this order : 0 if the operation succeeded, 1 otherwise, the extrapolated sum and an estimate of the absolute error. The actual term-by-term sum is returned in $w->{sum_plain}. The algorithm calculates the truncation error (the difference between two successive extrapolations) and round-off error (propagated from the individual terms) to choose an optimal number of terms for the extrapolation. All the terms of the series passed in through array should be non-zero. πŸ‘‘ okay so that last bit is real: non-zero terms only, the algorithm does not want to deal with your zeroes.
  • gsl_sum_levin_u_minmax β€” 🌈
  • gsl_sum_levin_u_step β€” 🌈
  • gsl_sum_levin_utrunc_alloc($n) β€” allocates a workspace for a Levin u-transform of $n terms, without error estimation. the no-frills version, she's low maintenance πŸ’…
  • gsl_sum_levin_utrunc_free($w) β€” this function frees the memory associated with the workspace $w. yes, again. free your stuff. 😭
  • gsl_sum_levin_utrunc_accel($array, $array_size, $w) β€” takes the terms of a series in the array reference $array of size $array_size and computes the extrapolated limit of the series using a Levin u-transform. Additional working space must be provided in $w. The function returns multiple values in this order : 0 if the operation succeeded, 1 otherwise, the extrapolated sum and an estimate of the error. The actual term-by-term sum is returned in $w->{sum_plain}. The algorithm terminates when the difference between two successive extrapolations reaches a minimum or is sufficiently small. To improve the reliability of the algorithm the extrapolated values are replaced by moving averages when calculating the truncation error, smoothing out any fluctuations. 🧚 so cute, she smooths out her own fluctuations.
  • gsl_sum_levin_utrunc_minmax β€” ⭐
  • gsl_sum_levin_utrunc_step β€” ⭐

πŸ’œ AUTHORS πŸ’œ

Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com> β€” icons, honestly 🌟


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. πŸ“œ periodt.


ok bestie that's the whole page, and this cutie was brought to you by perl v5.42.3, dated 2026-08-20, filed under Math::GSL::Sum(3pm). go forth and converge πŸ’– ✨ πŸ¦‹

πŸ“¦ where this page comes from