A classical fact in the weighted theory asserts that a weight w belongs to the Muckenhoupt class A_infty if and only if its logarithm log w is a function of bounded mean oscillation. We prove a sharp quantitative version of this fact in dimension one: for a weight w defined on some interval Jsubset mathbb {R}, we provide best lower and upper bounds for the BMO norm of log w in terms of A_infty characteristics of w. The proof rests on the precise evaluation of associated Bellman functions.