.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Math::GSL::Sum 3pm" .TH Math::GSL::Sum 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Math::GSL::Sum \- Sum series with the Levin u\-transform .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& 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); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" These functions accelerate the convergence of a series using the Levin u\-transform. .IP \(bu 4 gsl_sum_levin_u_alloc($n) .Sp This function allocates a workspace for a Levin u\-transform of \f(CW$n\fR terms. .IP \(bu 4 gsl_sum_levin_u_free($w) .Sp \&\- This function frees the memory associated with the workspace \f(CW$w\fR. .IP \(bu 4 gsl_sum_levin_u_accel($array, \f(CW$array_size\fR, \f(CW$w\fR) .Sp This function takes the terms of a series in the array reference \f(CW$array\fR of size \&\f(CW$array_size\fR and computes the extrapolated limit of the series using a Levin u\-transform. Additional working space must be provided in \f(CW$w\fR. 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 \f(CW$w\fR\->{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. .IP \(bu 4 gsl_sum_levin_u_minmax .IP \(bu 4 gsl_sum_levin_u_step .IP \(bu 4 gsl_sum_levin_utrunc_alloc($n) .Sp This function allocates a workspace for a Levin u\-transform of \f(CW$n\fR terms, without error estimation. .IP \(bu 4 gsl_sum_levin_utrunc_free($w) .Sp This function frees the memory associated with the workspace \f(CW$w\fR. .IP \(bu 4 gsl_sum_levin_utrunc_accel($array, \f(CW$array_size\fR, \f(CW$w\fR) .Sp This function takes the terms of a series in the array reference \f(CW$array\fR of size \&\f(CW$array_size\fR and computes the extrapolated limit of the series using a Levin u\-transform. Additional working space must be provided in \f(CW$w\fR. 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 \f(CW$w\fR\->{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. .IP \(bu 4 gsl_sum_levin_utrunc_minmax .IP \(bu 4 gsl_sum_levin_utrunc_step .SH AUTHORS .IX Header "AUTHORS" Jonathan "Duke" Leto and Thierry Moisan .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2008\-2023 Jonathan "Duke" Leto and Thierry Moisan .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.