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

Percentage Accurate: 68.7% → 99.9%
Time: 8.7s
Alternatives: 14
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 14 alternatives:

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

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

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

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
  2. Step-by-step derivation
    1. sub-neg71.5%

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

      \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
    3. neg-sub071.5%

      \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
    4. associate-+l-71.5%

      \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
    5. sub0-neg71.5%

      \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
    6. neg-mul-171.5%

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
    7. *-commutative71.5%

      \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
    8. times-frac71.5%

      \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
    9. associate--r+71.5%

      \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
    10. div-sub71.5%

      \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
    11. difference-of-squares76.7%

      \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
    12. +-commutative76.7%

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

      \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
    14. associate-/l*99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
    15. *-inverses99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
    16. /-rgt-identity99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
    17. metadata-eval99.9%

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

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

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

Alternative 2: 53.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-156}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;x \cdot x \leq 10^{-73}:\\
\;\;\;\;\frac{-0.5 \cdot \left(z \cdot z\right)}{y}\\

\mathbf{elif}\;x \cdot x \leq 10^{+72}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\


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

    1. Initial program 72.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in z around inf 56.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow256.5%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. associate-*r/56.5%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    4. Simplified56.5%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    5. Step-by-step derivation
      1. clear-num56.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{-0.5 \cdot \left(z \cdot z\right)}}} \]
      2. inv-pow56.5%

        \[\leadsto \color{blue}{{\left(\frac{y}{-0.5 \cdot \left(z \cdot z\right)}\right)}^{-1}} \]
      3. *-un-lft-identity56.5%

        \[\leadsto {\left(\frac{\color{blue}{1 \cdot y}}{-0.5 \cdot \left(z \cdot z\right)}\right)}^{-1} \]
      4. times-frac56.5%

        \[\leadsto {\color{blue}{\left(\frac{1}{-0.5} \cdot \frac{y}{z \cdot z}\right)}}^{-1} \]
      5. metadata-eval56.5%

        \[\leadsto {\left(\color{blue}{-2} \cdot \frac{y}{z \cdot z}\right)}^{-1} \]
    6. Applied egg-rr56.5%

      \[\leadsto \color{blue}{{\left(-2 \cdot \frac{y}{z \cdot z}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-156.5%

        \[\leadsto \color{blue}{\frac{1}{-2 \cdot \frac{y}{z \cdot z}}} \]
      2. associate-/r*56.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{-2}}{\frac{y}{z \cdot z}}} \]
      3. metadata-eval56.5%

        \[\leadsto \frac{\color{blue}{-0.5}}{\frac{y}{z \cdot z}} \]
      4. associate-/r*57.7%

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{\frac{y}{z}}{z}}} \]
    8. Simplified57.7%

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

    if 2.0000000000000001e-209 < (*.f64 x x) < 5.00000000000000007e-156 or 9.99999999999999997e-74 < (*.f64 x x) < 9.99999999999999944e71

    1. Initial program 61.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in y around inf 66.9%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
    3. Step-by-step derivation
      1. *-commutative66.9%

        \[\leadsto \color{blue}{y \cdot 0.5} \]
    4. Simplified66.9%

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

    if 5.00000000000000007e-156 < (*.f64 x x) < 9.99999999999999997e-74

    1. Initial program 95.0%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in z around inf 71.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow271.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. associate-*r/71.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    4. Simplified71.0%

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

    if 9.99999999999999944e71 < (*.f64 x x)

    1. Initial program 70.4%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 62.3%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow262.3%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified62.3%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Taylor expanded in x around 0 62.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow262.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y} \]
      2. *-commutative62.3%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y} \cdot 0.5} \]
      3. associate-/l*67.3%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{x}}} \cdot 0.5 \]
    7. Simplified67.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-209}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-156}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \cdot x \leq 10^{-73}:\\ \;\;\;\;\frac{-0.5 \cdot \left(z \cdot z\right)}{y}\\ \mathbf{elif}\;x \cdot x \leq 10^{+72}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \end{array} \]

Alternative 3: 53.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{if}\;x \leq -2.4 \cdot 10^{+79}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -3.55 \cdot 10^{-37}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+30}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* x (/ 0.5 y)))))
   (if (<= x -2.4e+79)
     t_0
     (if (<= x -3.55e-37)
       (* y 0.5)
       (if (<= x 3.5e-105)
         (* z (/ (* z -0.5) y))
         (if (<= x 4.1e+30) (* y 0.5) t_0))))))
double code(double x, double y, double z) {
	double t_0 = x * (x * (0.5 / y));
	double tmp;
	if (x <= -2.4e+79) {
		tmp = t_0;
	} else if (x <= -3.55e-37) {
		tmp = y * 0.5;
	} else if (x <= 3.5e-105) {
		tmp = z * ((z * -0.5) / y);
	} else if (x <= 4.1e+30) {
		tmp = y * 0.5;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x * (x * (0.5d0 / y))
    if (x <= (-2.4d+79)) then
        tmp = t_0
    else if (x <= (-3.55d-37)) then
        tmp = y * 0.5d0
    else if (x <= 3.5d-105) then
        tmp = z * ((z * (-0.5d0)) / y)
    else if (x <= 4.1d+30) then
        tmp = y * 0.5d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (x * (0.5 / y));
	double tmp;
	if (x <= -2.4e+79) {
		tmp = t_0;
	} else if (x <= -3.55e-37) {
		tmp = y * 0.5;
	} else if (x <= 3.5e-105) {
		tmp = z * ((z * -0.5) / y);
	} else if (x <= 4.1e+30) {
		tmp = y * 0.5;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (x * (0.5 / y))
	tmp = 0
	if x <= -2.4e+79:
		tmp = t_0
	elif x <= -3.55e-37:
		tmp = y * 0.5
	elif x <= 3.5e-105:
		tmp = z * ((z * -0.5) / y)
	elif x <= 4.1e+30:
		tmp = y * 0.5
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(x * Float64(0.5 / y)))
	tmp = 0.0
	if (x <= -2.4e+79)
		tmp = t_0;
	elseif (x <= -3.55e-37)
		tmp = Float64(y * 0.5);
	elseif (x <= 3.5e-105)
		tmp = Float64(z * Float64(Float64(z * -0.5) / y));
	elseif (x <= 4.1e+30)
		tmp = Float64(y * 0.5);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (x * (0.5 / y));
	tmp = 0.0;
	if (x <= -2.4e+79)
		tmp = t_0;
	elseif (x <= -3.55e-37)
		tmp = y * 0.5;
	elseif (x <= 3.5e-105)
		tmp = z * ((z * -0.5) / y);
	elseif (x <= 4.1e+30)
		tmp = y * 0.5;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+79], t$95$0, If[LessEqual[x, -3.55e-37], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 3.5e-105], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e+30], N[(y * 0.5), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+79}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq -3.55 \cdot 10^{-37}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-105}:\\
