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

Percentage Accurate: 69.3% → 99.9%
Time: 10.0s
Alternatives: 9
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 9 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: 69.3% 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} x_m = \left|x\right| \\ \frac{y + \left(z + x\_m\right) \cdot \frac{x\_m - z}{y}}{2} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y z)
 :precision binary64
 (/ (+ y (* (+ z x_m) (/ (- x_m z) y))) 2.0))
x_m = fabs(x);
double code(double x_m, double y, double z) {
	return (y + ((z + x_m) * ((x_m - z) / y))) / 2.0;
}
x_m = abs(x)
real(8) function code(x_m, y, z)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (y + ((z + x_m) * ((x_m - z) / y))) / 2.0d0
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z) {
	return (y + ((z + x_m) * ((x_m - z) / y))) / 2.0;
}
x_m = math.fabs(x)
def code(x_m, y, z):
	return (y + ((z + x_m) * ((x_m - z) / y))) / 2.0
x_m = abs(x)
function code(x_m, y, z)
	return Float64(Float64(y + Float64(Float64(z + x_m) * Float64(Float64(x_m - z) / y))) / 2.0)
end
x_m = abs(x);
function tmp = code(x_m, y, z)
	tmp = (y + ((z + x_m) * ((x_m - z) / y))) / 2.0;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_, z_] := N[(N[(y + N[(N[(z + x$95$m), $MachinePrecision] * N[(N[(x$95$m - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|

\\
\frac{y + \left(z + x\_m\right) \cdot \frac{x\_m - z}{y}}{2}
\end{array}
Derivation
  1. Initial program 68.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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(z + x\right) \cdot \left(z - x\right)}{y}\right)\right), 2\right) \]
    2. associate-/l*N/A

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

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

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

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

    \[\leadsto \frac{y - \color{blue}{\left(z + x\right) \cdot \frac{z - x}{y}}}{2} \]
  7. Final simplification99.9%

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

Alternative 2: 87.2% accurate, 0.8× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \cdot x\_m \leq 2 \cdot 10^{-105}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x\_m \cdot \frac{x\_m - z}{y}}{2}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y z)
 :precision binary64
 (if (<= (* x_m x_m) 2e-105)
   (/ (- y (* z (/ z y))) 2.0)
   (/ (+ y (* x_m (/ (- x_m z) y))) 2.0)))
x_m = fabs(x);
double code(double x_m, double y, double z) {
	double tmp;
	if ((x_m * x_m) <= 2e-105) {
		tmp = (y - (z * (z / y))) / 2.0;
	} else {
		tmp = (y + (x_m * ((x_m - z) / y))) / 2.0;
	}
	return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y, z)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x_m * x_m) <= 2d-105) then
        tmp = (y - (z * (z / y))) / 2.0d0
    else
        tmp = (y + (x_m * ((x_m - z) / y))) / 2.0d0
    end if
    code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z) {
	double tmp;
	if ((x_m * x_m) <= 2e-105) {
		tmp = (y - (z * (z / y))) / 2.0;
	} else {
		tmp = (y + (x_m * ((x_m - z) / y))) / 2.0;
	}
	return tmp;
}
x_m = math.fabs(x)
def code(x_m, y, z):
	tmp = 0
	if (x_m * x_m) <= 2e-105:
		tmp = (y - (z * (z / y))) / 2.0
	else:
		tmp = (y + (x_m * ((x_m - z) / y))) / 2.0
	return tmp
x_m = abs(x)
function code(x_m, y, z)
	tmp = 0.0
	if (Float64(x_m * x_m) <= 2e-105)
		tmp = Float64(Float64(y - Float64(z * Float64(z / y))) / 2.0);
	else
		tmp = Float64(Float64(y + Float64(x_m * Float64(Float64(x_m - z) / y))) / 2.0);
	end
	return tmp
