After I discovered the fpu library for increased precision, I tried to make a plot involving large exponents. I choosed as an example a plot of the gravitational force of the moon on a test mass in SI-units.
How can I make the following code to handle the large exponents and get a reasonable plot automatically.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\newcommand{\td}[2]{\pgfmathsetmacro{#1}{#2}}
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci}
\begin{document}
\begin{tikzpicture}
\begin{axis}
%% Plot Gravitational force of the moon
\td{\mM}{7.36e22} % mass of the moon in kg
\td{\rM}{1.74e6} % radius of the moon in m
\td{\mK}{1}% test mass in kg
\td{\gG}{6.67e-11} % gravitational constant
\addplot[domain=0:10e6] gnuplot {\gG*\mK*\mM/(\rM + x)^2};
\end{axis}
\end{tikzpicture}
\end{document}
Obviously one could choose more reasonable units for the example above, but my point is how pgfplots (with or without gnuplot) can handle plots with such high exponents directly.

gnuplotby itself is perfectly fine with the numbers. – Rmano Jun 24 '16 at 08:23\pgfmathsetmacroto simply set values? Why don't you do\def\mM{7.36e22}instead of\td{\mM}{7.36e22}? Also, in conjunction with FPU,7.36e22is not a valid floating point format. – Henri Menke Jul 02 '16 at 12:52\def. I didn't have any specific reason to use\pgfmathsetmacroI just thought that this is the standard way to define numbers for pgf. – student Jul 02 '16 at 12:57\defwithout FPU. The problem is in thepgfplotsaxes. – Henri Menke Jul 02 '16 at 12:59