\;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{+30}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.39999999999999986e79 or 4.10000000000000005e30 < x

    1. Initial program 70.5%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 63.1%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow263.1%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified63.1%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac68.2%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv68.2%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval68.2%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr68.2%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 63.1%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative63.1%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow263.1%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/68.2%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*68.2%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/68.2%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity68.2%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac68.1%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity68.1%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified68.1%

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

    if -2.39999999999999986e79 < x < -3.54999999999999989e-37 or 3.5e-105 < x < 4.10000000000000005e30

    1. Initial program 66.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in y around inf 58.1%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
    3. Step-by-step derivation
      1. *-commutative58.1%

        \[\leadsto \color{blue}{y \cdot 0.5} \]
    4. Simplified58.1%

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

    if -3.54999999999999989e-37 < x < 3.5e-105

    1. Initial program 74.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in z around inf 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    4. Simplified59.0%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    5. Taylor expanded in z around 0 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. metadata-eval59.0%

        \[\leadsto \color{blue}{\frac{-0.5}{1}} \cdot \frac{z \cdot z}{y} \]
      3. times-frac59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{1 \cdot y}} \]
      4. *-commutative59.0%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z\right) \cdot -0.5}}{1 \cdot y} \]
      5. associate-*l*59.0%

        \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot -0.5\right)}}{1 \cdot y} \]
      6. *-commutative59.0%

        \[\leadsto \frac{z \cdot \color{blue}{\left(-0.5 \cdot z\right)}}{1 \cdot y} \]
      7. times-frac60.0%

        \[\leadsto \color{blue}{\frac{z}{1} \cdot \frac{-0.5 \cdot z}{y}} \]
      8. /-rgt-identity60.0%

        \[\leadsto \color{blue}{z} \cdot \frac{-0.5 \cdot z}{y} \]
      9. *-commutative60.0%

        \[\leadsto z \cdot \frac{\color{blue}{z \cdot -0.5}}{y} \]
    7. Simplified60.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+79}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{elif}\;x \leq -3.55 \cdot 10^{-37}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+30}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 4: 53.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+79}:\\ \;\;\;\;\frac{x}{y} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-38}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+28}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -3.4e+79)
   (* (/ x y) (* x 0.5))
   (if (<= x -3e-38)
     (* y 0.5)
     (if (<= x 6.5e-105)
       (* z (/ (* z -0.5) y))
       (if (<= x 1.1e+28) (* y 0.5) (* x (* x (/ 0.5 y))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -3.4e+79) {
		tmp = (x / y) * (x * 0.5);
	} else if (x <= -3e-38) {
		tmp = y * 0.5;
	} else if (x <= 6.5e-105) {
		tmp = z * ((z * -0.5) / y);
	} else if (x <= 1.1e+28) {
		tmp = y * 0.5;
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-3.4d+79)) then
        tmp = (x / y) * (x * 0.5d0)
    else if (x <= (-3d-38)) then
        tmp = y * 0.5d0
    else if (x <= 6.5d-105) then
        tmp = z * ((z * (-0.5d0)) / y)
    else if (x <= 1.1d+28) then
        tmp = y * 0.5d0
    else
        tmp = x * (x * (0.5d0 / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -3.4e+79) {
		tmp = (x / y) * (x * 0.5);
	} else if (x <= -3e-38) {
		tmp = y * 0.5;
	} else if (x <= 6.5e-105) {
		tmp = z * ((z * -0.5) / y);
	} else if (x <= 1.1e+28) {
		tmp = y * 0.5;
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -3.4e+79:
		tmp = (x / y) * (x * 0.5)
	elif x <= -3e-38:
		tmp = y * 0.5
	elif x <= 6.5e-105:
		tmp = z * ((z * -0.5) / y)
	elif x <= 1.1e+28:
		tmp = y * 0.5
	else:
		tmp = x * (x * (0.5 / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -3.4e+79)
		tmp = Float64(Float64(x / y) * Float64(x * 0.5));
	elseif (x <= -3e-38)
		tmp = Float64(y * 0.5);
	elseif (x <= 6.5e-105)
		tmp = Float64(z * Float64(Float64(z * -0.5) / y));
	elseif (x <= 1.1e+28)
		tmp = Float64(y * 0.5);
	else
		tmp = Float64(x * Float64(x * Float64(0.5 / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -3.4e+79)
		tmp = (x / y) * (x * 0.5);
	elseif (x <= -3e-38)
		tmp = y * 0.5;
	elseif (x <= 6.5e-105)
		tmp = z * ((z * -0.5) / y);
	elseif (x <= 1.1e+28)
		tmp = y * 0.5;
	else
		tmp = x * (x * (0.5 / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -3.4e+79], N[(N[(x / y), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e-38], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 6.5e-105], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e+28], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{y} \cdot \left(x \cdot 0.5\right)\\

\mathbf{elif}\;x \leq -3 \cdot 10^{-38}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{-105}:\\
\;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+28}:\\
\;\;\;\;y \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.40000000000000032e79

    1. Initial program 73.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 69.0%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified69.0%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac74.4%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv74.4%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval74.4%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr74.4%

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

    if -3.40000000000000032e79 < x < -2.99999999999999989e-38 or 6.50000000000000006e-105 < x < 1.09999999999999993e28

    1. Initial program 66.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in y around inf 58.1%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
    3. Step-by-step derivation
      1. *-commutative58.1%

        \[\leadsto \color{blue}{y \cdot 0.5} \]
    4. Simplified58.1%

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

    if -2.99999999999999989e-38 < x < 6.50000000000000006e-105

    1. Initial program 74.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in z around inf 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    4. Simplified59.0%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    5. Taylor expanded in z around 0 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. metadata-eval59.0%

        \[\leadsto \color{blue}{\frac{-0.5}{1}} \cdot \frac{z \cdot z}{y} \]
      3. times-frac59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{1 \cdot y}} \]
      4. *-commutative59.0%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z\right) \cdot -0.5}}{1 \cdot y} \]
      5. associate-*l*59.0%

        \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot -0.5\right)}}{1 \cdot y} \]
      6. *-commutative59.0%

        \[\leadsto \frac{z \cdot \color{blue}{\left(-0.5 \cdot z\right)}}{1 \cdot y} \]
      7. times-frac60.0%

        \[\leadsto \color{blue}{\frac{z}{1} \cdot \frac{-0.5 \cdot z}{y}} \]
      8. /-rgt-identity60.0%

        \[\leadsto \color{blue}{z} \cdot \frac{-0.5 \cdot z}{y} \]
      9. *-commutative60.0%

        \[\leadsto z \cdot \frac{\color{blue}{z \cdot -0.5}}{y} \]
    7. Simplified60.0%

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

    if 1.09999999999999993e28 < x

    1. Initial program 68.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 58.6%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow258.6%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified58.6%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac63.4%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv63.4%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval63.4%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr63.4%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 58.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative58.6%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow258.6%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/63.4%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*63.4%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/63.4%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity63.4%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac63.4%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity63.4%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified63.4%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \frac{0.5}{y}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+79}:\\ \;\;\;\;\frac{x}{y} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-38}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+28}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 5: 53.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+79}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq -8.8 \cdot 10^{-39}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 5.7 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+30}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.2e+79)
   (* 0.5 (/ x (/ y x)))
   (if (<= x -8.8e-39)
     (* y 0.5)
     (if (<= x 5.7e-105)
       (* z (/ (* z -0.5) y))
       (if (<= x 1.8e+30) (* y 0.5) (* x (* x (/ 0.5 y))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.2e+79) {
		tmp = 0.5 * (x / (y / x));
	} else if (x <= -8.8e-39) {
		tmp = y * 0.5;
	} else if (x <= 5.7e-105) {
		tmp = z * ((z * -0.5) / y);
	} else if (x <= 1.8e+30) {
		tmp = y * 0.5;
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-2.2d+79)) then
        tmp = 0.5d0 * (x / (y / x))
    else if (x <= (-8.8d-39)) then
        tmp = y * 0.5d0
    else if (x <= 5.7d-105) then
        tmp = z * ((z * (-0.5d0)) / y)
    else if (x <= 1.8d+30) then
        tmp = y * 0.5d0
    else
        tmp = x * (x * (0.5d0 / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.2e+79) {
		tmp = 0.5 * (x / (y / x));
	} else if (x <= -8.8e-39) {
		tmp = y * 0.5;
	} else if (x <= 5.7e-105) {
		tmp = z * ((z * -0.5) / y);
	} else if (x <= 1.8e+30) {
		tmp = y * 0.5;
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.2e+79:
		tmp = 0.5 * (x / (y / x))
	elif x <= -8.8e-39:
		tmp = y * 0.5
	elif x <= 5.7e-105:
		tmp = z * ((z * -0.5) / y)
	elif x <= 1.8e+30:
		tmp = y * 0.5
	else:
		tmp = x * (x * (0.5 / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.2e+79)
		tmp = Float64(0.5 * Float64(x / Float64(y / x)));
	elseif (x <= -8.8e-39)
		tmp = Float64(y * 0.5);
	elseif (x <= 5.7e-105)
		tmp = Float64(z * Float64(Float64(z * -0.5) / y));
	elseif (x <= 1.8e+30)
		tmp = Float64(y * 0.5);
	else
		tmp = Float64(x * Float64(x * Float64(0.5 / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.2e+79)
		tmp = 0.5 * (x / (y / x));
	elseif (x <= -8.8e-39)
		tmp = y * 0.5;
	elseif (x <= 5.7e-105)
		tmp = z * ((z * -0.5) / y);
	elseif (x <= 1.8e+30)
		tmp = y * 0.5;
	else
		tmp = x * (x * (0.5 / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.2e+79], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.8e-39], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 5.7e-105], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e+30], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+79}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\

\mathbf{elif}\;x \leq -8.8 \cdot 10^{-39}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;x \leq 5.7 \cdot 10^{-105}:\\
\;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{+30}:\\
\;\;\;\;y \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.1999999999999999e79

    1. Initial program 73.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 69.0%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified69.0%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Taylor expanded in x around 0 69.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y} \]
      2. *-commutative69.0%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y} \cdot 0.5} \]
      3. associate-/l*74.5%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{x}}} \cdot 0.5 \]
    7. Simplified74.5%

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

    if -2.1999999999999999e79 < x < -8.80000000000000003e-39 or 5.69999999999999963e-105 < x < 1.8000000000000001e30

    1. Initial program 66.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in y around inf 58.1%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
    3. Step-by-step derivation
      1. *-commutative58.1%

        \[\leadsto \color{blue}{y \cdot 0.5} \]
    4. Simplified58.1%

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

    if -8.80000000000000003e-39 < x < 5.69999999999999963e-105

    1. Initial program 74.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in z around inf 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    4. Simplified59.0%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    5. Taylor expanded in z around 0 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. metadata-eval59.0%

        \[\leadsto \color{blue}{\frac{-0.5}{1}} \cdot \frac{z \cdot z}{y} \]
      3. times-frac59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{1 \cdot y}} \]
      4. *-commutative59.0%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z\right) \cdot -0.5}}{1 \cdot y} \]
      5. associate-*l*59.0%

        \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot -0.5\right)}}{1 \cdot y} \]
      6. *-commutative59.0%

        \[\leadsto \frac{z \cdot \color{blue}{\left(-0.5 \cdot z\right)}}{1 \cdot y} \]
      7. times-frac60.0%

        \[\leadsto \color{blue}{\frac{z}{1} \cdot \frac{-0.5 \cdot z}{y}} \]
      8. /-rgt-identity60.0%

        \[\leadsto \color{blue}{z} \cdot \frac{-0.5 \cdot z}{y} \]
      9. *-commutative60.0%

        \[\leadsto z \cdot \frac{\color{blue}{z \cdot -0.5}}{y} \]
    7. Simplified60.0%

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

    if 1.8000000000000001e30 < x

    1. Initial program 68.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 58.6%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow258.6%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified58.6%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac63.4%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv63.4%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval63.4%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr63.4%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 58.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative58.6%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow258.6%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/63.4%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*63.4%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/63.4%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity63.4%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac63.4%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity63.4%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified63.4%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \frac{0.5}{y}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+79}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq -8.8 \cdot 10^{-39}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 5.7 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+30}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 6: 53.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+79}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-40}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-105}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+26}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.5e+79)
   (* 0.5 (/ x (/ y x)))
   (if (<= x -6.5e-40)
     (* y 0.5)
     (if (<= x 4.1e-105)
       (/ -0.5 (/ (/ y z) z))
       (if (<= x 6.2e+26) (* y 0.5) (* x (* x (/ 0.5 y))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.5e+79) {
		tmp = 0.5 * (x / (y / x));
	} else if (x <= -6.5e-40) {
		tmp = y * 0.5;
	} else if (x <= 4.1e-105) {
		tmp = -0.5 / ((y / z) / z);
	} else if (x <= 6.2e+26) {
		tmp = y * 0.5;
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1.5d+79)) then
        tmp = 0.5d0 * (x / (y / x))
    else if (x <= (-6.5d-40)) then
        tmp = y * 0.5d0
    else if (x <= 4.1d-105) then
        tmp = (-0.5d0) / ((y / z) / z)
    else if (x <= 6.2d+26) then
        tmp = y * 0.5d0
    else
        tmp = x * (x * (0.5d0 / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.5e+79) {
		tmp = 0.5 * (x / (y / x));
	} else if (x <= -6.5e-40) {
		tmp = y * 0.5;
	} else if (x <= 4.1e-105) {
		tmp = -0.5 / ((y / z) / z);
	} else if (x <= 6.2e+26) {
		tmp = y * 0.5;
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.5e+79:
		tmp = 0.5 * (x / (y / x))
	elif x <= -6.5e-40:
		tmp = y * 0.5
	elif x <= 4.1e-105:
		tmp = -0.5 / ((y / z) / z)
	elif x <= 6.2e+26:
		tmp = y * 0.5
	else:
		tmp = x * (x * (0.5 / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.5e+79)
		tmp = Float64(0.5 * Float64(x / Float64(y / x)));
	elseif (x <= -6.5e-40)
		tmp = Float64(y * 0.5);
	elseif (x <= 4.1e-105)
		tmp = Float64(-0.5 / Float64(Float64(y / z) / z));
	elseif (x <= 6.2e+26)
		tmp = Float64(y * 0.5);
	else
		tmp = Float64(x * Float64(x * Float64(0.5 / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.5e+79)
		tmp = 0.5 * (x / (y / x));
	elseif (x <= -6.5e-40)
		tmp = y * 0.5;
	elseif (x <= 4.1e-105)
		tmp = -0.5 / ((y / z) / z);
	elseif (x <= 6.2e+26)
		tmp = y * 0.5;
	else
		tmp = x * (x * (0.5 / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.5e+79], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5e-40], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 4.1e-105], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e+26], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+79}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{-40}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{+26}:\\
\;\;\;\;y \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.49999999999999987e79

    1. Initial program 73.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 69.0%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified69.0%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Taylor expanded in x around 0 69.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y} \]
      2. *-commutative69.0%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y} \cdot 0.5} \]
      3. associate-/l*74.5%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{x}}} \cdot 0.5 \]
    7. Simplified74.5%

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

    if -1.49999999999999987e79 < x < -6.4999999999999999e-40 or 4.1000000000000003e-105 < x < 6.1999999999999999e26

    1. Initial program 66.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in y around inf 58.1%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
    3. Step-by-step derivation
      1. *-commutative58.1%

        \[\leadsto \color{blue}{y \cdot 0.5} \]
    4. Simplified58.1%

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

    if -6.4999999999999999e-40 < x < 4.1000000000000003e-105

    1. Initial program 74.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in z around inf 59.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow259.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{z \cdot z}}{y} \]
      2. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    4. Simplified59.0%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z \cdot z\right)}{y}} \]
    5. Step-by-step derivation
      1. clear-num59.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{-0.5 \cdot \left(z \cdot z\right)}}} \]
      2. inv-pow59.0%

        \[\leadsto \color{blue}{{\left(\frac{y}{-0.5 \cdot \left(z \cdot z\right)}\right)}^{-1}} \]
      3. *-un-lft-identity59.0%

        \[\leadsto {\left(\frac{\color{blue}{1 \cdot y}}{-0.5 \cdot \left(z \cdot z\right)}\right)}^{-1} \]
      4. times-frac59.0%

        \[\leadsto {\color{blue}{\left(\frac{1}{-0.5} \cdot \frac{y}{z \cdot z}\right)}}^{-1} \]
      5. metadata-eval59.0%

        \[\leadsto {\left(\color{blue}{-2} \cdot \frac{y}{z \cdot z}\right)}^{-1} \]
    6. Applied egg-rr59.0%

      \[\leadsto \color{blue}{{\left(-2 \cdot \frac{y}{z \cdot z}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-159.0%

        \[\leadsto \color{blue}{\frac{1}{-2 \cdot \frac{y}{z \cdot z}}} \]
      2. associate-/r*59.0%

        \[\leadsto \color{blue}{\frac{\frac{1}{-2}}{\frac{y}{z \cdot z}}} \]
      3. metadata-eval59.0%

        \[\leadsto \frac{\color{blue}{-0.5}}{\frac{y}{z \cdot z}} \]
      4. associate-/r*60.0%

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{\frac{y}{z}}{z}}} \]
    8. Simplified60.0%

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

    if 6.1999999999999999e26 < x

    1. Initial program 68.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 58.6%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow258.6%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified58.6%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac63.4%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv63.4%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval63.4%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr63.4%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 58.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative58.6%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow258.6%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/63.4%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*63.4%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/63.4%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity63.4%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac63.4%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity63.4%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified63.4%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \frac{0.5}{y}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+79}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-40}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-105}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+26}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 7: 85.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+21} \lor \neg \left(y \leq 7.8 \cdot 10^{+68}\right):\\ \;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -1.05e+21) (not (<= y 7.8e+68)))
   (* -0.5 (- (* x (/ (- x) y)) y))
   (* 0.5 (* (+ x z) (/ (- x z) y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.05e+21) || !(y <= 7.8e+68)) {
		tmp = -0.5 * ((x * (-x / y)) - y);
	} else {
		tmp = 0.5 * ((x + z) * ((x - z) / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-1.05d+21)) .or. (.not. (y <= 7.8d+68))) then
        tmp = (-0.5d0) * ((x * (-x / y)) - y)
    else
        tmp = 0.5d0 * ((x + z) * ((x - z) / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.05e+21) || !(y <= 7.8e+68)) {
		tmp = -0.5 * ((x * (-x / y)) - y);
	} else {
		tmp = 0.5 * ((x + z) * ((x - z) / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -1.05e+21) or not (y <= 7.8e+68):
		tmp = -0.5 * ((x * (-x / y)) - y)
	else:
		tmp = 0.5 * ((x + z) * ((x - z) / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -1.05e+21) || !(y <= 7.8e+68))
		tmp = Float64(-0.5 * Float64(Float64(x * Float64(Float64(-x) / y)) - y));
	else
		tmp = Float64(0.5 * Float64(Float64(x + z) * Float64(Float64(x - z) / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -1.05e+21) || ~((y <= 7.8e+68)))
		tmp = -0.5 * ((x * (-x / y)) - y);
	else
		tmp = 0.5 * ((x + z) * ((x - z) / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.05e+21], N[Not[LessEqual[y, 7.8e+68]], $MachinePrecision]], N[(-0.5 * N[(N[(x * N[((-x) / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + z), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+21} \lor \neg \left(y \leq 7.8 \cdot 10^{+68}\right):\\
\;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.05e21 or 7.80000000000000037e68 < y

    1. Initial program 42.2%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg42.2%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-42.2%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg42.2%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-142.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      7. *-commutative42.2%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac42.2%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+42.2%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub42.2%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares46.2%

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

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + z\right) \cdot \frac{z - x}{y} - y\right) \cdot -0.5} \]
    4. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\frac{1}{\frac{y}{z - x}}} - y\right) \cdot -0.5 \]
      2. associate-/r/99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    6. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(z + x\right)} \cdot \left(\frac{1}{y} \cdot \left(z - x\right)\right) - y\right) \cdot -0.5 \]
      2. *-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right) \cdot \left(z + x\right)} - y\right) \cdot -0.5 \]
      3. associate-*l/99.9%

        \[\leadsto \left(\color{blue}{\frac{1 \cdot \left(z - x\right)}{y}} \cdot \left(z + x\right) - y\right) \cdot -0.5 \]
      4. *-un-lft-identity99.9%

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

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

        \[\leadsto \left(\color{blue}{\frac{\left(z - x\right) \cdot \left(z \cdot z - x \cdot x\right)}{y \cdot \left(z - x\right)}} - y\right) \cdot -0.5 \]
    7. Applied egg-rr52.6%

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

        \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{y \cdot \left(z - x\right)}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
      2. *-commutative62.7%

        \[\leadsto \left(\frac{z - x}{\frac{\color{blue}{\left(z - x\right) \cdot y}}{z \cdot z - x \cdot x}} - y\right) \cdot -0.5 \]
    9. Simplified62.7%

      \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{\left(z - x\right) \cdot y}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
    10. Taylor expanded in z around 0 77.8%

      \[\leadsto \left(\color{blue}{-1 \cdot \frac{{x}^{2}}{y}} - y\right) \cdot -0.5 \]
    11. Step-by-step derivation
      1. mul-1-neg77.8%

        \[\leadsto \left(\color{blue}{\left(-\frac{{x}^{2}}{y}\right)} - y\right) \cdot -0.5 \]
      2. unpow277.8%

        \[\leadsto \left(\left(-\frac{\color{blue}{x \cdot x}}{y}\right) - y\right) \cdot -0.5 \]
      3. associate-*l/88.9%

        \[\leadsto \left(\left(-\color{blue}{\frac{x}{y} \cdot x}\right) - y\right) \cdot -0.5 \]
      4. distribute-rgt-neg-out88.9%

        \[\leadsto \left(\color{blue}{\frac{x}{y} \cdot \left(-x\right)} - y\right) \cdot -0.5 \]
    12. Simplified88.9%

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

    if -1.05e21 < y < 7.80000000000000037e68

    1. Initial program 92.6%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2} - {z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow290.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x} - {z}^{2}}{y} \]
      2. unpow290.0%

        \[\leadsto 0.5 \cdot \frac{x \cdot x - \color{blue}{z \cdot z}}{y} \]
      3. difference-of-squares96.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\left(x + z\right) \cdot \left(x - z\right)}}{y} \]
      4. associate-/l*96.7%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x + z}{\frac{y}{x - z}}} \]
      5. +-commutative96.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{z + x}}{\frac{y}{x - z}} \]
    4. Simplified96.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{z + x}{\frac{y}{x - z}}} \]
    5. Taylor expanded in y around 0 96.1%

      \[\leadsto 0.5 \cdot \color{blue}{\frac{\left(x - z\right) \cdot \left(z + x\right)}{y}} \]
    6. Step-by-step derivation
      1. *-commutative96.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\left(z + x\right) \cdot \left(x - z\right)}}{y} \]
      2. associate-*r/96.7%

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

      \[\leadsto 0.5 \cdot \color{blue}{\left(\left(z + x\right) \cdot \frac{x - z}{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+21} \lor \neg \left(y \leq 7.8 \cdot 10^{+68}\right):\\ \;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\\ \end{array} \]

Alternative 8: 85.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.6 \cdot 10^{+20} \lor \neg \left(y \leq 3.3 \cdot 10^{+68}\right):\\ \;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + z}{\frac{y}{x - z}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -9.6e+20) (not (<= y 3.3e+68)))
   (* -0.5 (- (* x (/ (- x) y)) y))
   (* 0.5 (/ (+ x z) (/ y (- x z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -9.6e+20) || !(y <= 3.3e+68)) {
		tmp = -0.5 * ((x * (-x / y)) - y);
	} else {
		tmp = 0.5 * ((x + z) / (y / (x - z)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-9.6d+20)) .or. (.not. (y <= 3.3d+68))) then
        tmp = (-0.5d0) * ((x * (-x / y)) - y)
    else
        tmp = 0.5d0 * ((x + z) / (y / (x - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -9.6e+20) || !(y <= 3.3e+68)) {
		tmp = -0.5 * ((x * (-x / y)) - y);
	} else {
		tmp = 0.5 * ((x + z) / (y / (x - z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -9.6e+20) or not (y <= 3.3e+68):
		tmp = -0.5 * ((x * (-x / y)) - y)
	else:
		tmp = 0.5 * ((x + z) / (y / (x - z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -9.6e+20) || !(y <= 3.3e+68))
		tmp = Float64(-0.5 * Float64(Float64(x * Float64(Float64(-x) / y)) - y));
	else
		tmp = Float64(0.5 * Float64(Float64(x + z) / Float64(y / Float64(x - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -9.6e+20) || ~((y <= 3.3e+68)))
		tmp = -0.5 * ((x * (-x / y)) - y);
	else
		tmp = 0.5 * ((x + z) / (y / (x - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.6e+20], N[Not[LessEqual[y, 3.3e+68]], $MachinePrecision]], N[(-0.5 * N[(N[(x * N[((-x) / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + z), $MachinePrecision] / N[(y / N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+20} \lor \neg \left(y \leq 3.3 \cdot 10^{+68}\right):\\
\;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.6e20 or 3.3e68 < y

    1. Initial program 42.2%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg42.2%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-42.2%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg42.2%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-142.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      7. *-commutative42.2%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac42.2%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+42.2%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub42.2%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares46.2%

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

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + z\right) \cdot \frac{z - x}{y} - y\right) \cdot -0.5} \]
    4. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\frac{1}{\frac{y}{z - x}}} - y\right) \cdot -0.5 \]
      2. associate-/r/99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    6. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(z + x\right)} \cdot \left(\frac{1}{y} \cdot \left(z - x\right)\right) - y\right) \cdot -0.5 \]
      2. *-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right) \cdot \left(z + x\right)} - y\right) \cdot -0.5 \]
      3. associate-*l/99.9%

        \[\leadsto \left(\color{blue}{\frac{1 \cdot \left(z - x\right)}{y}} \cdot \left(z + x\right) - y\right) \cdot -0.5 \]
      4. *-un-lft-identity99.9%

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

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

        \[\leadsto \left(\color{blue}{\frac{\left(z - x\right) \cdot \left(z \cdot z - x \cdot x\right)}{y \cdot \left(z - x\right)}} - y\right) \cdot -0.5 \]
    7. Applied egg-rr52.6%

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

        \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{y \cdot \left(z - x\right)}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
      2. *-commutative62.7%

        \[\leadsto \left(\frac{z - x}{\frac{\color{blue}{\left(z - x\right) \cdot y}}{z \cdot z - x \cdot x}} - y\right) \cdot -0.5 \]
    9. Simplified62.7%

      \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{\left(z - x\right) \cdot y}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
    10. Taylor expanded in z around 0 77.8%

      \[\leadsto \left(\color{blue}{-1 \cdot \frac{{x}^{2}}{y}} - y\right) \cdot -0.5 \]
    11. Step-by-step derivation
      1. mul-1-neg77.8%

        \[\leadsto \left(\color{blue}{\left(-\frac{{x}^{2}}{y}\right)} - y\right) \cdot -0.5 \]
      2. unpow277.8%

        \[\leadsto \left(\left(-\frac{\color{blue}{x \cdot x}}{y}\right) - y\right) \cdot -0.5 \]
      3. associate-*l/88.9%

        \[\leadsto \left(\left(-\color{blue}{\frac{x}{y} \cdot x}\right) - y\right) \cdot -0.5 \]
      4. distribute-rgt-neg-out88.9%

        \[\leadsto \left(\color{blue}{\frac{x}{y} \cdot \left(-x\right)} - y\right) \cdot -0.5 \]
    12. Simplified88.9%

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

    if -9.6e20 < y < 3.3e68

    1. Initial program 92.6%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2} - {z}^{2}}{y}} \]
    3. Step-by-step derivation
      1. unpow290.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x} - {z}^{2}}{y} \]
      2. unpow290.0%

        \[\leadsto 0.5 \cdot \frac{x \cdot x - \color{blue}{z \cdot z}}{y} \]
      3. difference-of-squares96.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\left(x + z\right) \cdot \left(x - z\right)}}{y} \]
      4. associate-/l*96.7%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x + z}{\frac{y}{x - z}}} \]
      5. +-commutative96.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{z + x}}{\frac{y}{x - z}} \]
    4. Simplified96.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.6 \cdot 10^{+20} \lor \neg \left(y \leq 3.3 \cdot 10^{+68}\right):\\ \;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + z}{\frac{y}{x - z}}\\ \end{array} \]

