Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A

Percentage Accurate: 68.9% → 99.9%
Time: 10.7s
Alternatives: 13
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z):
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z)
	return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0))
end
function tmp = code(x, y, z)
	tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}

Sampling outcomes in binary64 precision:

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 13 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: 68.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z):
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z)
	return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0))
end
function tmp = code(x, y, z)
	tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}

Alternative 1: 99.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \frac{y + \left(x + z\right) \cdot \frac{x - z}{y}}{2} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (+ y (* (+ x z) (/ (- x z) y))) 2.0))
double code(double x, double y, double z) {
	return (y + ((x + z) * ((x - z) / y))) / 2.0;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (y + ((x + z) * ((x - z) / y))) / 2.0d0
end function
public static double code(double x, double y, double z) {
	return (y + ((x + z) * ((x - z) / y))) / 2.0;
}
def code(x, y, z):
	return (y + ((x + z) * ((x - z) / y))) / 2.0
function code(x, y, z)
	return Float64(Float64(y + Float64(Float64(x + z) * Float64(Float64(x - z) / y))) / 2.0)
end
function tmp = code(x, y, z)
	tmp = (y + ((x + z) * ((x - z) / y))) / 2.0;
end
code[x_, y_, z_] := N[(N[(y + N[(N[(x + z), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}

\\
\frac{y + \left(x + z\right) \cdot \frac{x - z}{y}}{2}
\end{array}
Derivation
  1. Initial program 72.0%

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
  2. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
  3. Simplified83.0%

    \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. difference-of-squaresN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{\left(x + z\right) \cdot \left(x - z\right)}{y}\right)\right), 2\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\right), 2\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\left(x + z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(x - z\right), y\right)\right)\right), 2\right) \]
    6. --lowering--.f6499.9%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, z\right), y\right)\right)\right), 2\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \frac{y + \color{blue}{\left(x + z\right) \cdot \frac{x - z}{y}}}{2} \]
  7. Add Preprocessing

Alternative 2: 43.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{0.5}{\frac{y}{x \cdot x}}\\ \mathbf{if}\;z \leq 6 \cdot 10^{-245}:\\ \;\;\;\;\frac{y}{2}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-144}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-69}:\\ \;\;\;\;\frac{y}{2}\\ \mathbf{elif}\;z \leq 8.4 \cdot 10^{+45}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ 0.5 (/ y (* x x)))))
   (if (<= z 6e-245)
     (/ y 2.0)
     (if (<= z 7e-144)
       t_0
       (if (<= z 1.6e-69)
         (/ y 2.0)
         (if (<= z 8.4e+45) t_0 (* z (* (/ z y) -0.5))))))))
