  For large $N$, we consider the ordinary continued fraction of $x=p/q$ with
$1\le p\le q\le N$, or, equivalently, Euclid's gcd algorithm for two integers
$1\le p\le q\le N$, putting the uniform distribution on the set of $p$ and
$q$s. We study the distribution of the total cost of execution of the algorithm
for an additive cost function $c$ on the set $\mathbb{Z}_+^*$ of possible
digits, asymptotically for $N\to\infty$. If $c$ is nonlattice and satisfies
mild growth conditions, the local limit theorem was proved previously by the
second named author. Introducing diophantine conditions on the cost, we are
able to control the speed of convergence in the local limit theorem. We use
previous estimates of the first author and Vall\'{e}e, and we adapt to our
setting bounds of Dolgopyat and Melbourne on transfer operators. Our
diophantine condition is generic (with respect to Lebesgue measure). For smooth
enough observables (depending on the diophantine condition) we attain the
optimal speed.