Alternative 9: 86.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{+72}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 9.99999999999999944e71

    1. Initial program 72.5%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg72.5%

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

        \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
      3. neg-sub072.5%

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-72.5%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg72.5%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-172.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      7. *-commutative72.5%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac72.5%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+72.5%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub72.5%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares72.5%

        \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      12. +-commutative72.5%

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

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

      \[\leadsto \left(\color{blue}{\frac{{z}^{2}}{y}} - y\right) \cdot -0.5 \]
    5. Step-by-step derivation
      1. unpow287.6%

        \[\leadsto \left(\frac{\color{blue}{z \cdot z}}{y} - y\right) \cdot -0.5 \]
      2. associate-/l*92.7%

        \[\leadsto \left(\color{blue}{\frac{z}{\frac{y}{z}}} - y\right) \cdot -0.5 \]
    6. Simplified92.7%

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

    if 9.99999999999999944e71 < (*.f64 x x)

    1. Initial program 70.4%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg70.4%

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

        \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
      3. neg-sub070.4%

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-70.4%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg70.4%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-170.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      7. *-commutative70.4%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac70.4%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+70.4%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub70.4%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares81.4%

        \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      12. +-commutative81.4%

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + z\right) \cdot \frac{z - x}{y} - y\right) \cdot -0.5} \]
    4. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\frac{1}{\frac{y}{z - x}}} - y\right) \cdot -0.5 \]
      2. associate-/r/99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    6. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(z + x\right)} \cdot \left(\frac{1}{y} \cdot \left(z - x\right)\right) - y\right) \cdot -0.5 \]
      2. *-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right) \cdot \left(z + x\right)} - y\right) \cdot -0.5 \]
      3. associate-*l/99.9%

        \[\leadsto \left(\color{blue}{\frac{1 \cdot \left(z - x\right)}{y}} \cdot \left(z + x\right) - y\right) \cdot -0.5 \]
      4. *-un-lft-identity99.9%

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

        \[\leadsto \left(\frac{z - x}{y} \cdot \color{blue}{\frac{z \cdot z - x \cdot x}{z - x}} - y\right) \cdot -0.5 \]
      6. frac-times61.5%

        \[\leadsto \left(\color{blue}{\frac{\left(z - x\right) \cdot \left(z \cdot z - x \cdot x\right)}{y \cdot \left(z - x\right)}} - y\right) \cdot -0.5 \]
    7. Applied egg-rr61.5%

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

        \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{y \cdot \left(z - x\right)}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
      2. *-commutative68.7%

        \[\leadsto \left(\frac{z - x}{\frac{\color{blue}{\left(z - x\right) \cdot y}}{z \cdot z - x \cdot x}} - y\right) \cdot -0.5 \]
    9. Simplified68.7%

      \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{\left(z - x\right) \cdot y}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
    10. Taylor expanded in z around 0 72.0%

      \[\leadsto \left(\color{blue}{-1 \cdot \frac{{x}^{2}}{y}} - y\right) \cdot -0.5 \]
    11. Step-by-step derivation
      1. mul-1-neg72.0%

        \[\leadsto \left(\color{blue}{\left(-\frac{{x}^{2}}{y}\right)} - y\right) \cdot -0.5 \]
      2. unpow272.0%

        \[\leadsto \left(\left(-\frac{\color{blue}{x \cdot x}}{y}\right) - y\right) \cdot -0.5 \]
      3. associate-*l/81.8%

        \[\leadsto \left(\left(-\color{blue}{\frac{x}{y} \cdot x}\right) - y\right) \cdot -0.5 \]
      4. distribute-rgt-neg-out81.8%

        \[\leadsto \left(\color{blue}{\frac{x}{y} \cdot \left(-x\right)} - y\right) \cdot -0.5 \]
    12. Simplified81.8%

      \[\leadsto \left(\color{blue}{\frac{x}{y} \cdot \left(-x\right)} - y\right) \cdot -0.5 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{+72}:\\ \;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\ \end{array} \]

