FLINT3.7.0-dev

mag_d_log_upper_bound, mag_d_log_lower_bound

Synopsis#include <flint/mag.h>
double mag_d_log_upper_bound(double x)source
double mag_d_log_lower_bound(double x)source

Return an upper, respectively lower, bound for \log x as a double, for x > 0 (with \log 0 = -\infty).

These are the building blocks of the logarithm and exponential bounds. They do not call the libm logarithm, whose error is not specified by any standard, but evaluate \log x = n \log 2 + \log(m/32) + \log(1 + v) with a 32-entry table and a short series, which has an error of at most 10 units in the last place, and then multiply by 1 \pm 10^{-14}. The bounds are valid even if the floating-point operations are not correctly rounded, as long as each has error at most about one unit in the last place.

Cite this page

The FLINT team, “mag_d_log_upper_bound, mag_d_log_lower_bound (mag.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mag/mag_d_log_upper_bound.html (generated 2026-10-20).