# Precision of logarithmic mesh

I'm trying to draw a nice three-dimensional diagram using PGFplots. Its Z axis should be logarithmic. Unfortunately when the values get to small, the precision isn't enough to get a smooth curve. Hope this MWE is ok...

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{ngerman}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
view={140}{20},
grid=major,
%
xlabel style={sloped},
xlabel={Bildschirmdiagonale $h$},
x dir=reverse,
%
ylabel style={sloped},
ylabel={Entfernung $d$},
%
zlabel={Raumwinkel $\Omega$},
zmode=log,
]
mesh,
domain=20:60,
y domain=2:20,
] { 4*pi/180*atan( ((12*x)*(22*x)) / (2*1000*y*sqrt(4*(1000*y)^2+(22*x)^2+(12*x)^2)) ) };
\end{axis}
\end{tikzpicture}

\end{document}

New contributor
Florian Strobel is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

What sometimes helps is to analytically manipulate the expressions. All I did was to divide numerator and denominator by 10, such that the (1000*y)^2 in the square root becomes (100*y)^2. This yields

\documentclass[a4paper,11pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
view={140}{20},
grid=major,
%
xlabel style={sloped},
xlabel={Bildschirmdiagonale $h$},
x dir=reverse,
%
ylabel style={sloped},
ylabel={Entfernung $d$},
%
zlabel={Raumwinkel $\Omega$},
zmode=log,
]