Alternative 10: 86.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{+72}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 9.99999999999999944e71

    1. Initial program 72.5%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg72.5%

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

        \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
      3. neg-sub072.5%

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-72.5%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg72.5%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-172.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      7. *-commutative72.5%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac72.5%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+72.5%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub72.5%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares72.5%

        \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      12. +-commutative72.5%

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

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

      \[\leadsto \left(\color{blue}{\frac{{z}^{2}}{y}} - y\right) \cdot -0.5 \]
    5. Step-by-step derivation
      1. unpow287.6%

        \[\leadsto \left(\frac{\color{blue}{z \cdot z}}{y} - y\right) \cdot -0.5 \]
      2. associate-/l*92.7%

        \[\leadsto \left(\color{blue}{\frac{z}{\frac{y}{z}}} - y\right) \cdot -0.5 \]
    6. Simplified92.7%

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

    if 9.99999999999999944e71 < (*.f64 x x)

    1. Initial program 70.4%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg70.4%

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

        \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
      3. neg-sub070.4%

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-70.4%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg70.4%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-170.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      7. *-commutative70.4%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac70.4%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+70.4%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub70.4%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares81.4%

        \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      12. +-commutative81.4%

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + z\right) \cdot \frac{z - x}{y} - y\right) \cdot -0.5} \]
    4. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\frac{1}{\frac{y}{z - x}}} - y\right) \cdot -0.5 \]
      2. associate-/r/99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    6. Taylor expanded in x around inf 72.0%

      \[\leadsto \left(\color{blue}{-1 \cdot \frac{{x}^{2}}{y}} - y\right) \cdot -0.5 \]
    7. Step-by-step derivation
      1. mul-1-neg72.0%

        \[\leadsto \left(\color{blue}{\left(-\frac{{x}^{2}}{y}\right)} - y\right) \cdot -0.5 \]
      2. unpow272.0%

        \[\leadsto \left(\left(-\frac{\color{blue}{x \cdot x}}{y}\right) - y\right) \cdot -0.5 \]
      3. associate-/l*81.8%

        \[\leadsto \left(\left(-\color{blue}{\frac{x}{\frac{y}{x}}}\right) - y\right) \cdot -0.5 \]
      4. distribute-neg-frac81.8%

        \[\leadsto \left(\color{blue}{\frac{-x}{\frac{y}{x}}} - y\right) \cdot -0.5 \]
    8. Simplified81.8%

      \[\leadsto \left(\color{blue}{\frac{-x}{\frac{y}{x}}} - y\right) \cdot -0.5 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{+72}:\\ \;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(\frac{-x}{\frac{y}{x}} - y\right)\\ \end{array} \]