end
x_m = abs(x);
function tmp_2 = code(x_m, y, z)
	tmp = 0.0;
	if ((x_m * x_m) <= 2e-105)
		tmp = (y - (z * (z / y))) / 2.0;
	else
		tmp = (y + (x_m * ((x_m - z) / y))) / 2.0;
	end
	tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_, z_] := If[LessEqual[N[(x$95$m * x$95$m), $MachinePrecision], 2e-105], N[(N[(y - N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(y + N[(x$95$m * N[(N[(x$95$m - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
\mathbf{if}\;x\_m \cdot x\_m \leq 2 \cdot 10^{-105}:\\
\;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{y + x\_m \cdot \frac{x\_m - z}{y}}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 1.99999999999999993e-105

    1. Initial program 68.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{*.f64}\left(x, x\right)\right), y\right)\right), 2\right) \]
    3. Simplified92.8%

      \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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-*.f6490.8%

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

      \[\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-/.f6495.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-rr95.7%

      \[\leadsto \frac{y - \color{blue}{\frac{z}{y} \cdot z}}{2} \]

    if 1.99999999999999993e-105 < (*.f64 x x)

    1. Initial program 68.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{*.f64}\left(x, x\right)\right), y\right)\right), 2\right) \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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(z + x\right) \cdot \left(z - x\right)}{y}\right)\right), 2\right) \]
      2. associate-/l*N/A

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{*.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, x\right), y\right)\right)\right), 2\right) \]
    8. Step-by-step derivation
      1. Simplified80.1%

        \[\leadsto \frac{y - \color{blue}{x} \cdot \frac{z - x}{y}}{2} \]
    9. Recombined 2 regimes into one program.
    10. Final simplification86.9%

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

    Alternative 3: 76.9% accurate, 0.9× speedup?

    \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;y \leq 5.4 \cdot 10^{+44}:\\ \;\;\;\;\frac{\left(z + x\_m\right) \cdot \frac{x\_m - z}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \end{array} \end{array} \]
    x_m = (fabs.f64 x)
    (FPCore (x_m y z)
     :precision binary64
     (if (<= y 5.4e+44)
       (/ (* (+ z x_m) (/ (- x_m z) y)) 2.0)
       (/ (- y (* z (/ z y))) 2.0)))
    x_m = fabs(x);
    double code(double x_m, double y, double z) {
    	double tmp;
    	if (y <= 5.4e+44) {
    		tmp = ((z + x_m) * ((x_m - z) / y)) / 2.0;
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    x_m = abs(x)
    real(8) function code(x_m, y, z)
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 5.4d+44) then
            tmp = ((z + x_m) * ((x_m - z) / y)) / 2.0d0
        else
            tmp = (y - (z * (z / y))) / 2.0d0
        end if
        code = tmp
    end function
    
    x_m = Math.abs(x);
    public static double code(double x_m, double y, double z) {
    	double tmp;
    	if (y <= 5.4e+44) {
    		tmp = ((z + x_m) * ((x_m - z) / y)) / 2.0;
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    x_m = math.fabs(x)
    def code(x_m, y, z):
    	tmp = 0
    	if y <= 5.4e+44:
    		tmp = ((z + x_m) * ((x_m - z) / y)) / 2.0
    	else:
    		tmp = (y - (z * (z / y))) / 2.0
    	return tmp
    
    x_m = abs(x)
    function code(x_m, y, z)
    	tmp = 0.0
    	if (y <= 5.4e+44)
    		tmp = Float64(Float64(Float64(z + x_m) * Float64(Float64(x_m - z) / y)) / 2.0);
    	else
    		tmp = Float64(Float64(y - Float64(z * Float64(z / y))) / 2.0);
    	end
    	return tmp
    end
    
    x_m = abs(x);
    function tmp_2 = code(x_m, y, z)
    	tmp = 0.0;
    	if (y <= 5.4e+44)
    		tmp = ((z + x_m) * ((x_m - z) / y)) / 2.0;
    	else
    		tmp = (y - (z * (z / y))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    x_m = N[Abs[x], $MachinePrecision]
    code[x$95$m_, y_, z_] := If[LessEqual[y, 5.4e+44], N[(N[(N[(z + x$95$m), $MachinePrecision] * N[(N[(x$95$m - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(y - N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    x_m = \left|x\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 5.4 \cdot 10^{+44}:\\
    \;\;\;\;\frac{\left(z + x\_m\right) \cdot \frac{x\_m - z}{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 y < 5.4e44

      1. Initial program 73.8%

        \[\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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, z\right), \left(\frac{x - z}{y}\right)\right), 2\right) \]
        7. /-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) \]
        8. --lowering--.f6475.9%

          \[\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) \]
      7. Simplified75.9%

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

      if 5.4e44 < y

      1. Initial program 50.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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-*.f6478.9%

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

        \[\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-/.f6488.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-rr88.8%

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

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

    Alternative 4: 76.8% accurate, 0.9× speedup?

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

      1. Initial program 73.8%

        \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(z, x\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(x, z\right), \mathsf{/.f64}\left(\left(\frac{1}{2}\right), \color{blue}{y}\right)\right)\right) \]
        12. metadata-eval75.9%

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

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

      if 7.50000000000000027e44 < y

      1. Initial program 50.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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-*.f6478.9%

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

        \[\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-/.f6488.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-rr88.8%

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

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

    Alternative 5: 85.4% accurate, 0.9× speedup?

    \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+17}:\\ \;\;\;\;\frac{y + x\_m \cdot \frac{x\_m}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z \cdot \frac{z}{y}}{2}\\ \end{array} \end{array} \]
    x_m = (fabs.f64 x)
    (FPCore (x_m y z)
     :precision binary64
     (if (<= (* z z) 2e+17)
       (/ (+ y (* x_m (/ x_m y))) 2.0)
       (/ (- y (* z (/ z y))) 2.0)))
    x_m = fabs(x);
    double code(double x_m, double y, double z) {
    	double tmp;
    	if ((z * z) <= 2e+17) {
    		tmp = (y + (x_m * (x_m / y))) / 2.0;
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    x_m = abs(x)
    real(8) function code(x_m, y, z)
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if ((z * z) <= 2d+17) then
            tmp = (y + (x_m * (x_m / y))) / 2.0d0
        else
            tmp = (y - (z * (z / y))) / 2.0d0
        end if
        code = tmp
    end function
    
    x_m = Math.abs(x);
    public static double code(double x_m, double y, double z) {
    	double tmp;
    	if ((z * z) <= 2e+17) {
    		tmp = (y + (x_m * (x_m / y))) / 2.0;
    	} else {
    		tmp = (y - (z * (z / y))) / 2.0;
    	}
    	return tmp;
    }
    
    x_m = math.fabs(x)
    def code(x_m, y, z):
    	tmp = 0
    	if (z * z) <= 2e+17:
    		tmp = (y + (x_m * (x_m / y))) / 2.0
    	else:
    		tmp = (y - (z * (z / y))) / 2.0
    	return tmp
    
    x_m = abs(x)
    function code(x_m, y, z)
    	tmp = 0.0
    	if (Float64(z * z) <= 2e+17)
    		tmp = Float64(Float64(y + Float64(x_m * Float64(x_m / y))) / 2.0);
    	else
    		tmp = Float64(Float64(y - Float64(z * Float64(z / y))) / 2.0);
    	end
    	return tmp
    end
    
    x_m = abs(x);
    function tmp_2 = code(x_m, y, z)
    	tmp = 0.0;
    	if ((z * z) <= 2e+17)
    		tmp = (y + (x_m * (x_m / y))) / 2.0;
    	else
    		tmp = (y - (z * (z / y))) / 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    x_m = N[Abs[x], $MachinePrecision]
    code[x$95$m_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+17], N[(N[(y + N[(x$95$m * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(y - N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
    
    \begin{array}{l}
    x_m = \left|x\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+17}:\\
    \;\;\;\;\frac{y + x\_m \cdot \frac{x\_m}{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) < 2e17

      1. Initial program 68.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{*.f64}\left(x, x\right)\right), y\right)\right), 2\right) \]
      3. Simplified90.0%

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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-*.f6482.5%

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

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

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

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

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

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

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

      if 2e17 < (*.f64 z z)

      1. Initial program 67.8%

        \[\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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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-*.f6480.6%

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

        \[\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.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-rr87.6%

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

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

    Alternative 6: 80.2% accurate, 0.9× speedup?

    \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 10^{+293}:\\ \;\;\;\;\frac{y + x\_m \cdot \frac{x\_m}{y}}{2}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \end{array} \end{array} \]
    x_m = (fabs.f64 x)
    (FPCore (x_m y z)
     :precision binary64
     (if (<= (* z z) 1e+293)
       (/ (+ y (* x_m (/ x_m y))) 2.0)
       (* z (/ (* z -0.5) y))))
    x_m = fabs(x);
    double code(double x_m, double y, double z) {
    	double tmp;
    	if ((z * z) <= 1e+293) {
    		tmp = (y + (x_m * (x_m / y))) / 2.0;
    	} else {
    		tmp = z * ((z * -0.5) / y);
    	}
    	return tmp;
    }
    
    x_m = abs(x)
    real(8) function code(x_m, y, z)
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if ((z * z) <= 1d+293) then
            tmp = (y + (x_m * (x_m / y))) / 2.0d0
        else
            tmp = z * ((z * (-0.5d0)) / y)
        end if
        code = tmp
    end function
    
    x_m = Math.abs(x);
    public static double code(double x_m, double y, double z) {
    	double tmp;
    	if ((z * z) <= 1e+293) {
    		tmp = (y + (x_m * (x_m / y))) / 2.0;
    	} else {
    		tmp = z * ((z * -0.5) / y);
    	}
    	return tmp;
    }
    
    x_m = math.fabs(x)
    def code(x_m, y, z):
    	tmp = 0
    	if (z * z) <= 1e+293:
    		tmp = (y + (x_m * (x_m / y))) / 2.0
    	else:
    		tmp = z * ((z * -0.5) / y)
    	return tmp
    
    x_m = abs(x)
    function code(x_m, y, z)
    	tmp = 0.0
    	if (Float64(z * z) <= 1e+293)
    		tmp = Float64(Float64(y + Float64(x_m * Float64(x_m / y))) / 2.0);
    	else
    		tmp = Float64(z * Float64(Float64(z * -0.5) / y));
    	end
    	return tmp
    end
    
    x_m = abs(x);
    function tmp_2 = code(x_m, y, z)
    	tmp = 0.0;
    	if ((z * z) <= 1e+293)
    		tmp = (y + (x_m * (x_m / y))) / 2.0;
    	else
    		tmp = z * ((z * -0.5) / y);
    	end
    	tmp_2 = tmp;
    end
    
    x_m = N[Abs[x], $MachinePrecision]
    code[x$95$m_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+293], N[(N[(y + N[(x$95$m * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    x_m = \left|x\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot z \leq 10^{+293}:\\
    \;\;\;\;\frac{y + x\_m \cdot \frac{x\_m}{y}}{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z z) < 9.9999999999999992e292

      1. Initial program 70.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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-*.f6473.9%

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

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

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

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

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

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

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

      if 9.9999999999999992e292 < (*.f64 z z)

      1. Initial program 63.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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. associate-*r/N/A

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

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(-1 \cdot {z}^{2}\right)}{y} \]
        4. mul-1-negN/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\mathsf{neg}\left({z}^{2}\right)\right)}{y} \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(\mathsf{neg}\left({z}^{2}\right)\right)\right), \color{blue}{y}\right) \]
        6. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot -1\right) \cdot {z}^{2}\right), y\right) \]
        8. metadata-evalN/A

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

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

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

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

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

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

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

          \[\leadsto z \cdot \color{blue}{\frac{z \cdot \frac{-1}{2}}{y}} \]
        3. *-lowering-*.f64N/A

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

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

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

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

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

    Alternative 7: 44.0% accurate, 1.2× speedup?

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

      1. Initial program 74.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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. associate-*r/N/A

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

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(-1 \cdot {z}^{2}\right)}{y} \]
        4. mul-1-negN/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\mathsf{neg}\left({z}^{2}\right)\right)}{y} \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(\mathsf{neg}\left({z}^{2}\right)\right)\right), \color{blue}{y}\right) \]
        6. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot -1\right) \cdot {z}^{2}\right), y\right) \]
        8. metadata-evalN/A

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

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

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

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

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

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

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

          \[\leadsto z \cdot \color{blue}{\frac{z \cdot \frac{-1}{2}}{y}} \]
        3. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{z \cdot -0.5}{y}} \]
      10. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto z \cdot \frac{1}{\color{blue}{\frac{y}{z \cdot \frac{-1}{2}}}} \]
        2. un-div-invN/A

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

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

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

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

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

      if 1.20000000000000007e44 < y

      1. Initial program 49.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{*.f64}\left(x, x\right)\right), y\right)\right), 2\right) \]
      3. Simplified79.0%

        \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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. Simplified78.3%

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

      Alternative 8: 44.0% accurate, 1.2× speedup?

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

        1. Initial program 74.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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. associate-*r/N/A

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

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

            \[\leadsto \frac{\frac{1}{2} \cdot \left(-1 \cdot {z}^{2}\right)}{y} \]
          4. mul-1-negN/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\mathsf{neg}\left({z}^{2}\right)\right)}{y} \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(\mathsf{neg}\left({z}^{2}\right)\right)\right), \color{blue}{y}\right) \]
          6. mul-1-negN/A

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

            \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot -1\right) \cdot {z}^{2}\right), y\right) \]
          8. metadata-evalN/A

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

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

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

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

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

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

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

            \[\leadsto z \cdot \color{blue}{\frac{z \cdot \frac{-1}{2}}{y}} \]
          3. *-lowering-*.f64N/A

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

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

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

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

        if 2.09999999999999987e44 < y

        1. Initial program 49.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{*.f64}\left(x, x\right)\right), y\right)\right), 2\right) \]
        3. Simplified79.0%

          \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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. Simplified78.3%

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

        Alternative 9: 34.8% accurate, 5.0× speedup?

        \[\begin{array}{l} x_m = \left|x\right| \\ \frac{y}{2} \end{array} \]
        x_m = (fabs.f64 x)
        (FPCore (x_m y z) :precision binary64 (/ y 2.0))
        x_m = fabs(x);
        double code(double x_m, double y, double z) {
        	return y / 2.0;
        }
        
        x_m = abs(x)
        real(8) function code(x_m, y, z)
            real(8), intent (in) :: x_m
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            code = y / 2.0d0
        end function
        
        x_m = Math.abs(x);
        public static double code(double x_m, double y, double z) {
        	return y / 2.0;
        }
        
        x_m = math.fabs(x)
        def code(x_m, y, z):
        	return y / 2.0
        
        x_m = abs(x)
        function code(x_m, y, z)
        	return Float64(y / 2.0)
        end
        
        x_m = abs(x);
        function tmp = code(x_m, y, z)
        	tmp = y / 2.0;
        end
        
        x_m = N[Abs[x], $MachinePrecision]
        code[x$95$m_, y_, z_] := N[(y / 2.0), $MachinePrecision]
        
        \begin{array}{l}
        x_m = \left|x\right|
        
        \\
        \frac{y}{2}
        \end{array}
        
        Derivation
        1. Initial program 68.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{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. Simplified37.9%

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

          Developer Target 1: 99.9% 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 2024158 
          (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)))