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$nterms. 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$arrayof size$array_sizeand 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 :0if the operation succeeded,1otherwise, 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$nterms, 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$arrayof size$array_sizeand 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 :0if the operation succeeded,1otherwise, 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 AND LICENSE π
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
- ubuntu stonking: libmath-gsl-perl 0.49-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms