NASA showing incorrect distance to Mercury? I am currently working on an algorithm to compute planetary positions using Kepler's law. As I was testing it against the ephemeride service supplied by https://ssd.jpl.nasa.gov/horizons.cgi, I found the true anomaly to be correct, however the distance was off by 1%, so I wonder if there is something wrong with the  distance supplied by the service, or if I computed the distance incorrectly?
The values are concerned with Mercury on Jan 1 2000, 00:00.
To get the orbital elements, you enter the following settings:
Ephemeris type: ELEMENTS
Target body: Mercury
Coordinate origin: 10 (this is the body ID of the sun, which will be the   coordinate center)
Time Span:      Start=2000-01-01 00:00, Stop=2000-01-01 01:00, Step=1
Table settings: default
Display/output: default
The result shows that on the given time (Jan 1 2000 00:00), the elements was as follows:
true anomaly: 1.751155303115542E+02 (degrees)
semi-major axis: 3.870982252717257E-01 (AU)
eccentricity:  2.056302512089075E-01 
If you use these three values to compute the distance $r$, using the formula
$$r=\frac{a(1-e^2)}{1 + e\cdot\cos(v)}$$
where $a$ is the semi-major axis, $e$ is eccentricity and $v$ is true anomaly, you get a result of about 0.466 AU.
But if you instead request the distance from the site by changing ephemeris type from ELEMENTS to VECTORS, you get the distance (as indicated by value RG) to 0.47 AU.
I'm very confounded by this, and I hope someone can shine some light on this mystery. 
 A: It turns out that there are two different input forms for entering the major (central) body, one that shows coordinates and distances relative to the center of the major body, and one that shows them relative to a point on the surface of the major body. I unknowingly entered the sun as major body in the form that results in values relative to a point on the surface (on the sun in this case).
The senior analyst at JPL helped me solve the problem, and promised to increase the clarity of the input forms in the future. 
A: 
But if you instead request the distance from the site by changing ephemeris type from ELEMENTS to VECTORS, you get the distance (as indicated by value RG) to 0.47 AU.

Mercury has an aphelion of ~0.466697 AU.  A true anomaly of ~175 degrees corresponds to the planet being nearly at aphelion (~5 degrees would be near perihelion).  Meaning, at aphelion the value of $r$ in your equation should be ~0.47 AU.
The eccentricity1 of Mercury, $e$ ~ 0.2056, is very different from that of Earth, $e$ ~ 0.0167.  Thus, the perihelion and aphelion are going to be much more different than they are at Earth.  Remember, the $r$ is with respect to a focal point in an ellipse, not the center.  So when at apoapsis2, the value of $r$ will be larger than the semi-major axis for any ellipse.

...so I wonder if there is something wrong with the distance supplied by the service, or if I computed the distance incorrectly?

No, there is nothing wrong with the HORIZONS system at JPL and you did nothing wrong in your calculation.  I think you are confusing the location of the origin for the variable $r$.  It starts at one of the foci, not the center of the ellipse.
Notes 


*

*An eccentricity of zero is a circular orbit, whereas an eccentricty of 1 is a parabolic escape orbit and greater than 1 are hyperbolic orbits.

*The term aphelion only applies to orbits around the sun whereas apoapsis (or apsis) refer to general orbits about undefined bodies.