Alternative 11: 80.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.46 \cdot 10^{+80}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+128}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.46e+80)
   (* 0.5 (/ x (/ y x)))
   (if (<= x 1.3e+128) (* -0.5 (- (* z (/ z y)) y)) (* x (* x (/ 0.5 y))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.46e+80) {
		tmp = 0.5 * (x / (y / x));
	} else if (x <= 1.3e+128) {
		tmp = -0.5 * ((z * (z / y)) - y);
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1.46d+80)) then
        tmp = 0.5d0 * (x / (y / x))
    else if (x <= 1.3d+128) then
        tmp = (-0.5d0) * ((z * (z / y)) - y)
    else
        tmp = x * (x * (0.5d0 / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.46e+80) {
		tmp = 0.5 * (x / (y / x));
	} else if (x <= 1.3e+128) {
		tmp = -0.5 * ((z * (z / y)) - y);
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.46e+80:
		tmp = 0.5 * (x / (y / x))
	elif x <= 1.3e+128:
		tmp = -0.5 * ((z * (z / y)) - y)
	else:
		tmp = x * (x * (0.5 / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.46e+80)
		tmp = Float64(0.5 * Float64(x / Float64(y / x)));
	elseif (x <= 1.3e+128)
		tmp = Float64(-0.5 * Float64(Float64(z * Float64(z / y)) - y));
	else
		tmp = Float64(x * Float64(x * Float64(0.5 / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.46e+80)
		tmp = 0.5 * (x / (y / x));
	elseif (x <= 1.3e+128)
		tmp = -0.5 * ((z * (z / y)) - y);
	else
		tmp = x * (x * (0.5 / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.46e+80], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+128], N[(-0.5 * N[(N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{+80}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{+128}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.4599999999999999e80

    1. Initial program 72.2%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 69.8%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow269.8%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified69.8%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Taylor expanded in x around 0 69.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow269.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y} \]
      2. *-commutative69.8%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y} \cdot 0.5} \]
      3. associate-/l*75.5%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{x}}} \cdot 0.5 \]
    7. Simplified75.5%

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

    if -1.4599999999999999e80 < x < 1.3e128

    1. Initial program 73.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg73.9%

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

        \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
      3. neg-sub073.9%

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-73.9%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg73.9%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-173.9%

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

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac73.9%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+73.9%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub73.9%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares73.9%

        \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      12. +-commutative73.9%

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + z\right) \cdot \frac{z - x}{y} - y\right) \cdot -0.5} \]
    4. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\frac{1}{\frac{y}{z - x}}} - y\right) \cdot -0.5 \]
      2. associate-/r/99.8%

        \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\left(x + z\right) \cdot \color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right)} - y\right) \cdot -0.5 \]
    6. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \left(\color{blue}{\left(z + x\right)} \cdot \left(\frac{1}{y} \cdot \left(z - x\right)\right) - y\right) \cdot -0.5 \]
      2. *-commutative99.8%

        \[\leadsto \left(\color{blue}{\left(\frac{1}{y} \cdot \left(z - x\right)\right) \cdot \left(z + x\right)} - y\right) \cdot -0.5 \]
      3. associate-*l/99.9%

        \[\leadsto \left(\color{blue}{\frac{1 \cdot \left(z - x\right)}{y}} \cdot \left(z + x\right) - y\right) \cdot -0.5 \]
      4. *-un-lft-identity99.9%

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

        \[\leadsto \left(\frac{z - x}{y} \cdot \color{blue}{\frac{z \cdot z - x \cdot x}{z - x}} - y\right) \cdot -0.5 \]
      6. frac-times79.7%

        \[\leadsto \left(\color{blue}{\frac{\left(z - x\right) \cdot \left(z \cdot z - x \cdot x\right)}{y \cdot \left(z - x\right)}} - y\right) \cdot -0.5 \]
    7. Applied egg-rr79.7%

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

        \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{y \cdot \left(z - x\right)}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
      2. *-commutative85.6%

        \[\leadsto \left(\frac{z - x}{\frac{\color{blue}{\left(z - x\right) \cdot y}}{z \cdot z - x \cdot x}} - y\right) \cdot -0.5 \]
    9. Simplified85.6%

      \[\leadsto \left(\color{blue}{\frac{z - x}{\frac{\left(z - x\right) \cdot y}{z \cdot z - x \cdot x}}} - y\right) \cdot -0.5 \]
    10. Taylor expanded in z around inf 80.9%

      \[\leadsto \left(\color{blue}{\frac{{z}^{2}}{y}} - y\right) \cdot -0.5 \]
    11. Step-by-step derivation
      1. unpow280.9%

        \[\leadsto \left(\frac{\color{blue}{z \cdot z}}{y} - y\right) \cdot -0.5 \]
      2. *-lft-identity80.9%

        \[\leadsto \left(\frac{z \cdot z}{\color{blue}{1 \cdot y}} - y\right) \cdot -0.5 \]
      3. times-frac85.5%

        \[\leadsto \left(\color{blue}{\frac{z}{1} \cdot \frac{z}{y}} - y\right) \cdot -0.5 \]
      4. /-rgt-identity85.5%

        \[\leadsto \left(\color{blue}{z} \cdot \frac{z}{y} - y\right) \cdot -0.5 \]
    12. Simplified85.5%

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

    if 1.3e128 < x

    1. Initial program 60.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 66.5%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow266.5%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified66.5%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac74.8%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv74.8%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval74.8%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr74.8%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 66.5%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative66.5%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow266.5%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/74.8%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*74.8%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/74.8%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity74.8%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac74.8%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity74.8%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified74.8%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \frac{0.5}{y}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.46 \cdot 10^{+80}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+128}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 12: 80.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+80}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\

