(/ (- 1 (cos (* -2 (atan (* (/ z1 z2) (tan (* PI (- (+ z0 z0) -1/2)))))))) (* (+ z1 z1) z1))

Percentage Accurate: 56.7% → 87.0%
Time: 8.3s
Alternatives: 10
Speedup: 1.4×

Specification

?
\[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (/
 (-
  1.0
  (cos (* -2.0 (atan (* (/ z1 z2) (tan (* PI (- (+ z0 z0) -0.5))))))))
 (* (+ z1 z1) z1)))
double code(double z1, double z2, double z0) {
	return (1.0 - cos((-2.0 * atan(((z1 / z2) * tan((((double) M_PI) * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1);
}
public static double code(double z1, double z2, double z0) {
	return (1.0 - Math.cos((-2.0 * Math.atan(((z1 / z2) * Math.tan((Math.PI * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1);
}
def code(z1, z2, z0):
	return (1.0 - math.cos((-2.0 * math.atan(((z1 / z2) * math.tan((math.pi * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1)
function code(z1, z2, z0)
	return Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(Float64(z1 / z2) * tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5)))))))) / Float64(Float64(z1 + z1) * z1))
end
function tmp = code(z1, z2, z0)
	tmp = (1.0 - cos((-2.0 * atan(((z1 / z2) * tan((pi * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1);
end
code[z1_, z2_, z0_] := N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(N[(z1 / z2), $MachinePrecision] * N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]
\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 56.7% accurate, 1.0× speedup?

\[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (/
 (-
  1.0
  (cos (* -2.0 (atan (* (/ z1 z2) (tan (* PI (- (+ z0 z0) -0.5))))))))
 (* (+ z1 z1) z1)))
double code(double z1, double z2, double z0) {
	return (1.0 - cos((-2.0 * atan(((z1 / z2) * tan((((double) M_PI) * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1);
}
public static double code(double z1, double z2, double z0) {
	return (1.0 - Math.cos((-2.0 * Math.atan(((z1 / z2) * Math.tan((Math.PI * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1);
}
def code(z1, z2, z0):
	return (1.0 - math.cos((-2.0 * math.atan(((z1 / z2) * math.tan((math.pi * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1)
function code(z1, z2, z0)
	return Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(Float64(z1 / z2) * tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5)))))))) / Float64(Float64(z1 + z1) * z1))
end
function tmp = code(z1, z2, z0)
	tmp = (1.0 - cos((-2.0 * atan(((z1 / z2) * tan((pi * ((z0 + z0) - -0.5)))))))) / ((z1 + z1) * z1);
end
code[z1_, z2_, z0_] := N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(N[(z1 / z2), $MachinePrecision] * N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]
\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}

Alternative 1: 87.0% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := \left|z1\right| + \left|z1\right|\\ \mathbf{if}\;\left|z1\right| \leq 2.4 \cdot 10^{-157}:\\ \;\;\;\;\frac{\frac{0.5}{\left|z1\right| \cdot \left|z1\right|} \cdot \left|z1\right| - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{\left|z1\right|}{z2}\right)\right)}{t\_0}}{\left|z1\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + 0.6666666666666666 \cdot \left({z0}^{2} \cdot {\pi}^{4}\right)\right)\right) \cdot \left|z1\right|}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{t\_0 \cdot \left|z1\right|}\\ \end{array} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (let* ((t_0 (+ (fabs z1) (fabs z1))))
  (if (<= (fabs z1) 2.4e-157)
    (/
     (-
      (* (/ 0.5 (* (fabs z1) (fabs z1))) (fabs z1))
      (/
       (cos (* 2.0 (atan (* (tan (* 0.5 PI)) (/ (fabs z1) z2)))))
       t_0))
     (fabs z1))
    (/
     (-
      1.0
      (cos
       (*
        -2.0
        (atan
         (/
          (*
           (+
            1.0
            (*
             (pow z0 2.0)
             (+
              (* -2.0 (pow PI 2.0))
              (* 0.6666666666666666 (* (pow z0 2.0) (pow PI 4.0))))))
           (fabs z1))
          (* (- (sin (* (+ z0 z0) PI))) z2))))))
     (* t_0 (fabs z1))))))
double code(double z1, double z2, double z0) {
	double t_0 = fabs(z1) + fabs(z1);
	double tmp;
	if (fabs(z1) <= 2.4e-157) {
		tmp = (((0.5 / (fabs(z1) * fabs(z1))) * fabs(z1)) - (cos((2.0 * atan((tan((0.5 * ((double) M_PI))) * (fabs(z1) / z2))))) / t_0)) / fabs(z1);
	} else {
		tmp = (1.0 - cos((-2.0 * atan((((1.0 + (pow(z0, 2.0) * ((-2.0 * pow(((double) M_PI), 2.0)) + (0.6666666666666666 * (pow(z0, 2.0) * pow(((double) M_PI), 4.0)))))) * fabs(z1)) / (-sin(((z0 + z0) * ((double) M_PI))) * z2)))))) / (t_0 * fabs(z1));
	}
	return tmp;
}
public static double code(double z1, double z2, double z0) {
	double t_0 = Math.abs(z1) + Math.abs(z1);
	double tmp;
	if (Math.abs(z1) <= 2.4e-157) {
		tmp = (((0.5 / (Math.abs(z1) * Math.abs(z1))) * Math.abs(z1)) - (Math.cos((2.0 * Math.atan((Math.tan((0.5 * Math.PI)) * (Math.abs(z1) / z2))))) / t_0)) / Math.abs(z1);
	} else {
		tmp = (1.0 - Math.cos((-2.0 * Math.atan((((1.0 + (Math.pow(z0, 2.0) * ((-2.0 * Math.pow(Math.PI, 2.0)) + (0.6666666666666666 * (Math.pow(z0, 2.0) * Math.pow(Math.PI, 4.0)))))) * Math.abs(z1)) / (-Math.sin(((z0 + z0) * Math.PI)) * z2)))))) / (t_0 * Math.abs(z1));
	}
	return tmp;
}
def code(z1, z2, z0):
	t_0 = math.fabs(z1) + math.fabs(z1)
	tmp = 0
	if math.fabs(z1) <= 2.4e-157:
		tmp = (((0.5 / (math.fabs(z1) * math.fabs(z1))) * math.fabs(z1)) - (math.cos((2.0 * math.atan((math.tan((0.5 * math.pi)) * (math.fabs(z1) / z2))))) / t_0)) / math.fabs(z1)
	else:
		tmp = (1.0 - math.cos((-2.0 * math.atan((((1.0 + (math.pow(z0, 2.0) * ((-2.0 * math.pow(math.pi, 2.0)) + (0.6666666666666666 * (math.pow(z0, 2.0) * math.pow(math.pi, 4.0)))))) * math.fabs(z1)) / (-math.sin(((z0 + z0) * math.pi)) * z2)))))) / (t_0 * math.fabs(z1))
	return tmp
function code(z1, z2, z0)
	t_0 = Float64(abs(z1) + abs(z1))
	tmp = 0.0
	if (abs(z1) <= 2.4e-157)
		tmp = Float64(Float64(Float64(Float64(0.5 / Float64(abs(z1) * abs(z1))) * abs(z1)) - Float64(cos(Float64(2.0 * atan(Float64(tan(Float64(0.5 * pi)) * Float64(abs(z1) / z2))))) / t_0)) / abs(z1));
	else
		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(Float64(Float64(1.0 + Float64((z0 ^ 2.0) * Float64(Float64(-2.0 * (pi ^ 2.0)) + Float64(0.6666666666666666 * Float64((z0 ^ 2.0) * (pi ^ 4.0)))))) * abs(z1)) / Float64(Float64(-sin(Float64(Float64(z0 + z0) * pi))) * z2)))))) / Float64(t_0 * abs(z1)));
	end
	return tmp
end
function tmp_2 = code(z1, z2, z0)
	t_0 = abs(z1) + abs(z1);
	tmp = 0.0;
	if (abs(z1) <= 2.4e-157)
		tmp = (((0.5 / (abs(z1) * abs(z1))) * abs(z1)) - (cos((2.0 * atan((tan((0.5 * pi)) * (abs(z1) / z2))))) / t_0)) / abs(z1);
	else
		tmp = (1.0 - cos((-2.0 * atan((((1.0 + ((z0 ^ 2.0) * ((-2.0 * (pi ^ 2.0)) + (0.6666666666666666 * ((z0 ^ 2.0) * (pi ^ 4.0)))))) * abs(z1)) / (-sin(((z0 + z0) * pi)) * z2)))))) / (t_0 * abs(z1));
	end
	tmp_2 = tmp;
end
code[z1_, z2_, z0_] := Block[{t$95$0 = N[(N[Abs[z1], $MachinePrecision] + N[Abs[z1], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[z1], $MachinePrecision], 2.4e-157], N[(N[(N[(N[(0.5 / N[(N[Abs[z1], $MachinePrecision] * N[Abs[z1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[z1], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[N[(2.0 * N[ArcTan[N[(N[Tan[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[Abs[z1], $MachinePrecision] / z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[Abs[z1], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(N[(N[(1.0 + N[(N[Power[z0, 2.0], $MachinePrecision] * N[(N[(-2.0 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(0.6666666666666666 * N[(N[Power[z0, 2.0], $MachinePrecision] * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[z1], $MachinePrecision]), $MachinePrecision] / N[((-N[Sin[N[(N[(z0 + z0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]) * z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[Abs[z1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|z1\right| + \left|z1\right|\\
\mathbf{if}\;\left|z1\right| \leq 2.4 \cdot 10^{-157}:\\
\;\;\;\;\frac{\frac{0.5}{\left|z1\right| \cdot \left|z1\right|} \cdot \left|z1\right| - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{\left|z1\right|}{z2}\right)\right)}{t\_0}}{\left|z1\right|}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + 0.6666666666666666 \cdot \left({z0}^{2} \cdot {\pi}^{4}\right)\right)\right) \cdot \left|z1\right|}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{t\_0 \cdot \left|z1\right|}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z1 < 2.4e-157

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      6. sub-to-fractionN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    3. Applied rewrites70.3%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \color{blue}{\left(\frac{1}{2} \cdot \pi\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{2}}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      2. lower-PI.f6471.0%

        \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    6. Applied rewrites71.0%

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \color{blue}{\left(0.5 \cdot \pi\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]

    if 2.4e-157 < z1

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lift-tan.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. tan-quotN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. frac-timesN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    3. Applied rewrites64.6%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\color{blue}{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\pi}^{4}\right)\right)\right)} \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    5. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + \color{blue}{{z0}^{2} \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)}\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \color{blue}{\left(-2 \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)}\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lower-pow.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(\color{blue}{-2 \cdot {\mathsf{PI}\left(\right)}^{2}} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. lower-+.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2} + \color{blue}{\frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)}\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2} + \color{blue}{\frac{2}{3}} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      6. lower-pow.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      7. lower-PI.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + \frac{2}{3} \cdot \color{blue}{\left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{4}\right)}\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{4}}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\color{blue}{\mathsf{PI}\left(\right)}}^{4}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      11. lower-pow.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + \frac{2}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{4}}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      12. lower-PI.f6483.8%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + 0.6666666666666666 \cdot \left({z0}^{2} \cdot {\pi}^{4}\right)\right)\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    6. Applied rewrites83.8%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{\color{blue}{\left(1 + {z0}^{2} \cdot \left(-2 \cdot {\pi}^{2} + 0.6666666666666666 \cdot \left({z0}^{2} \cdot {\pi}^{4}\right)\right)\right)} \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 86.4% accurate, 0.6× speedup?

\[\begin{array}{l} t_0 := \left(z0 + z0\right) \cdot \pi\\ \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 200:\\ \;\;\;\;\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \infty\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{0.5}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \left(-\tan^{-1} \left(\frac{\cos t\_0 \cdot z1}{\sin t\_0 \cdot z2}\right)\right)\right)}{z1 + z1}}{z1}\\ \end{array} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (let* ((t_0 (* (+ z0 z0) PI)))
  (if (<= (tan (* PI (- (+ z0 z0) -0.5))) 200.0)
    (/
     (-
      (* (/ 0.5 (* z1 z1)) z1)
      (/
       (cos
        (*
         2.0
         (atan
          (/
           (*
            (-
             (* (* 2.0 (+ PI (* (* INFINITY INFINITY) PI))) z0)
             (tan (* PI -0.5)))
            z1)
           z2))))
       (+ z1 z1)))
     z1)
    (/
     (-
      (* (/ (/ 0.5 z1) z1) z1)
      (/
       (cos (* 2.0 (- (atan (/ (* (cos t_0) z1) (* (sin t_0) z2))))))
       (+ z1 z1)))
     z1))))
double code(double z1, double z2, double z0) {
	double t_0 = (z0 + z0) * ((double) M_PI);
	double tmp;
	if (tan((((double) M_PI) * ((z0 + z0) - -0.5))) <= 200.0) {
		tmp = (((0.5 / (z1 * z1)) * z1) - (cos((2.0 * atan((((((2.0 * (((double) M_PI) + ((((double) INFINITY) * ((double) INFINITY)) * ((double) M_PI)))) * z0) - tan((((double) M_PI) * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1;
	} else {
		tmp = ((((0.5 / z1) / z1) * z1) - (cos((2.0 * -atan(((cos(t_0) * z1) / (sin(t_0) * z2))))) / (z1 + z1))) / z1;
	}
	return tmp;
}
public static double code(double z1, double z2, double z0) {
	double t_0 = (z0 + z0) * Math.PI;
	double tmp;
	if (Math.tan((Math.PI * ((z0 + z0) - -0.5))) <= 200.0) {
		tmp = (((0.5 / (z1 * z1)) * z1) - (Math.cos((2.0 * Math.atan((((((2.0 * (Math.PI + ((Double.POSITIVE_INFINITY * Double.POSITIVE_INFINITY) * Math.PI))) * z0) - Math.tan((Math.PI * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1;
	} else {
		tmp = ((((0.5 / z1) / z1) * z1) - (Math.cos((2.0 * -Math.atan(((Math.cos(t_0) * z1) / (Math.sin(t_0) * z2))))) / (z1 + z1))) / z1;
	}
	return tmp;
}
def code(z1, z2, z0):
	t_0 = (z0 + z0) * math.pi
	tmp = 0
	if math.tan((math.pi * ((z0 + z0) - -0.5))) <= 200.0:
		tmp = (((0.5 / (z1 * z1)) * z1) - (math.cos((2.0 * math.atan((((((2.0 * (math.pi + ((math.inf * math.inf) * math.pi))) * z0) - math.tan((math.pi * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1
	else:
		tmp = ((((0.5 / z1) / z1) * z1) - (math.cos((2.0 * -math.atan(((math.cos(t_0) * z1) / (math.sin(t_0) * z2))))) / (z1 + z1))) / z1
	return tmp
function code(z1, z2, z0)
	t_0 = Float64(Float64(z0 + z0) * pi)
	tmp = 0.0
	if (tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5))) <= 200.0)
		tmp = Float64(Float64(Float64(Float64(0.5 / Float64(z1 * z1)) * z1) - Float64(cos(Float64(2.0 * atan(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(pi + Float64(Float64(Inf * Inf) * pi))) * z0) - tan(Float64(pi * -0.5))) * z1) / z2)))) / Float64(z1 + z1))) / z1);
	else
		tmp = Float64(Float64(Float64(Float64(Float64(0.5 / z1) / z1) * z1) - Float64(cos(Float64(2.0 * Float64(-atan(Float64(Float64(cos(t_0) * z1) / Float64(sin(t_0) * z2)))))) / Float64(z1 + z1))) / z1);
	end
	return tmp
end
function tmp_2 = code(z1, z2, z0)
	t_0 = (z0 + z0) * pi;
	tmp = 0.0;
	if (tan((pi * ((z0 + z0) - -0.5))) <= 200.0)
		tmp = (((0.5 / (z1 * z1)) * z1) - (cos((2.0 * atan((((((2.0 * (pi + ((Inf * Inf) * pi))) * z0) - tan((pi * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1;
	else
		tmp = ((((0.5 / z1) / z1) * z1) - (cos((2.0 * -atan(((cos(t_0) * z1) / (sin(t_0) * z2))))) / (z1 + z1))) / z1;
	end
	tmp_2 = tmp;
end
code[z1_, z2_, z0_] := Block[{t$95$0 = N[(N[(z0 + z0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 200.0], N[(N[(N[(N[(0.5 / N[(z1 * z1), $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision] - N[(N[Cos[N[(2.0 * N[ArcTan[N[(N[(N[(N[(N[(2.0 * N[(Pi + N[(N[(Infinity * Infinity), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z0), $MachinePrecision] - N[Tan[N[(Pi * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision] / z2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(N[(N[(N[(N[(0.5 / z1), $MachinePrecision] / z1), $MachinePrecision] * z1), $MachinePrecision] - N[(N[Cos[N[(2.0 * (-N[ArcTan[N[(N[(N[Cos[t$95$0], $MachinePrecision] * z1), $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(z0 + z0\right) \cdot \pi\\
\mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 200:\\
\;\;\;\;\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \infty\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{0.5}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \left(-\tan^{-1} \left(\frac{\cos t\_0 \cdot z1}{\sin t\_0 \cdot z2}\right)\right)\right)}{z1 + z1}}{z1}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 200

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      6. sub-to-fractionN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    3. Applied rewrites70.3%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\color{blue}{\left(z0 \cdot \left(2 \cdot \pi - -2 \cdot \frac{\pi \cdot {\sin \left(\frac{1}{2} \cdot \pi\right)}^{2}}{{\cos \left(\frac{1}{2} \cdot \pi\right)}^{2}}\right) + \frac{\sin \left(\frac{1}{2} \cdot \pi\right)}{\cos \left(\frac{1}{2} \cdot \pi\right)}\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    5. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{2}}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\left(z0 \cdot \left(2 \cdot \mathsf{PI}\left(\right) - -2 \cdot \frac{\mathsf{PI}\left(\right) \cdot {\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}}{{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}}\right) + \color{blue}{\frac{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}}\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    6. Applied rewrites76.4%

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\color{blue}{\left(z0 \cdot \left(2 \cdot \pi - -2 \cdot \frac{\pi \cdot {\sin \left(0.5 \cdot \pi\right)}^{2}}{{\cos \left(0.5 \cdot \pi\right)}^{2}}\right) + \frac{\sin \left(0.5 \cdot \pi\right)}{\cos \left(0.5 \cdot \pi\right)}\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    7. Applied rewrites77.1%

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \color{blue}{\left(\frac{\left(\left(2 \cdot \left(\pi + \left(\tan \left(\pi \cdot 0.5\right) \cdot \tan \left(\pi \cdot 0.5\right)\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)}\right)}{z1 + z1}}{z1} \]
    8. Evaluated real constant85.6%

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \tan \left(\pi \cdot 0.5\right)\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    9. Evaluated real constant85.6%

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \infty\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1} \]

    if 200 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      6. sub-to-fractionN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    3. Applied rewrites70.3%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{z1 \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{2}}{\color{blue}{z1 \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      3. associate-/r*N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{2}}{z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      4. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{2}}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      5. associate-/r*N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{2 \cdot z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      6. count-2N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      8. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{z1 + z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      9. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      10. count-2N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{2 \cdot z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{\frac{1}{2}}{z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{2}}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      13. lower-/.f6470.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{0.5}{z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    5. Applied rewrites70.9%

      \[\leadsto \frac{\color{blue}{\frac{\frac{0.5}{z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    6. Step-by-step derivation
      1. lift-atan.f64N/A

        \[\leadsto \frac{\frac{\frac{\frac{1}{2}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \color{blue}{\tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)}\right)}{z1 + z1}}{z1} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\frac{1}{2}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \color{blue}{\left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)}\right)}{z1 + z1}}{z1} \]
    7. Applied rewrites76.3%

      \[\leadsto \frac{\frac{\frac{0.5}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \color{blue}{\left(-\tan^{-1} \left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\sin \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z2}\right)\right)}\right)}{z1 + z1}}{z1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 85.6% accurate, 0.9× speedup?

\[\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \infty\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (/
 (-
  (* (/ 0.5 (* z1 z1)) z1)
  (/
   (cos
    (*
     2.0
     (atan
      (/
       (*
        (-
         (* (* 2.0 (+ PI (* (* INFINITY INFINITY) PI))) z0)
         (tan (* PI -0.5)))
        z1)
       z2))))
   (+ z1 z1)))
 z1))
double code(double z1, double z2, double z0) {
	return (((0.5 / (z1 * z1)) * z1) - (cos((2.0 * atan((((((2.0 * (((double) M_PI) + ((((double) INFINITY) * ((double) INFINITY)) * ((double) M_PI)))) * z0) - tan((((double) M_PI) * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1;
}
public static double code(double z1, double z2, double z0) {
	return (((0.5 / (z1 * z1)) * z1) - (Math.cos((2.0 * Math.atan((((((2.0 * (Math.PI + ((Double.POSITIVE_INFINITY * Double.POSITIVE_INFINITY) * Math.PI))) * z0) - Math.tan((Math.PI * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1;
}
def code(z1, z2, z0):
	return (((0.5 / (z1 * z1)) * z1) - (math.cos((2.0 * math.atan((((((2.0 * (math.pi + ((math.inf * math.inf) * math.pi))) * z0) - math.tan((math.pi * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1
function code(z1, z2, z0)
	return Float64(Float64(Float64(Float64(0.5 / Float64(z1 * z1)) * z1) - Float64(cos(Float64(2.0 * atan(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(pi + Float64(Float64(Inf * Inf) * pi))) * z0) - tan(Float64(pi * -0.5))) * z1) / z2)))) / Float64(z1 + z1))) / z1)
end
function tmp = code(z1, z2, z0)
	tmp = (((0.5 / (z1 * z1)) * z1) - (cos((2.0 * atan((((((2.0 * (pi + ((Inf * Inf) * pi))) * z0) - tan((pi * -0.5))) * z1) / z2)))) / (z1 + z1))) / z1;
end
code[z1_, z2_, z0_] := N[(N[(N[(N[(0.5 / N[(z1 * z1), $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision] - N[(N[Cos[N[(2.0 * N[ArcTan[N[(N[(N[(N[(N[(2.0 * N[(Pi + N[(N[(Infinity * Infinity), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z0), $MachinePrecision] - N[Tan[N[(Pi * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision] / z2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]
\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \infty\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1}
Derivation
  1. Initial program 56.7%

    \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
    2. lift--.f64N/A

      \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
    3. div-subN/A

      \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
    4. lift-*.f64N/A

      \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
    5. associate-/r*N/A

      \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    6. sub-to-fractionN/A

      \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
  3. Applied rewrites70.3%

    \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
  4. Taylor expanded in z0 around 0

    \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\color{blue}{\left(z0 \cdot \left(2 \cdot \pi - -2 \cdot \frac{\pi \cdot {\sin \left(\frac{1}{2} \cdot \pi\right)}^{2}}{{\cos \left(\frac{1}{2} \cdot \pi\right)}^{2}}\right) + \frac{\sin \left(\frac{1}{2} \cdot \pi\right)}{\cos \left(\frac{1}{2} \cdot \pi\right)}\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
  5. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto \frac{\frac{\frac{1}{2}}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\left(z0 \cdot \left(2 \cdot \mathsf{PI}\left(\right) - -2 \cdot \frac{\mathsf{PI}\left(\right) \cdot {\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}}{{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}}\right) + \color{blue}{\frac{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}}\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
  6. Applied rewrites76.4%

    \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\color{blue}{\left(z0 \cdot \left(2 \cdot \pi - -2 \cdot \frac{\pi \cdot {\sin \left(0.5 \cdot \pi\right)}^{2}}{{\cos \left(0.5 \cdot \pi\right)}^{2}}\right) + \frac{\sin \left(0.5 \cdot \pi\right)}{\cos \left(0.5 \cdot \pi\right)}\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
  7. Applied rewrites77.1%

    \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \color{blue}{\left(\frac{\left(\left(2 \cdot \left(\pi + \left(\tan \left(\pi \cdot 0.5\right) \cdot \tan \left(\pi \cdot 0.5\right)\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)}\right)}{z1 + z1}}{z1} \]
  8. Evaluated real constant85.6%

    \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \tan \left(\pi \cdot 0.5\right)\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
  9. Evaluated real constant85.6%

    \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\frac{\left(\left(2 \cdot \left(\pi + \left(\infty \cdot \infty\right) \cdot \pi\right)\right) \cdot z0 - \tan \left(\pi \cdot -0.5\right)\right) \cdot z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
  10. Add Preprocessing

Alternative 4: 75.2% accurate, 0.7× speedup?

\[\begin{array}{l} t_0 := \left(z0 + z0\right) - -0.5\\ \mathbf{if}\;\tan \left(\pi \cdot t\_0\right) \leq 20000000000:\\ \;\;\;\;\frac{\left(\frac{1}{z1} \cdot \frac{0.5}{z1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(t\_0 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\ \end{array} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (let* ((t_0 (- (+ z0 z0) -0.5)))
  (if (<= (tan (* PI t_0)) 20000000000.0)
    (/
     (-
      (* (* (/ 1.0 z1) (/ 0.5 z1)) z1)
      (/
       (cos (* 2.0 (atan (* (tan (* t_0 PI)) (/ z1 z2)))))
       (+ z1 z1)))
     z1)
    (/
     (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
     (* (+ z1 z1) z1)))))
double code(double z1, double z2, double z0) {
	double t_0 = (z0 + z0) - -0.5;
	double tmp;
	if (tan((((double) M_PI) * t_0)) <= 20000000000.0) {
		tmp = ((((1.0 / z1) * (0.5 / z1)) * z1) - (cos((2.0 * atan((tan((t_0 * ((double) M_PI))) * (z1 / z2))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
public static double code(double z1, double z2, double z0) {
	double t_0 = (z0 + z0) - -0.5;
	double tmp;
	if (Math.tan((Math.PI * t_0)) <= 20000000000.0) {
		tmp = ((((1.0 / z1) * (0.5 / z1)) * z1) - (Math.cos((2.0 * Math.atan((Math.tan((t_0 * Math.PI)) * (z1 / z2))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
def code(z1, z2, z0):
	t_0 = (z0 + z0) - -0.5
	tmp = 0
	if math.tan((math.pi * t_0)) <= 20000000000.0:
		tmp = ((((1.0 / z1) * (0.5 / z1)) * z1) - (math.cos((2.0 * math.atan((math.tan((t_0 * math.pi)) * (z1 / z2))))) / (z1 + z1))) / z1
	else:
		tmp = (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / ((z1 + z1) * z1)
	return tmp
function code(z1, z2, z0)
	t_0 = Float64(Float64(z0 + z0) - -0.5)
	tmp = 0.0
	if (tan(Float64(pi * t_0)) <= 20000000000.0)
		tmp = Float64(Float64(Float64(Float64(Float64(1.0 / z1) * Float64(0.5 / z1)) * z1) - Float64(cos(Float64(2.0 * atan(Float64(tan(Float64(t_0 * pi)) * Float64(z1 / z2))))) / Float64(z1 + z1))) / z1);
	else
		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / Float64(Float64(z1 + z1) * z1));
	end
	return tmp
end
function tmp_2 = code(z1, z2, z0)
	t_0 = (z0 + z0) - -0.5;
	tmp = 0.0;
	if (tan((pi * t_0)) <= 20000000000.0)
		tmp = ((((1.0 / z1) * (0.5 / z1)) * z1) - (cos((2.0 * atan((tan((t_0 * pi)) * (z1 / z2))))) / (z1 + z1))) / z1;
	else
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / ((z1 + z1) * z1);
	end
	tmp_2 = tmp;
end
code[z1_, z2_, z0_] := Block[{t$95$0 = N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]}, If[LessEqual[N[Tan[N[(Pi * t$95$0), $MachinePrecision]], $MachinePrecision], 20000000000.0], N[(N[(N[(N[(N[(1.0 / z1), $MachinePrecision] * N[(0.5 / z1), $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision] - N[(N[Cos[N[(2.0 * N[ArcTan[N[(N[Tan[N[(t$95$0 * Pi), $MachinePrecision]], $MachinePrecision] * N[(z1 / z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(z0 + z0\right) - -0.5\\
\mathbf{if}\;\tan \left(\pi \cdot t\_0\right) \leq 20000000000:\\
\;\;\;\;\frac{\left(\frac{1}{z1} \cdot \frac{0.5}{z1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(t\_0 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 2e10

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      6. sub-to-fractionN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    3. Applied rewrites70.3%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{z1 \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{2}}{\color{blue}{z1 \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      3. associate-/r*N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{2}}{z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      4. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{2}}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      5. associate-/r*N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{2 \cdot z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      6. count-2N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      8. associate-/r*N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      10. inv-powN/A

        \[\leadsto \frac{\color{blue}{{\left(\left(z1 + z1\right) \cdot z1\right)}^{-1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{{\color{blue}{\left(\left(z1 + z1\right) \cdot z1\right)}}^{-1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      12. *-commutativeN/A

        \[\leadsto \frac{{\color{blue}{\left(z1 \cdot \left(z1 + z1\right)\right)}}^{-1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      13. unpow-prod-downN/A

        \[\leadsto \frac{\color{blue}{\left({z1}^{-1} \cdot {\left(z1 + z1\right)}^{-1}\right)} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      14. lower-unsound-pow.f32N/A

        \[\leadsto \frac{\left(\color{blue}{{z1}^{-1}} \cdot {\left(z1 + z1\right)}^{-1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      15. lower-pow.f32N/A

        \[\leadsto \frac{\left(\color{blue}{{z1}^{-1}} \cdot {\left(z1 + z1\right)}^{-1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      16. inv-powN/A

        \[\leadsto \frac{\left(\color{blue}{\frac{1}{z1}} \cdot {\left(z1 + z1\right)}^{-1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      17. lower-unsound-pow.f32N/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \color{blue}{{\left(z1 + z1\right)}^{-1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      18. lower-pow.f32N/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \color{blue}{{\left(z1 + z1\right)}^{-1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      19. inv-powN/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \color{blue}{\frac{1}{z1 + z1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      20. lower-unsound-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\frac{1}{z1} \cdot \frac{1}{z1 + z1}\right)} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      21. lower-/.f64N/A

        \[\leadsto \frac{\left(\color{blue}{\frac{1}{z1}} \cdot \frac{1}{z1 + z1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      22. lift-+.f64N/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \frac{1}{\color{blue}{z1 + z1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      23. count-2N/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \frac{1}{\color{blue}{2 \cdot z1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      24. associate-/r*N/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \color{blue}{\frac{\frac{1}{2}}{z1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      25. metadata-evalN/A

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \frac{\color{blue}{\frac{1}{2}}}{z1}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      26. lower-/.f6470.7%

        \[\leadsto \frac{\left(\frac{1}{z1} \cdot \color{blue}{\frac{0.5}{z1}}\right) \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    5. Applied rewrites70.7%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{z1} \cdot \frac{0.5}{z1}\right)} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]

    if 2e10 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lift-tan.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. tan-quotN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. frac-timesN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    3. Applied rewrites64.6%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. lower-PI.f6457.5%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    6. Applied rewrites57.5%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 74.9% accurate, 0.7× speedup?

\[\begin{array}{l} t_0 := \left(z0 + z0\right) - -0.5\\ \mathbf{if}\;\tan \left(\pi \cdot t\_0\right) \leq 20000000000:\\ \;\;\;\;\frac{\frac{\frac{0.5}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(t\_0 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\ \end{array} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (let* ((t_0 (- (+ z0 z0) -0.5)))
  (if (<= (tan (* PI t_0)) 20000000000.0)
    (/
     (-
      (* (/ (/ 0.5 z1) z1) z1)
      (/
       (cos (* 2.0 (atan (* (tan (* t_0 PI)) (/ z1 z2)))))
       (+ z1 z1)))
     z1)
    (/
     (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
     (* (+ z1 z1) z1)))))
double code(double z1, double z2, double z0) {
	double t_0 = (z0 + z0) - -0.5;
	double tmp;
	if (tan((((double) M_PI) * t_0)) <= 20000000000.0) {
		tmp = ((((0.5 / z1) / z1) * z1) - (cos((2.0 * atan((tan((t_0 * ((double) M_PI))) * (z1 / z2))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
public static double code(double z1, double z2, double z0) {
	double t_0 = (z0 + z0) - -0.5;
	double tmp;
	if (Math.tan((Math.PI * t_0)) <= 20000000000.0) {
		tmp = ((((0.5 / z1) / z1) * z1) - (Math.cos((2.0 * Math.atan((Math.tan((t_0 * Math.PI)) * (z1 / z2))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
def code(z1, z2, z0):
	t_0 = (z0 + z0) - -0.5
	tmp = 0
	if math.tan((math.pi * t_0)) <= 20000000000.0:
		tmp = ((((0.5 / z1) / z1) * z1) - (math.cos((2.0 * math.atan((math.tan((t_0 * math.pi)) * (z1 / z2))))) / (z1 + z1))) / z1
	else:
		tmp = (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / ((z1 + z1) * z1)
	return tmp
function code(z1, z2, z0)
	t_0 = Float64(Float64(z0 + z0) - -0.5)
	tmp = 0.0
	if (tan(Float64(pi * t_0)) <= 20000000000.0)
		tmp = Float64(Float64(Float64(Float64(Float64(0.5 / z1) / z1) * z1) - Float64(cos(Float64(2.0 * atan(Float64(tan(Float64(t_0 * pi)) * Float64(z1 / z2))))) / Float64(z1 + z1))) / z1);
	else
		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / Float64(Float64(z1 + z1) * z1));
	end
	return tmp
end
function tmp_2 = code(z1, z2, z0)
	t_0 = (z0 + z0) - -0.5;
	tmp = 0.0;
	if (tan((pi * t_0)) <= 20000000000.0)
		tmp = ((((0.5 / z1) / z1) * z1) - (cos((2.0 * atan((tan((t_0 * pi)) * (z1 / z2))))) / (z1 + z1))) / z1;
	else
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / ((z1 + z1) * z1);
	end
	tmp_2 = tmp;
end
code[z1_, z2_, z0_] := Block[{t$95$0 = N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]}, If[LessEqual[N[Tan[N[(Pi * t$95$0), $MachinePrecision]], $MachinePrecision], 20000000000.0], N[(N[(N[(N[(N[(0.5 / z1), $MachinePrecision] / z1), $MachinePrecision] * z1), $MachinePrecision] - N[(N[Cos[N[(2.0 * N[ArcTan[N[(N[Tan[N[(t$95$0 * Pi), $MachinePrecision]], $MachinePrecision] * N[(z1 / z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(z0 + z0\right) - -0.5\\
\mathbf{if}\;\tan \left(\pi \cdot t\_0\right) \leq 20000000000:\\
\;\;\;\;\frac{\frac{\frac{0.5}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(t\_0 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 2e10

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      6. sub-to-fractionN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    3. Applied rewrites70.3%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{z1 \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{2}}{\color{blue}{z1 \cdot z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      3. associate-/r*N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{2}}{z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      4. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{2}}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      5. associate-/r*N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{2 \cdot z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      6. count-2N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      8. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{z1 + z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      9. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{z1 + z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      10. count-2N/A

        \[\leadsto \frac{\frac{\frac{1}{\color{blue}{2 \cdot z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{\frac{1}{2}}{z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{2}}}{z1}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - \frac{-1}{2}\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      13. lower-/.f6470.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{0.5}{z1}}}{z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    5. Applied rewrites70.9%

      \[\leadsto \frac{\color{blue}{\frac{\frac{0.5}{z1}}{z1}} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]

    if 2e10 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lift-tan.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. tan-quotN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. frac-timesN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    3. Applied rewrites64.6%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. lower-PI.f6457.5%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    6. Applied rewrites57.5%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 74.8% accurate, 0.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 20000000000:\\ \;\;\;\;\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\ \end{array} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (if (<= (tan (* PI (- (+ z0 z0) -0.5))) 20000000000.0)
  (/
   (-
    (* (/ 0.5 (* z1 z1)) z1)
    (/ (cos (* 2.0 (atan (* (tan (* 0.5 PI)) (/ z1 z2))))) (+ z1 z1)))
   z1)
  (/
   (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
   (* (+ z1 z1) z1))))
double code(double z1, double z2, double z0) {
	double tmp;
	if (tan((((double) M_PI) * ((z0 + z0) - -0.5))) <= 20000000000.0) {
		tmp = (((0.5 / (z1 * z1)) * z1) - (cos((2.0 * atan((tan((0.5 * ((double) M_PI))) * (z1 / z2))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
public static double code(double z1, double z2, double z0) {
	double tmp;
	if (Math.tan((Math.PI * ((z0 + z0) - -0.5))) <= 20000000000.0) {
		tmp = (((0.5 / (z1 * z1)) * z1) - (Math.cos((2.0 * Math.atan((Math.tan((0.5 * Math.PI)) * (z1 / z2))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
def code(z1, z2, z0):
	tmp = 0
	if math.tan((math.pi * ((z0 + z0) - -0.5))) <= 20000000000.0:
		tmp = (((0.5 / (z1 * z1)) * z1) - (math.cos((2.0 * math.atan((math.tan((0.5 * math.pi)) * (z1 / z2))))) / (z1 + z1))) / z1
	else:
		tmp = (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / ((z1 + z1) * z1)
	return tmp
function code(z1, z2, z0)
	tmp = 0.0
	if (tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5))) <= 20000000000.0)
		tmp = Float64(Float64(Float64(Float64(0.5 / Float64(z1 * z1)) * z1) - Float64(cos(Float64(2.0 * atan(Float64(tan(Float64(0.5 * pi)) * Float64(z1 / z2))))) / Float64(z1 + z1))) / z1);
	else
		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / Float64(Float64(z1 + z1) * z1));
	end
	return tmp
end
function tmp_2 = code(z1, z2, z0)
	tmp = 0.0;
	if (tan((pi * ((z0 + z0) - -0.5))) <= 20000000000.0)
		tmp = (((0.5 / (z1 * z1)) * z1) - (cos((2.0 * atan((tan((0.5 * pi)) * (z1 / z2))))) / (z1 + z1))) / z1;
	else
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / ((z1 + z1) * z1);
	end
	tmp_2 = tmp;
end
code[z1_, z2_, z0_] := If[LessEqual[N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 20000000000.0], N[(N[(N[(N[(0.5 / N[(z1 * z1), $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision] - N[(N[Cos[N[(2.0 * N[ArcTan[N[(N[Tan[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[(z1 / z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 20000000000:\\
\;\;\;\;\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 2e10

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}}{\left(z1 + z1\right) \cdot z1} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{1}{\left(z1 + z1\right) \cdot z1} - \color{blue}{\frac{\frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      6. sub-to-fractionN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\left(z1 + z1\right) \cdot z1} \cdot z1 - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{z1 + z1}}{z1}} \]
    3. Applied rewrites70.3%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\left(\left(z0 + z0\right) - -0.5\right) \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1}} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \color{blue}{\left(\frac{1}{2} \cdot \pi\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{\frac{\frac{1}{2}}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
      2. lower-PI.f6471.0%

        \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]
    6. Applied rewrites71.0%

      \[\leadsto \frac{\frac{0.5}{z1 \cdot z1} \cdot z1 - \frac{\cos \left(2 \cdot \tan^{-1} \left(\tan \color{blue}{\left(0.5 \cdot \pi\right)} \cdot \frac{z1}{z2}\right)\right)}{z1 + z1}}{z1} \]

    if 2e10 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lift-tan.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. tan-quotN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. frac-timesN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    3. Applied rewrites64.6%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    4. Taylor expanded in z0 around 0

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. lower-PI.f6457.5%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    6. Applied rewrites57.5%

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 66.3% accurate, 0.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 20000000000:\\ \;\;\;\;\frac{\frac{0.5}{z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(0.5 \cdot \pi\right)\right)\right)}{z1 + z1}}{z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\ \end{array} \]
(FPCore (z1 z2 z0)
  :precision binary64
  (if (<= (tan (* PI (- (+ z0 z0) -0.5))) 20000000000.0)
  (/
   (-
    (/ 0.5 z1)
    (/
     (cos (* -2.0 (atan (* (/ z1 z2) (tan (* 0.5 PI))))))
     (+ z1 z1)))
   z1)
  (/
   (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
   (* (+ z1 z1) z1))))
double code(double z1, double z2, double z0) {
	double tmp;
	if (tan((((double) M_PI) * ((z0 + z0) - -0.5))) <= 20000000000.0) {
		tmp = ((0.5 / z1) - (cos((-2.0 * atan(((z1 / z2) * tan((0.5 * ((double) M_PI))))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
public static double code(double z1, double z2, double z0) {
	double tmp;
	if (Math.tan((Math.PI * ((z0 + z0) - -0.5))) <= 20000000000.0) {
		tmp = ((0.5 / z1) - (Math.cos((-2.0 * Math.atan(((z1 / z2) * Math.tan((0.5 * Math.PI)))))) / (z1 + z1))) / z1;
	} else {
		tmp = (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / ((z1 + z1) * z1);
	}
	return tmp;
}
def code(z1, z2, z0):
	tmp = 0
	if math.tan((math.pi * ((z0 + z0) - -0.5))) <= 20000000000.0:
		tmp = ((0.5 / z1) - (math.cos((-2.0 * math.atan(((z1 / z2) * math.tan((0.5 * math.pi)))))) / (z1 + z1))) / z1
	else:
		tmp = (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / ((z1 + z1) * z1)
	return tmp
function code(z1, z2, z0)
	tmp = 0.0
	if (tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5))) <= 20000000000.0)
		tmp = Float64(Float64(Float64(0.5 / z1) - Float64(cos(Float64(-2.0 * atan(Float64(Float64(z1 / z2) * tan(Float64(0.5 * pi)))))) / Float64(z1 + z1))) / z1);
	else
		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / Float64(Float64(z1 + z1) * z1));
	end
	return tmp
end
function tmp_2 = code(z1, z2, z0)
	tmp = 0.0;
	if (tan((pi * ((z0 + z0) - -0.5))) <= 20000000000.0)
		tmp = ((0.5 / z1) - (cos((-2.0 * atan(((z1 / z2) * tan((0.5 * pi)))))) / (z1 + z1))) / z1;
	else
		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / ((z1 + z1) * z1);
	end
	tmp_2 = tmp;
end
code[z1_, z2_, z0_] := If[LessEqual[N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 20000000000.0], N[(N[(N[(0.5 / z1), $MachinePrecision] - N[(N[Cos[N[(-2.0 * N[ArcTan[N[(N[(z1 / z2), $MachinePrecision] * N[Tan[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 20000000000:\\
\;\;\;\;\frac{\frac{0.5}{z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(0.5 \cdot \pi\right)\right)\right)}{z1 + z1}}{z1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 2e10

    1. Initial program 56.7%

      \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    2. Taylor expanded in z0 around 0

      \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
    3. Step-by-step derivation
      1. Applied rewrites57.7%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \color{blue}{0.5}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
        3. associate-/r*N/A

          \[\leadsto \color{blue}{\frac{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{z1 + z1}}{z1}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{z1 + z1}}{z1}} \]
      3. Applied rewrites59.6%

        \[\leadsto \color{blue}{\frac{\frac{1 - \cos \left(\tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{1 - \cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}}{z1} \]
        2. lift--.f64N/A

          \[\leadsto \frac{\frac{\color{blue}{1 - \cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}}{z1 + z1}}{z1} \]
        3. div-subN/A

          \[\leadsto \frac{\color{blue}{\frac{1}{z1 + z1} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}}{z1} \]
        4. lower--.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{1}{z1 + z1} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}}{z1} \]
        5. lift-+.f64N/A

          \[\leadsto \frac{\frac{1}{\color{blue}{z1 + z1}} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1} \]
        6. count-2N/A

          \[\leadsto \frac{\frac{1}{\color{blue}{2 \cdot z1}} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1} \]
        7. associate-/r*N/A

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{z1}} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1} \]
        8. metadata-evalN/A

          \[\leadsto \frac{\frac{\color{blue}{\frac{1}{2}}}{z1} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1} \]
        9. lift-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{z1}} - \frac{\cos \left(\tan^{-1} \left(\tan \left(\frac{1}{2} \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1} \]
        10. lower-/.f6459.6%

          \[\leadsto \frac{\frac{0.5}{z1} - \color{blue}{\frac{\cos \left(\tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}}{z1} \]
      5. Applied rewrites59.6%

        \[\leadsto \frac{\color{blue}{\frac{0.5}{z1} - \frac{\cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(0.5 \cdot \pi\right)\right)\right)}{z1 + z1}}}{z1} \]

      if 2e10 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

      1. Initial program 56.7%

        \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        3. lift-tan.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        4. tan-quotN/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        5. frac-timesN/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        6. *-commutativeN/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. Applied rewrites64.6%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. Taylor expanded in z0 around 0

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        5. lower-PI.f6457.5%

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      6. Applied rewrites57.5%

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 8: 66.2% accurate, 0.8× speedup?

    \[\begin{array}{l} \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 20000000000:\\ \;\;\;\;\frac{\frac{1 - \cos \left(\tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\ \end{array} \]
    (FPCore (z1 z2 z0)
      :precision binary64
      (if (<= (tan (* PI (- (+ z0 z0) -0.5))) 20000000000.0)
      (/
       (/
        (- 1.0 (cos (* (atan (* (tan (* 0.5 PI)) (/ z1 z2))) 2.0)))
        (+ z1 z1))
       z1)
      (/
       (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
       (* (+ z1 z1) z1))))
    double code(double z1, double z2, double z0) {
    	double tmp;
    	if (tan((((double) M_PI) * ((z0 + z0) - -0.5))) <= 20000000000.0) {
    		tmp = ((1.0 - cos((atan((tan((0.5 * ((double) M_PI))) * (z1 / z2))) * 2.0))) / (z1 + z1)) / z1;
    	} else {
    		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / ((z1 + z1) * z1);
    	}
    	return tmp;
    }
    
    public static double code(double z1, double z2, double z0) {
    	double tmp;
    	if (Math.tan((Math.PI * ((z0 + z0) - -0.5))) <= 20000000000.0) {
    		tmp = ((1.0 - Math.cos((Math.atan((Math.tan((0.5 * Math.PI)) * (z1 / z2))) * 2.0))) / (z1 + z1)) / z1;
    	} else {
    		tmp = (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / ((z1 + z1) * z1);
    	}
    	return tmp;
    }
    
    def code(z1, z2, z0):
    	tmp = 0
    	if math.tan((math.pi * ((z0 + z0) - -0.5))) <= 20000000000.0:
    		tmp = ((1.0 - math.cos((math.atan((math.tan((0.5 * math.pi)) * (z1 / z2))) * 2.0))) / (z1 + z1)) / z1
    	else:
    		tmp = (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / ((z1 + z1) * z1)
    	return tmp
    
    function code(z1, z2, z0)
    	tmp = 0.0
    	if (tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5))) <= 20000000000.0)
    		tmp = Float64(Float64(Float64(1.0 - cos(Float64(atan(Float64(tan(Float64(0.5 * pi)) * Float64(z1 / z2))) * 2.0))) / Float64(z1 + z1)) / z1);
    	else
    		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / Float64(Float64(z1 + z1) * z1));
    	end
    	return tmp
    end
    
    function tmp_2 = code(z1, z2, z0)
    	tmp = 0.0;
    	if (tan((pi * ((z0 + z0) - -0.5))) <= 20000000000.0)
    		tmp = ((1.0 - cos((atan((tan((0.5 * pi)) * (z1 / z2))) * 2.0))) / (z1 + z1)) / z1;
    	else
    		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / ((z1 + z1) * z1);
    	end
    	tmp_2 = tmp;
    end
    
    code[z1_, z2_, z0_] := If[LessEqual[N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 20000000000.0], N[(N[(N[(1.0 - N[Cos[N[(N[ArcTan[N[(N[Tan[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[(z1 / z2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(z1 + z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 20000000000:\\
    \;\;\;\;\frac{\frac{1 - \cos \left(\tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 2e10

      1. Initial program 56.7%

        \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      2. Taylor expanded in z0 around 0

        \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
      3. Step-by-step derivation
        1. Applied rewrites57.7%

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \color{blue}{0.5}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{\color{blue}{\left(z1 + z1\right) \cdot z1}} \]
          3. associate-/r*N/A

            \[\leadsto \color{blue}{\frac{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{z1 + z1}}{z1}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \frac{1}{2}\right)\right)\right)}{z1 + z1}}{z1}} \]
        3. Applied rewrites59.6%

          \[\leadsto \color{blue}{\frac{\frac{1 - \cos \left(\tan^{-1} \left(\tan \left(0.5 \cdot \pi\right) \cdot \frac{z1}{z2}\right) \cdot 2\right)}{z1 + z1}}{z1}} \]

        if 2e10 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

        1. Initial program 56.7%

          \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          3. lift-tan.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          4. tan-quotN/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          5. frac-timesN/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          6. *-commutativeN/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        3. Applied rewrites64.6%

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        4. Taylor expanded in z0 around 0

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          2. lower-/.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          3. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          5. lower-PI.f6457.5%

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        6. Applied rewrites57.5%

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 9: 65.5% accurate, 0.8× speedup?

      \[\begin{array}{l} t_0 := \left(z1 + z1\right) \cdot z1\\ \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 40:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot 0.5\right)\right)\right)}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{t\_0}\\ \end{array} \]
      (FPCore (z1 z2 z0)
        :precision binary64
        (let* ((t_0 (* (+ z1 z1) z1)))
        (if (<= (tan (* PI (- (+ z0 z0) -0.5))) 40.0)
          (/
           (- 1.0 (cos (* -2.0 (atan (* (/ z1 z2) (tan (* PI 0.5)))))))
           t_0)
          (/
           (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
           t_0))))
      double code(double z1, double z2, double z0) {
      	double t_0 = (z1 + z1) * z1;
      	double tmp;
      	if (tan((((double) M_PI) * ((z0 + z0) - -0.5))) <= 40.0) {
      		tmp = (1.0 - cos((-2.0 * atan(((z1 / z2) * tan((((double) M_PI) * 0.5))))))) / t_0;
      	} else {
      		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / t_0;
      	}
      	return tmp;
      }
      
      public static double code(double z1, double z2, double z0) {
      	double t_0 = (z1 + z1) * z1;
      	double tmp;
      	if (Math.tan((Math.PI * ((z0 + z0) - -0.5))) <= 40.0) {
      		tmp = (1.0 - Math.cos((-2.0 * Math.atan(((z1 / z2) * Math.tan((Math.PI * 0.5))))))) / t_0;
      	} else {
      		tmp = (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / t_0;
      	}
      	return tmp;
      }
      
      def code(z1, z2, z0):
      	t_0 = (z1 + z1) * z1
      	tmp = 0
      	if math.tan((math.pi * ((z0 + z0) - -0.5))) <= 40.0:
      		tmp = (1.0 - math.cos((-2.0 * math.atan(((z1 / z2) * math.tan((math.pi * 0.5))))))) / t_0
      	else:
      		tmp = (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / t_0
      	return tmp
      
      function code(z1, z2, z0)
      	t_0 = Float64(Float64(z1 + z1) * z1)
      	tmp = 0.0
      	if (tan(Float64(pi * Float64(Float64(z0 + z0) - -0.5))) <= 40.0)
      		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(Float64(z1 / z2) * tan(Float64(pi * 0.5))))))) / t_0);
      	else
      		tmp = Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / t_0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(z1, z2, z0)
      	t_0 = (z1 + z1) * z1;
      	tmp = 0.0;
      	if (tan((pi * ((z0 + z0) - -0.5))) <= 40.0)
      		tmp = (1.0 - cos((-2.0 * atan(((z1 / z2) * tan((pi * 0.5))))))) / t_0;
      	else
      		tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[z1_, z2_, z0_] := Block[{t$95$0 = N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]}, If[LessEqual[N[Tan[N[(Pi * N[(N[(z0 + z0), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 40.0], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(N[(z1 / z2), $MachinePrecision] * N[Tan[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \left(z1 + z1\right) \cdot z1\\
      \mathbf{if}\;\tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right) \leq 40:\\
      \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot 0.5\right)\right)\right)}{t\_0}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{t\_0}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64)))) < 40

        1. Initial program 56.7%

          \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        2. Taylor expanded in z0 around 0

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        3. Step-by-step derivation
          1. Applied rewrites57.7%

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \color{blue}{0.5}\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]

          if 40 < (tan.f64 (*.f64 (PI.f64) (-.f64 (+.f64 z0 z0) #s(literal -1/2 binary64))))

          1. Initial program 56.7%

            \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            3. lift-tan.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            4. tan-quotN/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            5. frac-timesN/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
            6. *-commutativeN/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            7. lower-/.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          3. Applied rewrites64.6%

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          4. Taylor expanded in z0 around 0

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            2. lower-/.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
            5. lower-PI.f6457.5%

              \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          6. Applied rewrites57.5%

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 10: 57.5% accurate, 1.4× speedup?

        \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        (FPCore (z1 z2 z0)
          :precision binary64
          (/
         (- 1.0 (cos (* -2.0 (atan (* -0.5 (/ z1 (* z0 (* z2 PI))))))))
         (* (+ z1 z1) z1)))
        double code(double z1, double z2, double z0) {
        	return (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * ((double) M_PI))))))))) / ((z1 + z1) * z1);
        }
        
        public static double code(double z1, double z2, double z0) {
        	return (1.0 - Math.cos((-2.0 * Math.atan((-0.5 * (z1 / (z0 * (z2 * Math.PI)))))))) / ((z1 + z1) * z1);
        }
        
        def code(z1, z2, z0):
        	return (1.0 - math.cos((-2.0 * math.atan((-0.5 * (z1 / (z0 * (z2 * math.pi)))))))) / ((z1 + z1) * z1)
        
        function code(z1, z2, z0)
        	return Float64(Float64(1.0 - cos(Float64(-2.0 * atan(Float64(-0.5 * Float64(z1 / Float64(z0 * Float64(z2 * pi)))))))) / Float64(Float64(z1 + z1) * z1))
        end
        
        function tmp = code(z1, z2, z0)
        	tmp = (1.0 - cos((-2.0 * atan((-0.5 * (z1 / (z0 * (z2 * pi)))))))) / ((z1 + z1) * z1);
        end
        
        code[z1_, z2_, z0_] := N[(N[(1.0 - N[Cos[N[(-2.0 * N[ArcTan[N[(-0.5 * N[(z1 / N[(z0 * N[(z2 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(z1 + z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]
        
        \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1}
        
        Derivation
        1. Initial program 56.7%

          \[\frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - -0.5\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1}{z2} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\color{blue}{\frac{z1}{z2}} \cdot \tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          3. lift-tan.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\tan \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          4. tan-quotN/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1}{z2} \cdot \color{blue}{\frac{\sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          5. frac-timesN/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{z2 \cdot \cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
          6. *-commutativeN/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\color{blue}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{z1 \cdot \sin \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right)}{\cos \left(\pi \cdot \left(\left(z0 + z0\right) - \frac{-1}{2}\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        3. Applied rewrites64.6%

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{\cos \left(\left(z0 + z0\right) \cdot \pi\right) \cdot z1}{\left(-\sin \left(\left(z0 + z0\right) \cdot \pi\right)\right) \cdot z2}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        4. Taylor expanded in z0 around 0

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{z1}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          2. lower-/.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{\color{blue}{z0 \cdot \left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          3. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \color{blue}{\left(z2 \cdot \mathsf{PI}\left(\right)\right)}}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(\frac{-1}{2} \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
          5. lower-PI.f6457.5%

            \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)\right)}{\left(z1 + z1\right) \cdot z1} \]
        6. Applied rewrites57.5%

          \[\leadsto \frac{1 - \cos \left(-2 \cdot \tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{z1}{z0 \cdot \left(z2 \cdot \pi\right)}\right)}\right)}{\left(z1 + z1\right) \cdot z1} \]
        7. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025250 
        (FPCore (z1 z2 z0)
          :name "(/ (- 1 (cos (* -2 (atan (* (/ z1 z2) (tan (* PI (- (+ z0 z0) -1/2)))))))) (* (+ z1 z1) z1))"
          :precision binary64
          (/ (- 1.0 (cos (* -2.0 (atan (* (/ z1 z2) (tan (* PI (- (+ z0 z0) -0.5)))))))) (* (+ z1 z1) z1)))