R numerical software hypergeo2 0.2.1 fixes Windows builds with Boost 1.90
The November 28 release changes a C++ header used for Windows builds and updates the documentation for its adjustable precision calculations.
A source release for Windows compatibility
The R package hypergeo2 reached version 0.2.1 on CRAN on November 28 at 14:00:02 UTC, or 17:00:02 in Istanbul. Maintainer Xiurui Zhu’s release note documents a modified zeta.hpp header that permits Windows builds with Boost 1.90. The release also updates documentation. CRANberries independently compares the archive with 0.2.0. The package computes generalised hypergeometric functions for real inputs. Its R and C++ interfaces depend on compiled code, which makes the source build change relevant to Windows users who install from the archive.
Internal precision and returned values
The genhypergeo interface takes upper and lower parameters and a real argument. The prec setting controls the arithmetic used while evaluating the function. The documentation says the R result is still a double precision numeric vector, even when the internal arithmetic uses higher precision. Extra internal precision can help if large terms with opposite signs cancel, leaving a small result. Keep the requested precision alongside the returned values and the input parameters when comparing two runs.
Comparing MPFR and GMP
The help page identifies MPFR as the default backend and GMP as an alternative. The precision can vary per element in a vectorised call, while the backend is selected for the whole call. Compare backends in separate calls with the same input. The documentation includes an example that may show cancellation with default precision on some platforms before running the calculation at higher precision. Record warnings, arithmetic settings and any independent reference value when judging the output.
Where the Windows build uses the change
The source distribution requires compilation and its Windows Makevars identifies local include paths and links to MPFR and GMP. The release specifically ties the modified zeta.hpp header to Windows builds with Boost 1.90. The publication date confirms the source release. A specific Windows machine can still have a different compiler or installed R toolchain. When reviewing a failed build, record the compiler, the archive used and whether the install was using a binary or compiling the source.
Check the install and the arithmetic separately
After the package installs, start with a small example with a known value or the one in the package help. Run a cancellation-sensitive example at default internal precision and again with settings of 20 and 25 decimal digits. Compare the resulting values, reporting warnings and the expected tolerance. Near zero, an absolute and a relative error threshold can behave differently. Store the build details with the numerical result so that another developer can repeat both checks on Windows. At a zero argument, for parameters where the series is defined, its constant term gives an expected value of one.
Archive photo · Empetrisor / Wikimedia Commons ↗ · CC BY-SA 4.0 · Illustrative zeta plot referring to the changed C++ header. The R package works with real inputs. Resized and converted to WebP.
Sources and verification
- Primary sourceCRAN ↗
- Reporting / cross-checkCRANberries ↗
- BackgroundNIST Digital Library of Mathematical Functions ↗
Reader discussion
Which bottleneck would you expect as this solution scales?
No comments yet. Be the first to contribute.
Write a comment