Let $Z (t)$ be the Hardy Z function. Then define \begin{equation} Y (t) = \tanh (\ln (1 + Z (t)^2)) \end{equation}
Let us define the length $L_n$ of the curve which intersects the $n$-th Zero of $Z (t)$ as a contour integral of the indicator function \begin{equation} \label{cont} L_n = \oint_{H_n} 1 d t \end{equation} where \begin{equation} H_n = \{ (t, s) : {Re} (Y (t + i s)) = 0 : H_n \cup \{ y_n \} = \{ y_n \} \} \end{equation} is the $n$-th set of points determining the curves where the real part of $Y$ vanishes and $y_n$ is the $n$-th real zero of the Hardy Z function ordered by ascending magnitude, independently of the Riemann hypothesis; which states that all of the roots lie on the real line. If there are roots of the zeta function off of the line, they will appear as complex roots of $Z (t)$ other than the trivial ones or the points where Z(t)=i*sqrt(2)
To calculate the value of the contour integral , the following algorithm is proposed:
a. Choose parameter $n$, the zero of the index;
b. Choose parameter $h$, the delta with which the integral will be calculated
Let $x_0 = y_n$ and ${L_n} = 0$
Determine angle $\theta_m \in \left[ 0, \frac{\pi}{2} \right]$ where \begin{equation} \label{angle} \theta_m = \left\{ a : {Re} (Y ({circle} (x_{m - 1}, h, a))) = 0, 0 < a < \frac{\pi}{2} \right\} \end{equation} when iterating from $x_{(m - 1)}$ to $x_m$ a step length of $h$ and angle $\theta_m (h)$ given by the circle with radius $h$ centered at $z$ defined by the formula \begin{equation} {circle} (z, h, \theta) = z + h (\cos (\theta) + i \sin (\theta)) \end{equation} where angle parameter $\theta$ varies from $0$ to $\pi$ and $z = t + i s$.
Set \begin{equation} x_m = {circle} (x_{m - 1}, h, \theta_m) \end{equation} and \begin{equation} {L_n} = {L_n} + h \end{equation} then $m$ represents the index of the $m$-th iterate of the Newton iteration $\theta_m (h) = \lim_{k \rightarrow \infty} N_{\theta_m} (a_k ; h)$ defined below.
If $x_m = y_n$ then terminate because the loop has reached its beginning point, and ${L_n}$ will be its length;
else set \begin{equation} m = m + 1 \end{equation} and goto Step 4.
In order to find an explicit expression for the angle $\theta_m (h)$ we can use Newton's method \begin{equation} \label{N} N_{\theta_m} (a_k ; h) = a_{k - 1} - \frac{Y ({circle} (x_m, h, a_{k - 1}))}{\frac{d}{da} Y ({circle} (x_m, h, a))_{|_{a = a_{k - 1}}}} \end{equation} so that \begin{equation} \theta_m = \theta_m (h) = \lim_{k \rightarrow \infty} N_{\theta_m} (a_k ; h) \end{equation} which is dependent on $h$, but the when the dependence is not written as $\theta_m (h)$ it is still implied. To calculate $\frac{d}{d a} Y ({circle} (x_m, h, a))_{|_{a = a_{k - 1}}}$ let \begin{equation} \rho_{} (h, a) = h (i \cos (a) - \sin (a)) \end{equation} and differentiate $Y (t)$ to get \begin{equation} \frac{d}{d t} Y (t) = \frac{d}{d t} \tanh (\ln (1 + Z (t)^2)) = \frac{8 (1 + Z (t)^2) Z (t) \frac{d}{d t} Z (t)}{(Z (t)^4 + 2 Z (t)^2 + 2)^2} \end{equation} then it can be seen that $\begin{array}{ll} \frac{d}{da} Y ({circle} (t, h, a)) & = \frac{d}{ da} Y (t + h e^{i \pi a})\\ & = \frac{d}{d a} \tanh (\ln (1 + Z (t + h e^{i \pi a})^2))\\ & = \frac{8 (1 + Y (t)^2) Y (t) }{(Y (t)^4 + 2 Y (t)^2 + 2)^2} \frac{d}{d t} Y (t) h e^{i \pi a}\\ & = \frac{8 (1 + Y (t)^2) Y (t) }{(Y (t)^4 + 2 Y (t)^2 + 2)^2} \frac{8 (1 + Z (t)^2) Z (t)}{(Z (t)^4 + 2 Z (t)^2 + 2)^2} \frac{d}{d t} Z (t) h e^{i \pi a}\\ & = i 8 \pi h \hspace{0.17em} \mathrm{e}^{i \pi a} Z (t) \frac{ (Z (t) + i) (Z (t) - i) }{(Z (t)^2 + 1 + i)^2 (Z (t)^2 + 1 - i)^2} \frac{d}{d t} Z (t) \end{array}$
and therefore the Newton iteration for the angle is expressed as \begin{equation} \begin{array}{ll} N_{\theta_m} (t, a_k ; h) & = a_{k - 1} - \frac{Y (t)}{\frac{8 (1 + Y (t)^2) Y (t) }{(Y (t)^4 + 2 Y (t)^2 + 2)^2} \frac{d}{d t} Y (t) \rho_{} (h, a_{k - 1}) )}\\ & = a_{k - 1} - \frac{Y (t)}{\frac{8 (1 + Y (t)^2) Y (t) }{(Y (t)^4 + 2 Y (t)^2 + 2)^2} \frac{8 (1 + Z (t)^2) Z (t) \frac{d}{d t} Z (t)}{(Z (t)^4 + 2 Z (t)^2 + 2)^2} \rho_{} (h, a_{k - 1}) )} \end{array} \end{equation} by the change-of-variables \begin{equation} \begin{array}{ll} t \rightarrow & {circle} (x_m, h, a_{k - 1})\\ & = x_m + \rho (h, a_{k - 1})\\ & = x_m + h (\cos (a_{k - 1}) + i \sin (a_{k - 1})) \end{array} \end{equation}
The set $H_1$ is black depicted as the boundary of the 1st hour-glass figure in this plot of the Real part of Y over -12..27 and imaginary part -3..3 . The values of the real part of $Y$ have opposite signs inside and outside of the sets defined by the union of the curves $H_n$. Here $H_n$ is the Julia set of some dynamical system.
My question: Is there a better or different way of calculating the length of these curves?
Maple code to calculate the length at
https://github.com/crowlogic/Y/blob/master/tracecurve.mpl
The first top-half curve length is 4.263.. The second is 2.982...
Real part of Y from Re=12..27 and Im=-3..3

Imag part of Y from Re=12..27 and Im=-3..3
Complex plot of Y from Re=12..27 and Im=-3..3
The sign of the argument of Y which gets very small is shown here:
See https://gist.githubusercontent.com/crowlogic/027ea86b58b0fabf8e99d25a685d9196/raw/d55bbc5c866c185b106b44e84d39b6a37f24bb95/maple%2520tracecurve%2520log.txt for the maple script output