double code(double x, double y, double z) {
	double t_0 = 0.5 / (y / (x * x));
	double tmp;
	if (z <= 6e-245) {
		tmp = y / 2.0;
	} else if (z <= 7e-144) {
		tmp = t_0;
	} else if (z <= 1.6e-69) {
		tmp = y / 2.0;
	} else if (z <= 8.4e+45) {
		tmp = t_0;
	} else {
		tmp = z * ((z / y) * -0.5);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.5d0 / (y / (x * x))
    if (z <= 6d-245) then
        tmp = y / 2.0d0
    else if (z <= 7d-144) then
        tmp = t_0
    else if (z <= 1.6d-69) then
        tmp = y / 2.0d0
    else if (z <= 8.4d+45) then
        tmp = t_0
    else
        tmp = z * ((z / y) * (-0.5d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 0.5 / (y / (x * x));
	double tmp;
	if (z <= 6e-245) {
		tmp = y / 2.0;
	} else if (z <= 7e-144) {
		tmp = t_0;
	} else if (z <= 1.6e-69) {
		tmp = y / 2.0;
	} else if (z <= 8.4e+45) {
		tmp = t_0;
	} else {
		tmp = z * ((z / y) * -0.5);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 0.5 / (y / (x * x))
	tmp = 0
	if z <= 6e-245:
		tmp = y / 2.0
	elif z <= 7e-144:
		tmp = t_0
	elif z <= 1.6e-69:
		tmp = y / 2.0
	elif z <= 8.4e+45:
		tmp = t_0
	else:
		tmp = z * ((z / y) * -0.5)
	return tmp
function code(x, y, z)
	t_0 = Float64(0.5 / Float64(y / Float64(x * x)))
	tmp = 0.0
	if (z <= 6e-245)
		tmp = Float64(y / 2.0);
	elseif (z <= 7e-144)
		tmp = t_0;
	elseif (z <= 1.6e-69)
		tmp = Float64(y / 2.0);
	elseif (z <= 8.4e+45)
		tmp = t_0;
	else
		tmp = Float64(z * Float64(Float64(z / y) * -0.5));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 0.5 / (y / (x * x));
	tmp = 0.0;
	if (z <= 6e-245)
		tmp = y / 2.0;
	elseif (z <= 7e-144)
		tmp = t_0;
	elseif (z <= 1.6e-69)
		tmp = y / 2.0;
	elseif (z <= 8.4e+45)
		tmp = t_0;
	else
		tmp = z * ((z / y) * -0.5);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.5 / N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6e-245], N[(y / 2.0), $MachinePrecision], If[LessEqual[z, 7e-144], t$95$0, If[LessEqual[z, 1.6e-69], N[(y / 2.0), $MachinePrecision], If[LessEqual[z, 8.4e+45], t$95$0, N[(z * N[(N[(z / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{0.5}{\frac{y}{x \cdot x}}\\
\mathbf{if}\;z \leq 6 \cdot 10^{-245}:\\
\;\;\;\;\frac{y}{2}\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-144}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-69}:\\
\;\;\;\;\frac{y}{2}\\

\mathbf{elif}\;z \leq 8.4 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 6.0000000000000004e-245 or 6.9999999999999997e-144 < z < 1.59999999999999999e-69

    1. Initial program 71.4%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
    3. Simplified84.2%

      \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, 2\right) \]
    6. Step-by-step derivation
      1. Simplified32.6%

        \[\leadsto \frac{\color{blue}{y}}{2} \]

      if 6.0000000000000004e-245 < z < 6.9999999999999997e-144 or 1.59999999999999999e-69 < z < 8.39999999999999979e45

      1. Initial program 76.7%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified86.0%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around inf

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{{x}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2}\right), y\right), 2\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x \cdot x\right), y\right), 2\right) \]
        3. *-lowering-*.f6447.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), y\right), 2\right) \]
      7. Simplified47.1%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot x}{y}}}{2} \]
      8. Step-by-step derivation
        1. div-invN/A

          \[\leadsto \frac{x \cdot x}{y} \cdot \color{blue}{\frac{1}{2}} \]
        2. clear-numN/A

          \[\leadsto \frac{1}{\frac{y}{x \cdot x}} \cdot \frac{\color{blue}{1}}{2} \]
        3. metadata-evalN/A

          \[\leadsto \frac{1}{\frac{y}{x \cdot x}} \cdot \frac{1}{2} \]
        4. associate-*l/N/A

          \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{y}{x \cdot x}}} \]
        5. metadata-evalN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{y}}{x \cdot x}} \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{y}{x \cdot x}\right)}\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f6447.1%

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      9. Applied egg-rr47.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{x \cdot x}}} \]

      if 8.39999999999999979e45 < z

      1. Initial program 70.4%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified76.4%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{{z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{{z}^{2}}{y} \cdot \color{blue}{\frac{-1}{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{z \cdot z}{y} \cdot \frac{-1}{2} \]
        3. associate-/l*N/A

          \[\leadsto \left(z \cdot \frac{z}{y}\right) \cdot \frac{-1}{2} \]
        4. associate-*l*N/A

          \[\leadsto z \cdot \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
        7. /-lowering-/.f6465.5%

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), \frac{-1}{2}\right)\right) \]
      7. Simplified65.5%

        \[\leadsto \color{blue}{z \cdot \left(\frac{z}{y} \cdot -0.5\right)} \]
    7. Recombined 3 regimes into one program.
    8. Add Preprocessing

    Alternative 3: 76.6% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{+82}:\\ \;\;\;\;\frac{\left(x + z\right) \cdot \frac{x - z}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + \frac{-1}{\frac{\frac{y}{z}}{z}}}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 9.5e+82)
       (/ (* (+ x z) (/ (- x z) y)) 2.0)
       (/ (+ y (/ -1.0 (/ (/ y z) z))) 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 9.5e+82) {
    		tmp = ((x + z) * ((x - z) / y)) / 2.0;
    	} else {
    		tmp = (y + (-1.0 / ((y / z) / z))) / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 9.5d+82) then
            tmp = ((x + z) * ((x - z) / y)) / 2.0d0
        else
            tmp = (y + ((-1.0d0) / ((y / z) / z))) / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 9.5e+82) {
    		tmp = ((x + z) * ((x - z) / y)) / 2.0;
    	} else {
    		tmp = (y + (-1.0 / ((y / z) / z))) / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 9.5e+82:
    		tmp = ((x + z) * ((x - z) / y)) / 2.0
    	else:
    		tmp = (y + (-1.0 / ((y / z) / z))) / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 9.5e+82)
    		tmp = Float64(Float64(Float64(x + z) * Float64(Float64(x - z) / y)) / 2.0);
    	else
    		tmp = Float64(Float64(y + Float64(-1.0 / Float64(Float64(y / z) / z))) / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 9.5e+82)
    		tmp = ((x + z) * ((x - z) / y)) / 2.0;
    	else
    		tmp = (y + (-1.0 / ((y / z) / z))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 9.5e+82], N[(N[(N[(x + z), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(y + N[(-1.0 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 9.5 \cdot 10^{+82}:\\
    \;\;\;\;\frac{\left(x + z\right) \cdot \frac{x - z}{y}}{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y + \frac{-1}{\frac{\frac{y}{z}}{z}}}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 9.50000000000000049e82

      1. Initial program 79.0%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified83.9%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. difference-of-squaresN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{\left(x + z\right) \cdot \left(x - z\right)}{y}\right)\right), 2\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\left(x + z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(x - z\right), y\right)\right)\right), 2\right) \]
        6. --lowering--.f6499.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, z\right), y\right)\right)\right), 2\right) \]
      6. Applied egg-rr99.9%

        \[\leadsto \frac{y + \color{blue}{\left(x + z\right) \cdot \frac{x - z}{y}}}{2} \]
      7. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\left(x + z\right) \cdot \frac{1}{\frac{y}{x - z}}\right)\right), 2\right) \]
        2. un-div-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{x + z}{\frac{y}{x - z}}\right)\right), 2\right) \]
        3. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{1}{\frac{\frac{y}{x - z}}{x + z}}\right)\right), 2\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \left(\frac{\frac{y}{x - z}}{x + z}\right)\right)\right), 2\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{y}{x - z}\right), \left(x + z\right)\right)\right)\right), 2\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x - z\right)\right), \left(x + z\right)\right)\right)\right), 2\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(x, z\right)\right), \left(x + z\right)\right)\right)\right), 2\right) \]
        8. +-lowering-+.f6499.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(x, z\right)\right), \mathsf{+.f64}\left(x, z\right)\right)\right)\right), 2\right) \]
      8. Applied egg-rr99.8%

        \[\leadsto \frac{y + \color{blue}{\frac{1}{\frac{\frac{y}{x - z}}{x + z}}}}{2} \]
      9. Taylor expanded in y around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(x + z\right) \cdot \left(x - z\right)}{y}\right)}, 2\right) \]
      10. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \frac{x - z}{y}\right), 2\right) \]
        2. div-subN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(\frac{x}{y} - \frac{z}{y}\right)\right), 2\right) \]
        3. unsub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{z}{y}\right)\right)\right)\right), 2\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(\frac{x}{y} + -1 \cdot \frac{z}{y}\right)\right), 2\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(-1 \cdot \frac{z}{y} + \frac{x}{y}\right)\right), 2\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(x + z\right), \left(-1 \cdot \frac{z}{y} + \frac{x}{y}\right)\right), 2\right) \]
        7. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(-1 \cdot \frac{z}{y} + \frac{x}{y}\right)\right), 2\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x}{y} + -1 \cdot \frac{z}{y}\right)\right), 2\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{z}{y}\right)\right)\right)\right), 2\right) \]
        10. unsub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x}{y} - \frac{z}{y}\right)\right), 2\right) \]
        11. div-subN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right), 2\right) \]
        12. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(x - z\right), y\right)\right), 2\right) \]
        13. --lowering--.f6480.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, z\right), y\right)\right), 2\right) \]
      11. Simplified80.6%

        \[\leadsto \frac{\color{blue}{\left(x + z\right) \cdot \frac{x - z}{y}}}{2} \]

      if 9.50000000000000049e82 < y

      1. Initial program 40.3%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified79.1%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y - \frac{{z}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{{z}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left({z}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left(z \cdot z\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6486.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right), 2\right) \]
      7. Simplified86.4%

        \[\leadsto \frac{\color{blue}{y - \frac{z \cdot z}{y}}}{2} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), z\right)\right), 2\right) \]
        4. /-lowering-/.f6490.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), z\right)\right), 2\right) \]
      9. Applied egg-rr90.6%

        \[\leadsto \frac{y - \color{blue}{\frac{z}{y} \cdot z}}{2} \]
      10. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        2. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{1}{\frac{y}{z}}\right)\right), 2\right) \]
        3. un-div-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{\frac{y}{z}}\right)\right), 2\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{1}{\frac{\frac{y}{z}}{z}}\right)\right), 2\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(1, \left(\frac{\frac{y}{z}}{z}\right)\right)\right), 2\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{y}{z}\right), z\right)\right)\right), 2\right) \]
        7. /-lowering-/.f6490.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, z\right), z\right)\right)\right), 2\right) \]
      11. Applied egg-rr90.7%

        \[\leadsto \frac{y - \color{blue}{\frac{1}{\frac{\frac{y}{z}}{z}}}}{2} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification82.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{+82}:\\ \;\;\;\;\frac{\left(x + z\right) \cdot \frac{x - z}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + \frac{-1}{\frac{\frac{y}{z}}{z}}}{2}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 76.6% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 9.8 \cdot 10^{+78}:\\ \;\;\;\;\frac{\left(x + z\right) \cdot \frac{x - z}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{z}{\frac{y}{z}}}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 9.8e+78)
       (/ (* (+ x z) (/ (- x z) y)) 2.0)
       (/ (- y (/ z (/ y z))) 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 9.8e+78) {
    		tmp = ((x + z) * ((x - z) / y)) / 2.0;
    	} else {
    		tmp = (y - (z / (y / z))) / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 9.8d+78) then
            tmp = ((x + z) * ((x - z) / y)) / 2.0d0
        else
            tmp = (y - (z / (y / z))) / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 9.8e+78) {
    		tmp = ((x + z) * ((x - z) / y)) / 2.0;
    	} else {
    		tmp = (y - (z / (y / z))) / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 9.8e+78:
    		tmp = ((x + z) * ((x - z) / y)) / 2.0
    	else:
    		tmp = (y - (z / (y / z))) / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 9.8e+78)
    		tmp = Float64(Float64(Float64(x + z) * Float64(Float64(x - z) / y)) / 2.0);
    	else
    		tmp = Float64(Float64(y - Float64(z / Float64(y / z))) / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 9.8e+78)
    		tmp = ((x + z) * ((x - z) / y)) / 2.0;
    	else
    		tmp = (y - (z / (y / z))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 9.8e+78], N[(N[(N[(x + z), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(y - N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 9.8 \cdot 10^{+78}:\\
    \;\;\;\;\frac{\left(x + z\right) \cdot \frac{x - z}{y}}{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y - \frac{z}{\frac{y}{z}}}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 9.8000000000000004e78

      1. Initial program 78.9%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified83.8%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. difference-of-squaresN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{\left(x + z\right) \cdot \left(x - z\right)}{y}\right)\right), 2\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\left(x + z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(x - z\right), y\right)\right)\right), 2\right) \]
        6. --lowering--.f6499.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, z\right), y\right)\right)\right), 2\right) \]
      6. Applied egg-rr99.9%

        \[\leadsto \frac{y + \color{blue}{\left(x + z\right) \cdot \frac{x - z}{y}}}{2} \]
      7. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\left(x + z\right) \cdot \frac{1}{\frac{y}{x - z}}\right)\right), 2\right) \]
        2. un-div-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{x + z}{\frac{y}{x - z}}\right)\right), 2\right) \]
        3. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{1}{\frac{\frac{y}{x - z}}{x + z}}\right)\right), 2\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \left(\frac{\frac{y}{x - z}}{x + z}\right)\right)\right), 2\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{y}{x - z}\right), \left(x + z\right)\right)\right)\right), 2\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x - z\right)\right), \left(x + z\right)\right)\right)\right), 2\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(x, z\right)\right), \left(x + z\right)\right)\right)\right), 2\right) \]
        8. +-lowering-+.f6499.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(x, z\right)\right), \mathsf{+.f64}\left(x, z\right)\right)\right)\right), 2\right) \]
      8. Applied egg-rr99.8%

        \[\leadsto \frac{y + \color{blue}{\frac{1}{\frac{\frac{y}{x - z}}{x + z}}}}{2} \]
      9. Taylor expanded in y around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(x + z\right) \cdot \left(x - z\right)}{y}\right)}, 2\right) \]
      10. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \frac{x - z}{y}\right), 2\right) \]
        2. div-subN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(\frac{x}{y} - \frac{z}{y}\right)\right), 2\right) \]
        3. unsub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{z}{y}\right)\right)\right)\right), 2\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(\frac{x}{y} + -1 \cdot \frac{z}{y}\right)\right), 2\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(x + z\right) \cdot \left(-1 \cdot \frac{z}{y} + \frac{x}{y}\right)\right), 2\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(x + z\right), \left(-1 \cdot \frac{z}{y} + \frac{x}{y}\right)\right), 2\right) \]
        7. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(-1 \cdot \frac{z}{y} + \frac{x}{y}\right)\right), 2\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x}{y} + -1 \cdot \frac{z}{y}\right)\right), 2\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{z}{y}\right)\right)\right)\right), 2\right) \]
        10. unsub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x}{y} - \frac{z}{y}\right)\right), 2\right) \]
        11. div-subN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right), 2\right) \]
        12. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(x - z\right), y\right)\right), 2\right) \]
        13. --lowering--.f6480.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, z\right), y\right)\right), 2\right) \]
      11. Simplified80.5%

        \[\leadsto \frac{\color{blue}{\left(x + z\right) \cdot \frac{x - z}{y}}}{2} \]

      if 9.8000000000000004e78 < y

      1. Initial program 41.6%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified79.5%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y - \frac{{z}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{{z}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left({z}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left(z \cdot z\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6486.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right), 2\right) \]
      7. Simplified86.7%

        \[\leadsto \frac{\color{blue}{y - \frac{z \cdot z}{y}}}{2} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), z\right)\right), 2\right) \]
        4. /-lowering-/.f6490.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), z\right)\right), 2\right) \]
      9. Applied egg-rr90.8%

        \[\leadsto \frac{y - \color{blue}{\frac{z}{y} \cdot z}}{2} \]
      10. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(y - \frac{z}{y} \cdot z\right), \color{blue}{2}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{1}{\frac{y}{z}}\right)\right), 2\right) \]
        5. un-div-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{\frac{y}{z}}\right)\right), 2\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(z, \left(\frac{y}{z}\right)\right)\right), 2\right) \]
        7. /-lowering-/.f6490.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{/.f64}\left(y, z\right)\right)\right), 2\right) \]
      11. Applied egg-rr90.8%

        \[\leadsto \color{blue}{\frac{y - \frac{z}{\frac{y}{z}}}{2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 76.6% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{+72}:\\ \;\;\;\;\frac{x + z}{\frac{y}{x - z}} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{z}{\frac{y}{z}}}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 3.2e+72)
       (* (/ (+ x z) (/ y (- x z))) 0.5)
       (/ (- y (/ z (/ y z))) 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 3.2e+72) {
    		tmp = ((x + z) / (y / (x - z))) * 0.5;
    	} else {
    		tmp = (y - (z / (y / z))) / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 3.2d+72) then
            tmp = ((x + z) / (y / (x - z))) * 0.5d0
        else
            tmp = (y - (z / (y / z))) / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 3.2e+72) {
    		tmp = ((x + z) / (y / (x - z))) * 0.5;
    	} else {
    		tmp = (y - (z / (y / z))) / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 3.2e+72:
    		tmp = ((x + z) / (y / (x - z))) * 0.5
    	else:
    		tmp = (y - (z / (y / z))) / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 3.2e+72)
    		tmp = Float64(Float64(Float64(x + z) / Float64(y / Float64(x - z))) * 0.5);
    	else
    		tmp = Float64(Float64(y - Float64(z / Float64(y / z))) / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 3.2e+72)
    		tmp = ((x + z) / (y / (x - z))) * 0.5;
    	else
    		tmp = (y - (z / (y / z))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 3.2e+72], N[(N[(N[(x + z), $MachinePrecision] / N[(y / N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(y - N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 3.2 \cdot 10^{+72}:\\
    \;\;\;\;\frac{x + z}{\frac{y}{x - z}} \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y - \frac{z}{\frac{y}{z}}}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 3.2000000000000001e72

      1. Initial program 78.9%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified83.8%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in y around 0

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{{x}^{2} - {z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left({x}^{2} - {z}^{2}\right)}{\color{blue}{y}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\left({x}^{2} - {z}^{2}\right) \cdot \frac{1}{2}}{y} \]
        3. associate-/l*N/A

          \[\leadsto \left({x}^{2} - {z}^{2}\right) \cdot \color{blue}{\frac{\frac{1}{2}}{y}} \]
        4. metadata-evalN/A

          \[\leadsto \left({x}^{2} - {z}^{2}\right) \cdot \frac{\frac{1}{2} \cdot 1}{y} \]
        5. associate-*r/N/A

          \[\leadsto \left({x}^{2} - {z}^{2}\right) \cdot \left(\frac{1}{2} \cdot \color{blue}{\frac{1}{y}}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} - {z}^{2}\right), \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{y}\right)}\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left({x}^{2}\right), \left({z}^{2}\right)\right), \left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{y}\right)\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(x \cdot x\right), \left({z}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({z}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        10. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(z \cdot z\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        12. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{y}}\right)\right) \]
        13. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \left(\frac{\frac{1}{2}}{y}\right)\right) \]
        14. /-lowering-/.f6468.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{y}\right)\right) \]
      7. Simplified68.3%

        \[\leadsto \color{blue}{\left(x \cdot x - z \cdot z\right) \cdot \frac{0.5}{y}} \]
      8. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \left(x \cdot x - z \cdot z\right) \cdot \frac{1}{\color{blue}{\frac{y}{\frac{1}{2}}}} \]
        2. associate-*r/N/A

          \[\leadsto \frac{\left(x \cdot x - z \cdot z\right) \cdot 1}{\color{blue}{\frac{y}{\frac{1}{2}}}} \]
        3. div-invN/A

          \[\leadsto \frac{\left(x \cdot x - z \cdot z\right) \cdot 1}{y \cdot \color{blue}{\frac{1}{\frac{1}{2}}}} \]
        4. metadata-evalN/A

          \[\leadsto \frac{\left(x \cdot x - z \cdot z\right) \cdot 1}{y \cdot 2} \]
        5. times-fracN/A

          \[\leadsto \frac{x \cdot x - z \cdot z}{y} \cdot \color{blue}{\frac{1}{2}} \]
        6. difference-of-squaresN/A

          \[\leadsto \frac{\left(x + z\right) \cdot \left(x - z\right)}{y} \cdot \frac{1}{2} \]
        7. associate-*r/N/A

          \[\leadsto \left(\left(x + z\right) \cdot \frac{x - z}{y}\right) \cdot \frac{\color{blue}{1}}{2} \]
        8. metadata-evalN/A

          \[\leadsto \left(\left(x + z\right) \cdot \frac{x - z}{y}\right) \cdot \frac{1}{2} \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\left(x + z\right) \cdot \frac{x - z}{y}\right), \color{blue}{\frac{1}{2}}\right) \]
        10. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(\left(\left(x + z\right) \cdot \frac{1}{\frac{y}{x - z}}\right), \frac{1}{2}\right) \]
        11. un-div-invN/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{x + z}{\frac{y}{x - z}}\right), \frac{1}{2}\right) \]
        12. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x + z\right), \left(\frac{y}{x - z}\right)\right), \frac{1}{2}\right) \]
        13. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{y}{x - z}\right)\right), \frac{1}{2}\right) \]
        14. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(y, \left(x - z\right)\right)\right), \frac{1}{2}\right) \]
        15. --lowering--.f6480.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(x, z\right)\right)\right), \frac{1}{2}\right) \]
      9. Applied egg-rr80.5%

        \[\leadsto \color{blue}{\frac{x + z}{\frac{y}{x - z}} \cdot 0.5} \]

      if 3.2000000000000001e72 < y

      1. Initial program 41.6%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified79.5%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y - \frac{{z}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{{z}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left({z}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left(z \cdot z\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6486.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right), 2\right) \]
      7. Simplified86.7%

        \[\leadsto \frac{\color{blue}{y - \frac{z \cdot z}{y}}}{2} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), z\right)\right), 2\right) \]
        4. /-lowering-/.f6490.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), z\right)\right), 2\right) \]
      9. Applied egg-rr90.8%

        \[\leadsto \frac{y - \color{blue}{\frac{z}{y} \cdot z}}{2} \]
      10. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(y - \frac{z}{y} \cdot z\right), \color{blue}{2}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{1}{\frac{y}{z}}\right)\right), 2\right) \]
        5. un-div-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{\frac{y}{z}}\right)\right), 2\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(z, \left(\frac{y}{z}\right)\right)\right), 2\right) \]
        7. /-lowering-/.f6490.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{/.f64}\left(y, z\right)\right)\right), 2\right) \]
      11. Applied egg-rr90.8%

        \[\leadsto \color{blue}{\frac{y - \frac{z}{\frac{y}{z}}}{2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 69.0% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{+44}:\\ \;\;\;\;\left(x \cdot x - z \cdot z\right) \cdot \frac{0.5}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 9.5e+44)
       (* (- (* x x) (* z z)) (/ 0.5 y))
       (/ (- y (* z (/ z y))) 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 9.5e+44) {
    		tmp = ((x * x) - (z * z)) * (0.5 / y);
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 9.5d+44) then
            tmp = ((x * x) - (z * z)) * (0.5d0 / y)
        else
            tmp = (y - (z * (z / y))) / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 9.5e+44) {
    		tmp = ((x * x) - (z * z)) * (0.5 / y);
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 9.5e+44:
    		tmp = ((x * x) - (z * z)) * (0.5 / y)
    	else:
    		tmp = (y - (z * (z / y))) / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 9.5e+44)
    		tmp = Float64(Float64(Float64(x * x) - Float64(z * z)) * Float64(0.5 / y));
    	else
    		tmp = Float64(Float64(y - Float64(z * Float64(z / y))) / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 9.5e+44)
    		tmp = ((x * x) - (z * z)) * (0.5 / y);
    	else
    		tmp = (y - (z * (z / y))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 9.5e+44], N[(N[(N[(x * x), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(0.5 / y), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 9.5 \cdot 10^{+44}:\\
    \;\;\;\;\left(x \cdot x - z \cdot z\right) \cdot \frac{0.5}{y}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 9.5000000000000004e44

      1. Initial program 78.5%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified83.5%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in y around 0

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{{x}^{2} - {z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left({x}^{2} - {z}^{2}\right)}{\color{blue}{y}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\left({x}^{2} - {z}^{2}\right) \cdot \frac{1}{2}}{y} \]
        3. associate-/l*N/A

          \[\leadsto \left({x}^{2} - {z}^{2}\right) \cdot \color{blue}{\frac{\frac{1}{2}}{y}} \]
        4. metadata-evalN/A

          \[\leadsto \left({x}^{2} - {z}^{2}\right) \cdot \frac{\frac{1}{2} \cdot 1}{y} \]
        5. associate-*r/N/A

          \[\leadsto \left({x}^{2} - {z}^{2}\right) \cdot \left(\frac{1}{2} \cdot \color{blue}{\frac{1}{y}}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left({x}^{2} - {z}^{2}\right), \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{y}\right)}\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left({x}^{2}\right), \left({z}^{2}\right)\right), \left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{y}\right)\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(x \cdot x\right), \left({z}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({z}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        10. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(z \cdot z\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \left(\frac{1}{2} \cdot \frac{1}{y}\right)\right) \]
        12. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{y}}\right)\right) \]
        13. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \left(\frac{\frac{1}{2}}{y}\right)\right) \]
        14. /-lowering-/.f6467.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(z, z\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{y}\right)\right) \]
      7. Simplified67.7%

        \[\leadsto \color{blue}{\left(x \cdot x - z \cdot z\right) \cdot \frac{0.5}{y}} \]

      if 9.5000000000000004e44 < y

      1. Initial program 46.2%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified81.1%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y - \frac{{z}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{{z}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left({z}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left(z \cdot z\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6484.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right), 2\right) \]
      7. Simplified84.1%

        \[\leadsto \frac{\color{blue}{y - \frac{z \cdot z}{y}}}{2} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), z\right)\right), 2\right) \]
        4. /-lowering-/.f6487.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), z\right)\right), 2\right) \]
      9. Applied egg-rr87.9%

        \[\leadsto \frac{y - \color{blue}{\frac{z}{y} \cdot z}}{2} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification71.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{+44}:\\ \;\;\;\;\left(x \cdot x - z \cdot z\right) \cdot \frac{0.5}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 82.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+76}:\\ \;\;\;\;\frac{y + \frac{x \cdot x}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= (* z z) 5e+76)
       (/ (+ y (/ (* x x) y)) 2.0)
       (/ (- y (* z (/ z y))) 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((z * z) <= 5e+76) {
    		tmp = (y + ((x * x) / y)) / 2.0;
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if ((z * z) <= 5d+76) then
            tmp = (y + ((x * x) / y)) / 2.0d0
        else
            tmp = (y - (z * (z / y))) / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((z * z) <= 5e+76) {
    		tmp = (y + ((x * x) / y)) / 2.0;
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (z * z) <= 5e+76:
    		tmp = (y + ((x * x) / y)) / 2.0
    	else:
    		tmp = (y - (z * (z / y))) / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (Float64(z * z) <= 5e+76)
    		tmp = Float64(Float64(y + Float64(Float64(x * x) / y)) / 2.0);
    	else
    		tmp = Float64(Float64(y - Float64(z * Float64(z / y))) / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((z * z) <= 5e+76)
    		tmp = (y + ((x * x) / y)) / 2.0;
    	else
    		tmp = (y - (z * (z / y))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+76], N[(N[(y + N[(N[(x * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(y - N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+76}:\\
    \;\;\;\;\frac{y + \frac{x \cdot x}{y}}{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z z) < 4.99999999999999991e76

      1. Initial program 76.0%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified92.4%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y + \frac{{x}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{{x}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(\left({x}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(\left(x \cdot x\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6485.2%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), y\right)\right), 2\right) \]
      7. Simplified85.2%

        \[\leadsto \frac{\color{blue}{y + \frac{x \cdot x}{y}}}{2} \]

      if 4.99999999999999991e76 < (*.f64 z z)

      1. Initial program 67.6%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified72.4%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y - \frac{{z}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{{z}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left({z}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\left(z \cdot z\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6472.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right), 2\right) \]
      7. Simplified72.1%

        \[\leadsto \frac{\color{blue}{y - \frac{z \cdot z}{y}}}{2} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(z \cdot \frac{z}{y}\right)\right), 2\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{z}{y} \cdot z\right)\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), z\right)\right), 2\right) \]
        4. /-lowering-/.f6481.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), z\right)\right), 2\right) \]
      9. Applied egg-rr81.7%

        \[\leadsto \frac{y - \color{blue}{\frac{z}{y} \cdot z}}{2} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification83.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+76}:\\ \;\;\;\;\frac{y + \frac{x \cdot x}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 75.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+183}:\\ \;\;\;\;\frac{y + \frac{x \cdot x}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= (* z z) 5e+183) (/ (+ y (/ (* x x) y)) 2.0) (* z (* (/ z y) -0.5))))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((z * z) <= 5e+183) {
    		tmp = (y + ((x * x) / y)) / 2.0;
    	} else {
    		tmp = z * ((z / y) * -0.5);
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if ((z * z) <= 5d+183) then
            tmp = (y + ((x * x) / y)) / 2.0d0
        else
            tmp = z * ((z / y) * (-0.5d0))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((z * z) <= 5e+183) {
    		tmp = (y + ((x * x) / y)) / 2.0;
    	} else {
    		tmp = z * ((z / y) * -0.5);
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (z * z) <= 5e+183:
    		tmp = (y + ((x * x) / y)) / 2.0
    	else:
    		tmp = z * ((z / y) * -0.5)
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (Float64(z * z) <= 5e+183)
    		tmp = Float64(Float64(y + Float64(Float64(x * x) / y)) / 2.0);
    	else
    		tmp = Float64(z * Float64(Float64(z / y) * -0.5));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((z * z) <= 5e+183)
    		tmp = (y + ((x * x) / y)) / 2.0;
    	else
    		tmp = z * ((z / y) * -0.5);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+183], N[(N[(y + N[(N[(x * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(z * N[(N[(z / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+183}:\\
    \;\;\;\;\frac{y + \frac{x \cdot x}{y}}{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z z) < 5.00000000000000009e183

      1. Initial program 76.5%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified91.4%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y + \frac{{x}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{{x}^{2}}{y}\right)\right), 2\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(\left({x}^{2}\right), y\right)\right), 2\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(\left(x \cdot x\right), y\right)\right), 2\right) \]
        4. *-lowering-*.f6479.2%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), y\right)\right), 2\right) \]
      7. Simplified79.2%

        \[\leadsto \frac{\color{blue}{y + \frac{x \cdot x}{y}}}{2} \]

      if 5.00000000000000009e183 < (*.f64 z z)

      1. Initial program 64.1%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified68.3%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{{z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{{z}^{2}}{y} \cdot \color{blue}{\frac{-1}{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{z \cdot z}{y} \cdot \frac{-1}{2} \]
        3. associate-/l*N/A

          \[\leadsto \left(z \cdot \frac{z}{y}\right) \cdot \frac{-1}{2} \]
        4. associate-*l*N/A

          \[\leadsto z \cdot \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
        7. /-lowering-/.f6472.5%

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), \frac{-1}{2}\right)\right) \]
      7. Simplified72.5%

        \[\leadsto \color{blue}{z \cdot \left(\frac{z}{y} \cdot -0.5\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 52.3% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{-20}:\\ \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{x}{y}}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= (* x x) 1e-20) (* z (* (/ z y) -0.5)) (/ (* x (/ x y)) 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((x * x) <= 1e-20) {
    		tmp = z * ((z / y) * -0.5);
    	} else {
    		tmp = (x * (x / y)) / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if ((x * x) <= 1d-20) then
            tmp = z * ((z / y) * (-0.5d0))
        else
            tmp = (x * (x / y)) / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((x * x) <= 1e-20) {
    		tmp = z * ((z / y) * -0.5);
    	} else {
    		tmp = (x * (x / y)) / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (x * x) <= 1e-20:
    		tmp = z * ((z / y) * -0.5)
    	else:
    		tmp = (x * (x / y)) / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (Float64(x * x) <= 1e-20)
    		tmp = Float64(z * Float64(Float64(z / y) * -0.5));
    	else
    		tmp = Float64(Float64(x * Float64(x / y)) / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((x * x) <= 1e-20)
    		tmp = z * ((z / y) * -0.5);
    	else
    		tmp = (x * (x / y)) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e-20], N[(z * N[(N[(z / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot x \leq 10^{-20}:\\
    \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x \cdot \frac{x}{y}}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 x x) < 9.99999999999999945e-21

      1. Initial program 76.9%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified93.1%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{{z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{{z}^{2}}{y} \cdot \color{blue}{\frac{-1}{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{z \cdot z}{y} \cdot \frac{-1}{2} \]
        3. associate-/l*N/A

          \[\leadsto \left(z \cdot \frac{z}{y}\right) \cdot \frac{-1}{2} \]
        4. associate-*l*N/A

          \[\leadsto z \cdot \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
        7. /-lowering-/.f6456.3%

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), \frac{-1}{2}\right)\right) \]
      7. Simplified56.3%

        \[\leadsto \color{blue}{z \cdot \left(\frac{z}{y} \cdot -0.5\right)} \]

      if 9.99999999999999945e-21 < (*.f64 x x)

      1. Initial program 67.6%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified73.8%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around inf

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{{x}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2}\right), y\right), 2\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x \cdot x\right), y\right), 2\right) \]
        3. *-lowering-*.f6459.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), y\right), 2\right) \]
      7. Simplified59.3%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot x}{y}}}{2} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \frac{x}{y}\right), 2\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y} \cdot x\right), 2\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{x}{y}\right), x\right), 2\right) \]
        4. /-lowering-/.f6462.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), x\right), 2\right) \]
      9. Applied egg-rr62.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{y} \cdot x}}{2} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification59.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{-20}:\\ \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{x}{y}}{2}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 52.3% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{-20}:\\ \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{\frac{y}{x}}{x}}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= (* x x) 1e-20) (* z (* (/ z y) -0.5)) (/ 0.5 (/ (/ y x) x))))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((x * x) <= 1e-20) {
    		tmp = z * ((z / y) * -0.5);
    	} else {
    		tmp = 0.5 / ((y / x) / x);
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if ((x * x) <= 1d-20) then
            tmp = z * ((z / y) * (-0.5d0))
        else
            tmp = 0.5d0 / ((y / x) / x)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((x * x) <= 1e-20) {
    		tmp = z * ((z / y) * -0.5);
    	} else {
    		tmp = 0.5 / ((y / x) / x);
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (x * x) <= 1e-20:
    		tmp = z * ((z / y) * -0.5)
    	else:
    		tmp = 0.5 / ((y / x) / x)
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (Float64(x * x) <= 1e-20)
    		tmp = Float64(z * Float64(Float64(z / y) * -0.5));
    	else
    		tmp = Float64(0.5 / Float64(Float64(y / x) / x));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((x * x) <= 1e-20)
    		tmp = z * ((z / y) * -0.5);
    	else
    		tmp = 0.5 / ((y / x) / x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e-20], N[(z * N[(N[(z / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot x \leq 10^{-20}:\\
    \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{0.5}{\frac{\frac{y}{x}}{x}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 x x) < 9.99999999999999945e-21

      1. Initial program 76.9%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified93.1%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{{z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{{z}^{2}}{y} \cdot \color{blue}{\frac{-1}{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{z \cdot z}{y} \cdot \frac{-1}{2} \]
        3. associate-/l*N/A

          \[\leadsto \left(z \cdot \frac{z}{y}\right) \cdot \frac{-1}{2} \]
        4. associate-*l*N/A

          \[\leadsto z \cdot \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
        7. /-lowering-/.f6456.3%

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), \frac{-1}{2}\right)\right) \]
      7. Simplified56.3%

        \[\leadsto \color{blue}{z \cdot \left(\frac{z}{y} \cdot -0.5\right)} \]

      if 9.99999999999999945e-21 < (*.f64 x x)

      1. Initial program 67.6%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified73.8%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around inf

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{{x}^{2}}{y}\right)}, 2\right) \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2}\right), y\right), 2\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x \cdot x\right), y\right), 2\right) \]
        3. *-lowering-*.f6459.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), y\right), 2\right) \]
      7. Simplified59.3%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot x}{y}}}{2} \]
      8. Step-by-step derivation
        1. div-invN/A

          \[\leadsto \frac{x \cdot x}{y} \cdot \color{blue}{\frac{1}{2}} \]
        2. clear-numN/A

          \[\leadsto \frac{1}{\frac{y}{x \cdot x}} \cdot \frac{\color{blue}{1}}{2} \]
        3. metadata-evalN/A

          \[\leadsto \frac{1}{\frac{y}{x \cdot x}} \cdot \frac{1}{2} \]
        4. associate-*l/N/A

          \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{y}{x \cdot x}}} \]
        5. metadata-evalN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{y}}{x \cdot x}} \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{y}{x \cdot x}\right)}\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f6459.3%

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      9. Applied egg-rr59.3%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{x \cdot x}}} \]
      10. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \left(\frac{\frac{y}{x}}{\color{blue}{x}}\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{x}\right)\right) \]
        3. /-lowering-/.f6461.9%

          \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), x\right)\right) \]
      11. Applied egg-rr61.9%

        \[\leadsto \frac{0.5}{\color{blue}{\frac{\frac{y}{x}}{x}}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 43.0% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 7.5 \cdot 10^{+110}:\\ \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{2}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 7.5e+110) (* z (* (/ z y) -0.5)) (/ y 2.0)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 7.5e+110) {
    		tmp = z * ((z / y) * -0.5);
    	} else {
    		tmp = y / 2.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 7.5d+110) then
            tmp = z * ((z / y) * (-0.5d0))
        else
            tmp = y / 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 7.5e+110) {
    		tmp = z * ((z / y) * -0.5);
    	} else {
    		tmp = y / 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 7.5e+110:
    		tmp = z * ((z / y) * -0.5)
    	else:
    		tmp = y / 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 7.5e+110)
    		tmp = Float64(z * Float64(Float64(z / y) * -0.5));
    	else
    		tmp = Float64(y / 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 7.5e+110)
    		tmp = z * ((z / y) * -0.5);
    	else
    		tmp = y / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 7.5e+110], N[(z * N[(N[(z / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(y / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 7.5 \cdot 10^{+110}:\\
    \;\;\;\;z \cdot \left(\frac{z}{y} \cdot -0.5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 7.5e110

      1. Initial program 78.6%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified83.4%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{{z}^{2}}{y}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{{z}^{2}}{y} \cdot \color{blue}{\frac{-1}{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{z \cdot z}{y} \cdot \frac{-1}{2} \]
        3. associate-/l*N/A

          \[\leadsto \left(z \cdot \frac{z}{y}\right) \cdot \frac{-1}{2} \]
        4. associate-*l*N/A

          \[\leadsto z \cdot \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\frac{z}{y}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
        7. /-lowering-/.f6440.6%

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), \frac{-1}{2}\right)\right) \]
      7. Simplified40.6%

        \[\leadsto \color{blue}{z \cdot \left(\frac{z}{y} \cdot -0.5\right)} \]

      if 7.5e110 < y

      1. Initial program 36.4%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
      3. Simplified81.0%

        \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
      4. Add Preprocessing
      5. Taylor expanded in y around inf

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, 2\right) \]
      6. Step-by-step derivation
        1. Simplified79.3%

          \[\leadsto \frac{\color{blue}{y}}{2} \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 12: 43.0% accurate, 1.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 6.5 \cdot 10^{+110}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{2}\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y 6.5e+110) (* z (* z (/ -0.5 y))) (/ y 2.0)))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= 6.5e+110) {
      		tmp = z * (z * (-0.5 / y));
      	} else {
      		tmp = y / 2.0;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: tmp
          if (y <= 6.5d+110) then
              tmp = z * (z * ((-0.5d0) / y))
          else
              tmp = y / 2.0d0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (y <= 6.5e+110) {
      		tmp = z * (z * (-0.5 / y));
      	} else {
      		tmp = y / 2.0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if y <= 6.5e+110:
      		tmp = z * (z * (-0.5 / y))
      	else:
      		tmp = y / 2.0
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= 6.5e+110)
      		tmp = Float64(z * Float64(z * Float64(-0.5 / y)));
      	else
      		tmp = Float64(y / 2.0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (y <= 6.5e+110)
      		tmp = z * (z * (-0.5 / y));
      	else
      		tmp = y / 2.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[y, 6.5e+110], N[(z * N[(z * N[(-0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / 2.0), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq 6.5 \cdot 10^{+110}:\\
      \;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{2}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 6.4999999999999997e110

        1. Initial program 78.6%

          \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
        2. Step-by-step derivation
          1. associate-/r*N/A

            \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
        3. Simplified83.4%

          \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. difference-of-squaresN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\frac{\left(x + z\right) \cdot \left(x - z\right)}{y}\right)\right), 2\right) \]
          2. associate-/l*N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\right), 2\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\left(x + z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right)\right), 2\right) \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(x - z\right), y\right)\right)\right), 2\right) \]
          6. --lowering--.f6499.9%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(y, \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, z\right), y\right)\right)\right), 2\right) \]
        6. Applied egg-rr99.9%

          \[\leadsto \frac{y + \color{blue}{\left(x + z\right) \cdot \frac{x - z}{y}}}{2} \]
        7. Taylor expanded in z around inf

          \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{{z}^{2}}{y}} \]
        8. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{{z}^{2}}{y} \cdot \color{blue}{\frac{-1}{2}} \]
          2. unpow2N/A

            \[\leadsto \frac{z \cdot z}{y} \cdot \frac{-1}{2} \]
          3. associate-/l*N/A

            \[\leadsto \left(z \cdot \frac{z}{y}\right) \cdot \frac{-1}{2} \]
          4. associate-*r*N/A

            \[\leadsto z \cdot \color{blue}{\left(\frac{z}{y} \cdot \frac{-1}{2}\right)} \]
          5. *-commutativeN/A

            \[\leadsto z \cdot \left(\frac{-1}{2} \cdot \color{blue}{\frac{z}{y}}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{-1}{2} \cdot \frac{z}{y}\right)}\right) \]
          7. associate-*r/N/A

            \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\frac{-1}{2} \cdot z}{\color{blue}{y}}\right)\right) \]
          8. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot z\right), \color{blue}{y}\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\left(z \cdot \frac{-1}{2}\right), y\right)\right) \]
          10. *-lowering-*.f6440.6%

            \[\leadsto \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \frac{-1}{2}\right), y\right)\right) \]
        9. Simplified40.6%

          \[\leadsto \color{blue}{z \cdot \frac{z \cdot -0.5}{y}} \]
        10. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto \mathsf{*.f64}\left(z, \left(z \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\frac{-1}{2}}{y} \cdot \color{blue}{z}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\frac{\frac{-1}{2}}{y}\right), \color{blue}{z}\right)\right) \]
          4. /-lowering-/.f6440.5%

            \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, y\right), z\right)\right) \]
        11. Applied egg-rr40.5%

          \[\leadsto z \cdot \color{blue}{\left(\frac{-0.5}{y} \cdot z\right)} \]

        if 6.4999999999999997e110 < y

        1. Initial program 36.4%

          \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
        2. Step-by-step derivation
          1. associate-/r*N/A

            \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
        3. Simplified81.0%

          \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
        4. Add Preprocessing
        5. Taylor expanded in y around inf

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, 2\right) \]
        6. Step-by-step derivation
          1. Simplified79.3%

            \[\leadsto \frac{\color{blue}{y}}{2} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification46.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.5 \cdot 10^{+110}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{2}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 13: 34.4% accurate, 5.0× speedup?

        \[\begin{array}{l} \\ \frac{y}{2} \end{array} \]
        (FPCore (x y z) :precision binary64 (/ y 2.0))
        double code(double x, double y, double z) {
        	return y / 2.0;
        }
        
        real(8) function code(x, y, z)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            code = y / 2.0d0
        end function
        
        public static double code(double x, double y, double z) {
        	return y / 2.0;
        }
        
        def code(x, y, z):
        	return y / 2.0
        
        function code(x, y, z)
        	return Float64(y / 2.0)
        end
        
        function tmp = code(x, y, z)
        	tmp = y / 2.0;
        end
        
        code[x_, y_, z_] := N[(y / 2.0), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \frac{y}{2}
        \end{array}
        
        Derivation
        1. Initial program 72.0%

          \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
        2. Step-by-step derivation
          1. associate-/r*N/A

            \[\leadsto \frac{\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}}{\color{blue}{2}} \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}\right), \color{blue}{2}\right) \]
        3. Simplified83.0%

          \[\leadsto \color{blue}{\frac{y + \frac{x \cdot x - z \cdot z}{y}}{2}} \]
        4. Add Preprocessing
        5. Taylor expanded in y around inf

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, 2\right) \]
        6. Step-by-step derivation
          1. Simplified30.2%

            \[\leadsto \frac{\color{blue}{y}}{2} \]
          2. Add Preprocessing

          Developer Target 1: 99.8% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right) \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x))))
          double code(double x, double y, double z) {
          	return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
          }
          
          real(8) function code(x, y, z)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              code = (y * 0.5d0) - (((0.5d0 / y) * (z + x)) * (z - x))
          end function
          
          public static double code(double x, double y, double z) {
          	return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
          }
          
          def code(x, y, z):
          	return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x))
          
          function code(x, y, z)
          	return Float64(Float64(y * 0.5) - Float64(Float64(Float64(0.5 / y) * Float64(z + x)) * Float64(z - x)))
          end
          
          function tmp = code(x, y, z)
          	tmp = (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
          end
          
          code[x_, y_, z_] := N[(N[(y * 0.5), $MachinePrecision] - N[(N[(N[(0.5 / y), $MachinePrecision] * N[(z + x), $MachinePrecision]), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right)
          \end{array}
          

          Reproduce

          ?
          herbie shell --seed 2024145 
          (FPCore (x y z)
            :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
            :precision binary64
          
            :alt
            (! :herbie-platform default (- (* y 1/2) (* (* (/ 1/2 y) (+ z x)) (- z x))))
          
            (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))