Skip to main content
QUICK REVIEW

[Paper Review] A Robust Approximation to a Lambert-Type Function

K. Roberts|arXiv (Cornell University)|Apr 8, 2015
Sports Dynamics and BiomechanicsEngineering3 references8 citations
TL;DR

This paper presents a robust, language-agnostic algorithm for computing the function $ y = \log(W(e^x)) $, where $ W $ is the Lambert W function, using Halley's method with adaptive initial estimates. The method avoids numerical underflow/overflow and works reliably across all representable real $ x $, achieving high accuracy with just a few iterations.

ABSTRACT

The function $y = g(x) = \mathrm{log}\big(W(e^x)\big)$, where $W()$ denotes the Lambert W function, is the solution to the equation $y + e^y = x$. It appears in various problem situations, for instance the calculation of current-voltage curves for solar cells. A direct calculation of $g(x)$ may be inaccurate because of arithmetic underflow or overflow. We present a simple algorithm for calculating $g(x)$ that is robust, in that it will work for almost all $x$ values which are representable in the arithmetic of one's chosen computer language. The algorithm does not assume that the chosen computer language implements the Lambert W function.

Motivation & Objective

  • To address numerical instability in computing $ y = \log(W(e^x)) $ due to underflow or overflow in floating-point arithmetic.
  • To provide a reliable method for evaluating this function in any programming language lacking a native Lambert W function implementation.
  • To ensure high accuracy and stability across the entire real domain of $ x $, especially for extreme values.
  • To develop a computationally efficient and numerically robust algorithm suitable for applications such as solar cell modeling.

Proposed method

  • The function $ y = \log(W(e^x)) $ is reformulated as solving $ y + e^y = x $, which is solved iteratively using Halley’s method.
  • Initial estimates are chosen as $ y_0 = x $ for $ x \leq -e $, $ y_0 = \log(x) $ for $ x \geq e $, and linear interpolation for $ -e < x < e $.
  • Halley’s method is applied using the derivatives $ h'(y) = 1 + e^y $ and $ h''(y) = e^y $, with the iteration formula derived from the general Halley update.
  • The algorithm evaluates $ e^y $ once per iteration and uses a convergence criterion or fixed iteration count to ensure precision.
  • The method is designed to minimize cancellation errors, with the denominator in the update formula favoring stability due to dominance of the first term.
  • The approach is robust even for $ x $ values as large as $ \pm 10^6 $, achieving errors below $ 10^{-80} $ with four iterations.

Experimental results

Research questions

  • RQ1How can the function $ y = \log(W(e^x)) $ be computed robustly when direct evaluation risks underflow or overflow?
  • RQ2What initial estimate strategy ensures fast convergence of iterative solvers for this function across the entire real line?
  • RQ3Can Halley’s method be effectively applied to solve $ y + e^y = x $ with high accuracy and minimal computational cost?
  • RQ4How can the algorithm be implemented in any programming language without requiring a built-in Lambert W function?

Key findings

  • The algorithm achieves absolute error below $ 10^{-80} $ for $ x \in [-10^6, 10^6] $ using only four iterations of Halley’s method.
  • The function $ g(x) = \log(W(e^x)) $ is strictly increasing and concave, with behavior asymptotically approaching $ x $ for large negative $ x $ and $ \log(x) $ for large positive $ x $.
  • The method is numerically stable due to the contracting nature of $ g(x) $, where $ |g'(x)| \leq 1 $, minimizing sensitivity to input noise.
  • The use of Halley’s method ensures cubic convergence, enabling rapid refinement from a crude initial estimate.
  • The algorithm avoids cancellation issues in the denominator of the Halley update due to the dominance of the first term in the expression.
  • The method is applicable to real-world problems such as solar cell current-voltage modeling, where high-precision evaluation of $ \log(W(e^x)) $ is essential.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.