Math::...igFloat(3pm)
π Math::Prime::Util::ZetaBigFloat β bestie edition π
okay so quick lil intro: this is the manual for Math::Prime::Util::ZetaBigFloat, a Perl module, and it lives in the User Contributed Perl Documentation section (section 3pm, iykyk).
β¨ NAME β¨
Math::Prime::Util::ZetaBigFloat β the Perl Big Float versions of Riemann Zeta and R functions. that's the whole vibe. π
πΈ VERSION πΈ
Version 0.74, no cap.
π¦ SYNOPSIS π¦
These are the Math::BigFloat versions of the Riemann Zeta and Riemann R functions. They're kept in their own separate module on purpose β like, they drag in a whole bunch of big tables, and we'd really prefer to only load all of that if we actually need it. main character energy but make it lazy-loaded. π
β DESCRIPTION β
Pure Perl implementations of Riemann Zeta and Riemann R, using Math::BigFloat. These functions get used when:
- the input is a
BigInt, aBigFloat, or thebignummodule has been loaded, OR - the
Math::Prime::Util::GMPmodule isn't available, or is old.
if you use these functions a LOT, bestie, i am literally begging you β please installMath::Prime::Util::GMP, because the mainMath::Prime::Utilfunctions will find it on their own. it gives you much better performance and better accuracy too. you can also useMath::PariandMath::MPFRfor the Riemann Zeta function. π«Ά
π₯ FUNCTIONS π₯
π RiemannZeta
my $z = RiemannZeta($s);
Give it a floating point input s where s >= 0.5, and it hands you back the floating point value of ΞΆ(s)β1, where ΞΆ(s) is the Riemann zeta function. yes, we subtract one on purpose β that's so you get maximum precision for large values of s. the zeta function itself is the sum from k=1 to infinity of 1 / k^s, iconic formula, we love her. β¨
Results get calculated using either Borwein (1991) algorithm 2, or the basic series. it attempts full input accuracy, but ngl there are defects in Math::BigFloat with high accuracy computations that make this genuinely difficult. π
π RiemannR
my $r = RiemannR($x);
Give it a positive non-zero floating point input, and it returns the floating point value of Riemann's R function. Riemann's R function gives a very close approximation to the prime counting function. slay. π
Accuracy should be about 35 digits.
π LIMITATIONS π
Bugs in Math::BigFloat (RT 43692, RT 77105) cause many problems with this code. I've attempted to work around them, but it is possible there are cases they miss.
The accuracy goals (35 digits) are sometimes missed by a digit or two. tragic but true. π
π PERFORMANCE π
Performance is quite bad. like, genuinely. that's it, that's the whole section. π
π SEE ALSO π
Math::Prime::UtilMath::Prime::Util::GMPMath::MPFRMath::Pari
π AUTHORS π
Dana Jacobsen <dana@acm.org>
π COPYRIGHT π
Copyright 2012 by Dana Jacobsen <dana@acm.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page, you ate that fr fr π§ β this was perl v5.42.3, dated 2026-08-20. go forth and compute, bestie π
β¨
π¦ where this page comes from
- ubuntu stonking: libmath-prime-util-perl 0.74-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