\mathbf{elif}\;x \leq 7.5 \cdot 10^{+122}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.49999999999999993e80

    1. Initial program 72.2%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 69.8%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow269.8%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified69.8%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Taylor expanded in x around 0 69.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    6. Step-by-step derivation
      1. unpow269.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y} \]
      2. *-commutative69.8%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y} \cdot 0.5} \]
      3. associate-/l*75.5%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{x}}} \cdot 0.5 \]
    7. Simplified75.5%

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

    if -1.49999999999999993e80 < x < 7.5000000000000002e122

    1. Initial program 73.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg73.9%

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

        \[\leadsto \frac{\color{blue}{\left(-z \cdot z\right) + \left(x \cdot x + y \cdot y\right)}}{y \cdot 2} \]
      3. neg-sub073.9%

        \[\leadsto \frac{\color{blue}{\left(0 - z \cdot z\right)} + \left(x \cdot x + y \cdot y\right)}{y \cdot 2} \]
      4. associate-+l-73.9%

        \[\leadsto \frac{\color{blue}{0 - \left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      5. sub0-neg73.9%

        \[\leadsto \frac{\color{blue}{-\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right)}}{y \cdot 2} \]
      6. neg-mul-173.9%

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

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - \left(x \cdot x + y \cdot y\right)\right) \cdot -1}}{y \cdot 2} \]
      8. times-frac73.9%

        \[\leadsto \color{blue}{\frac{z \cdot z - \left(x \cdot x + y \cdot y\right)}{y} \cdot \frac{-1}{2}} \]
      9. associate--r+73.9%

        \[\leadsto \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) - y \cdot y}}{y} \cdot \frac{-1}{2} \]
      10. div-sub73.9%

        \[\leadsto \color{blue}{\left(\frac{z \cdot z - x \cdot x}{y} - \frac{y \cdot y}{y}\right)} \cdot \frac{-1}{2} \]
      11. difference-of-squares73.9%

        \[\leadsto \left(\frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      12. +-commutative73.9%

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

        \[\leadsto \left(\color{blue}{\left(x + z\right) \cdot \frac{z - x}{y}} - \frac{y \cdot y}{y}\right) \cdot \frac{-1}{2} \]
      14. associate-/l*99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{\frac{y}{\frac{y}{y}}}\right) \cdot \frac{-1}{2} \]
      15. *-inverses99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \frac{y}{\color{blue}{1}}\right) \cdot \frac{-1}{2} \]
      16. /-rgt-identity99.9%

        \[\leadsto \left(\left(x + z\right) \cdot \frac{z - x}{y} - \color{blue}{y}\right) \cdot \frac{-1}{2} \]
      17. metadata-eval99.9%

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

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

      \[\leadsto \left(\color{blue}{\frac{{z}^{2}}{y}} - y\right) \cdot -0.5 \]
    5. Step-by-step derivation
      1. unpow280.9%

        \[\leadsto \left(\frac{\color{blue}{z \cdot z}}{y} - y\right) \cdot -0.5 \]
      2. associate-/l*85.5%

        \[\leadsto \left(\color{blue}{\frac{z}{\frac{y}{z}}} - y\right) \cdot -0.5 \]
    6. Simplified85.5%

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

    if 7.5000000000000002e122 < x

    1. Initial program 60.3%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 66.5%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow266.5%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified66.5%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac74.8%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv74.8%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval74.8%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr74.8%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 66.5%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative66.5%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow266.5%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/74.8%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*74.8%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/74.8%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity74.8%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac74.8%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity74.8%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified74.8%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \frac{0.5}{y}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+80}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+122}:\\ \;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 13: 52.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{+91}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+117}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.15e91 or 2.0000000000000001e117 < y

    1. Initial program 27.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in y around inf 79.3%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
    3. Step-by-step derivation
      1. *-commutative79.3%

        \[\leadsto \color{blue}{y \cdot 0.5} \]
    4. Simplified79.3%

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

    if -3.15e91 < y < 2.0000000000000001e117

    1. Initial program 91.0%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Taylor expanded in x around inf 45.4%

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot 2} \]
    3. Step-by-step derivation
      1. unpow245.4%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    4. Simplified45.4%

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot 2} \]
    5. Step-by-step derivation
      1. times-frac47.4%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{2}} \]
      2. div-inv47.4%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(x \cdot \frac{1}{2}\right)} \]
      3. metadata-eval47.4%

        \[\leadsto \frac{x}{y} \cdot \left(x \cdot \color{blue}{0.5}\right) \]
    6. Applied egg-rr47.4%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(x \cdot 0.5\right)} \]
    7. Taylor expanded in x around 0 45.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    8. Step-by-step derivation
      1. *-commutative45.4%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{y} \cdot 0.5} \]
      2. unpow245.4%

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y} \cdot 0.5 \]
      3. associate-*r/47.4%

        \[\leadsto \color{blue}{\left(x \cdot \frac{x}{y}\right)} \cdot 0.5 \]
      4. associate-*r*47.4%

        \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot 0.5\right)} \]
      5. associate-*l/47.4%

        \[\leadsto x \cdot \color{blue}{\frac{x \cdot 0.5}{y}} \]
      6. *-lft-identity47.4%

        \[\leadsto x \cdot \frac{x \cdot 0.5}{\color{blue}{1 \cdot y}} \]
      7. times-frac47.4%

        \[\leadsto x \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{0.5}{y}\right)} \]
      8. /-rgt-identity47.4%

        \[\leadsto x \cdot \left(\color{blue}{x} \cdot \frac{0.5}{y}\right) \]
    9. Simplified47.4%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \frac{0.5}{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.15 \cdot 10^{+91}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+117}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]

Alternative 14: 34.6% accurate, 5.0× speedup?

\[\begin{array}{l} \\ y \cdot 0.5 \end{array} \]
(FPCore (x y z) :precision binary64 (* y 0.5))
double code(double x, double y, double z) {
	return y * 0.5;
}
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
end function
public static double code(double x, double y, double z) {
	return y * 0.5;
}
def code(x, y, z):
	return y * 0.5
function code(x, y, z)
	return Float64(y * 0.5)
end
function tmp = code(x, y, z)
	tmp = y * 0.5;
end
code[x_, y_, z_] := N[(y * 0.5), $MachinePrecision]
\begin{array}{l}

\\
y \cdot 0.5
\end{array}
Derivation
  1. Initial program 71.5%

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
  2. Taylor expanded in y around inf 30.8%

    \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Step-by-step derivation
    1. *-commutative30.8%

      \[\leadsto \color{blue}{y \cdot 0.5} \]
  4. Simplified30.8%

    \[\leadsto \color{blue}{y \cdot 0.5} \]
  5. Final simplification30.8%

    \[\leadsto y \cdot 0.5 \]

Developer target: 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 2023176 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
  :precision binary64

  :herbie-target
  (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))

  (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))