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

Percentage Accurate: 69.0% → 90.5%
Time: 9.2s
Alternatives: 10
Speedup: 0.8×

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 10 alternatives:

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

Initial Program: 69.0% 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: 90.5% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right)\\ \mathbf{if}\;y \leq -5.3 \cdot 10^{+67}:\\ \;\;\;\;\frac{t_0 \cdot 0.5}{\frac{y}{\mathsf{hypot}\left(y, x\right)}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (hypot y (hypot x z))))
   (if (<= y -5.3e+67)
     (/ (* t_0 0.5) (/ y (hypot y x)))
     (if (<= y 7.5e+163)
       (/ (fma y y (fma x x (* z (- z)))) (* y 2.0))
       (* t_0 (* 0.5 (/ (hypot y x) y)))))))
double code(double x, double y, double z) {
	double t_0 = hypot(y, hypot(x, z));
	double tmp;
	if (y <= -5.3e+67) {
		tmp = (t_0 * 0.5) / (y / hypot(y, x));
	} else if (y <= 7.5e+163) {
		tmp = fma(y, y, fma(x, x, (z * -z))) / (y * 2.0);
	} else {
		tmp = t_0 * (0.5 * (hypot(y, x) / y));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = hypot(y, hypot(x, z))
	tmp = 0.0
	if (y <= -5.3e+67)
		tmp = Float64(Float64(t_0 * 0.5) / Float64(y / hypot(y, x)));
	elseif (y <= 7.5e+163)
		tmp = Float64(fma(y, y, fma(x, x, Float64(z * Float64(-z)))) / Float64(y * 2.0));
	else
		tmp = Float64(t_0 * Float64(0.5 * Float64(hypot(y, x) / y)));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[Sqrt[y ^ 2 + N[Sqrt[x ^ 2 + z ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[y, -5.3e+67], N[(N[(t$95$0 * 0.5), $MachinePrecision] / N[(y / N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+163], N[(N[(y * y + N[(x * x + N[(z * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(0.5 * N[(N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right)\\
\mathbf{if}\;y \leq -5.3 \cdot 10^{+67}:\\
\;\;\;\;\frac{t_0 \cdot 0.5}{\frac{y}{\mathsf{hypot}\left(y, x\right)}}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+163}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.3e67

    1. Initial program 29.5%

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

        \[\leadsto \color{blue}{\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right) \cdot \frac{1}{y \cdot 2}} \]
      2. add-sqr-sqrt25.3%

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr89.3%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in z around 0 30.5%

      \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \color{blue}{\left(0.5 \cdot \left(\frac{1}{y} \cdot \sqrt{{x}^{2} + {y}^{2}}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*l/30.5%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \color{blue}{\frac{1 \cdot \sqrt{{x}^{2} + {y}^{2}}}{y}}\right) \]
      2. *-lft-identity30.5%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\color{blue}{\sqrt{{x}^{2} + {y}^{2}}}}{y}\right) \]
      3. +-commutative30.5%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{{y}^{2} + {x}^{2}}}}{y}\right) \]
      4. unpow230.5%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{y \cdot y} + {x}^{2}}}{y}\right) \]
      5. unpow230.5%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{y \cdot y + \color{blue}{x \cdot x}}}{y}\right) \]
      6. hypot-def89.3%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\color{blue}{\mathsf{hypot}\left(y, x\right)}}{y}\right) \]
    6. Simplified89.3%

      \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \color{blue}{\left(0.5 \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)} \]
    7. Step-by-step derivation
      1. associate-*r*89.3%

        \[\leadsto \color{blue}{\left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot 0.5\right) \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}} \]
      2. clear-num89.3%

        \[\leadsto \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot 0.5\right) \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{hypot}\left(y, x\right)}}} \]
      3. un-div-inv89.3%

        \[\leadsto \color{blue}{\frac{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot 0.5}{\frac{y}{\mathsf{hypot}\left(y, x\right)}}} \]
    8. Applied egg-rr89.3%

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

    if -5.3e67 < y < 7.50000000000000001e163

    1. Initial program 91.8%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, y, x \cdot x - z \cdot z\right)}}{y \cdot 2} \]
      6. fma-neg95.2%

        \[\leadsto \frac{\mathsf{fma}\left(y, y, \color{blue}{\mathsf{fma}\left(x, x, -z \cdot z\right)}\right)}{y \cdot 2} \]
      7. distribute-rgt-neg-in95.2%

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

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

    if 7.50000000000000001e163 < y

    1. Initial program 8.5%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr86.5%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in z around 0 9.2%

      \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \color{blue}{\left(0.5 \cdot \left(\frac{1}{y} \cdot \sqrt{{x}^{2} + {y}^{2}}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*l/9.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \color{blue}{\frac{1 \cdot \sqrt{{x}^{2} + {y}^{2}}}{y}}\right) \]
      2. *-lft-identity9.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\color{blue}{\sqrt{{x}^{2} + {y}^{2}}}}{y}\right) \]
      3. +-commutative9.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{{y}^{2} + {x}^{2}}}}{y}\right) \]
      4. unpow29.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{y \cdot y} + {x}^{2}}}{y}\right) \]
      5. unpow29.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{y \cdot y + \color{blue}{x \cdot x}}}{y}\right) \]
      6. hypot-def86.6%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\color{blue}{\mathsf{hypot}\left(y, x\right)}}{y}\right) \]
    6. Simplified86.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+67}:\\ \;\;\;\;\frac{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot 0.5}{\frac{y}{\mathsf{hypot}\left(y, x\right)}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\ \end{array} \]

Alternative 2: 90.5% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+67} \lor \neg \left(y \leq 7.5 \cdot 10^{+163}\right):\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -5.3e+67) (not (<= y 7.5e+163)))
   (* (hypot y (hypot x z)) (* 0.5 (/ (hypot y x) y)))
   (/ (fma y y (fma x x (* z (- z)))) (* y 2.0))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -5.3e+67) || !(y <= 7.5e+163)) {
		tmp = hypot(y, hypot(x, z)) * (0.5 * (hypot(y, x) / y));
	} else {
		tmp = fma(y, y, fma(x, x, (z * -z))) / (y * 2.0);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if ((y <= -5.3e+67) || !(y <= 7.5e+163))
		tmp = Float64(hypot(y, hypot(x, z)) * Float64(0.5 * Float64(hypot(y, x) / y)));
	else
		tmp = Float64(fma(y, y, fma(x, x, Float64(z * Float64(-z)))) / Float64(y * 2.0));
	end
	return tmp
end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.3e+67], N[Not[LessEqual[y, 7.5e+163]], $MachinePrecision]], N[(N[Sqrt[y ^ 2 + N[Sqrt[x ^ 2 + z ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] * N[(0.5 * N[(N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * y + N[(x * x + N[(z * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+67} \lor \neg \left(y \leq 7.5 \cdot 10^{+163}\right):\\
\;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.3e67 or 7.50000000000000001e163 < y

    1. Initial program 21.3%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in z around 0 22.2%

      \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \color{blue}{\left(0.5 \cdot \left(\frac{1}{y} \cdot \sqrt{{x}^{2} + {y}^{2}}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*l/22.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \color{blue}{\frac{1 \cdot \sqrt{{x}^{2} + {y}^{2}}}{y}}\right) \]
      2. *-lft-identity22.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\color{blue}{\sqrt{{x}^{2} + {y}^{2}}}}{y}\right) \]
      3. +-commutative22.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{{y}^{2} + {x}^{2}}}}{y}\right) \]
      4. unpow222.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{y \cdot y} + {x}^{2}}}{y}\right) \]
      5. unpow222.2%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\sqrt{y \cdot y + \color{blue}{x \cdot x}}}{y}\right) \]
      6. hypot-def88.3%

        \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\color{blue}{\mathsf{hypot}\left(y, x\right)}}{y}\right) \]
    6. Simplified88.3%

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

    if -5.3e67 < y < 7.50000000000000001e163

    1. Initial program 91.8%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, y, x \cdot x - z \cdot z\right)}}{y \cdot 2} \]
      6. fma-neg95.2%

        \[\leadsto \frac{\mathsf{fma}\left(y, y, \color{blue}{\mathsf{fma}\left(x, x, -z \cdot z\right)}\right)}{y \cdot 2} \]
      7. distribute-rgt-neg-in95.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+67} \lor \neg \left(y \leq 7.5 \cdot 10^{+163}\right):\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\ \end{array} \]

Alternative 3: 88.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0 \cdot -0.5\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (hypot y (hypot x z))))
   (if (<= y -1.35e+154)
     (* t_0 -0.5)
     (if (<= y 7.5e+163)
       (/ (fma y y (fma x x (* z (- z)))) (* y 2.0))
       (* t_0 0.5)))))
double code(double x, double y, double z) {
	double t_0 = hypot(y, hypot(x, z));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0 * -0.5;
	} else if (y <= 7.5e+163) {
		tmp = fma(y, y, fma(x, x, (z * -z))) / (y * 2.0);
	} else {
		tmp = t_0 * 0.5;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = hypot(y, hypot(x, z))
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = Float64(t_0 * -0.5);
	elseif (y <= 7.5e+163)
		tmp = Float64(fma(y, y, fma(x, x, Float64(z * Float64(-z)))) / Float64(y * 2.0));
	else
		tmp = Float64(t_0 * 0.5);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[Sqrt[y ^ 2 + N[Sqrt[x ^ 2 + z ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[y, -1.35e+154], N[(t$95$0 * -0.5), $MachinePrecision], If[LessEqual[y, 7.5e+163], N[(N[(y * y + N[(x * x + N[(z * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 0.5), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0 \cdot -0.5\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+163}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.35000000000000003e154

    1. Initial program 11.1%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr90.2%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in y around -inf 75.9%

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

    if -1.35000000000000003e154 < y < 7.50000000000000001e163

    1. Initial program 89.6%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, y, x \cdot x - z \cdot z\right)}}{y \cdot 2} \]
      6. fma-neg92.7%

        \[\leadsto \frac{\mathsf{fma}\left(y, y, \color{blue}{\mathsf{fma}\left(x, x, -z \cdot z\right)}\right)}{y \cdot 2} \]
      7. distribute-rgt-neg-in92.7%

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

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

    if 7.50000000000000001e163 < y

    1. Initial program 8.5%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr86.5%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in y around inf 79.8%

      \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \color{blue}{0.5} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot -0.5\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, y, \mathsf{fma}\left(x, x, z \cdot \left(-z\right)\right)\right)}{y \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot 0.5\\ \end{array} \]

Alternative 4: 85.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0 \cdot -0.5\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+146}:\\ \;\;\;\;\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (hypot y (hypot x z))))
   (if (<= y -1.35e+154)
     (* t_0 -0.5)
     (if (<= y 1.3e+146)
       (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0))
       (if (<= y 1.55e+170) (/ -0.5 (/ (/ y z) z)) (* t_0 0.5))))))
double code(double x, double y, double z) {
	double t_0 = hypot(y, hypot(x, z));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0 * -0.5;
	} else if (y <= 1.3e+146) {
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	} else if (y <= 1.55e+170) {
		tmp = -0.5 / ((y / z) / z);
	} else {
		tmp = t_0 * 0.5;
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = Math.hypot(y, Math.hypot(x, z));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0 * -0.5;
	} else if (y <= 1.3e+146) {
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	} else if (y <= 1.55e+170) {
		tmp = -0.5 / ((y / z) / z);
	} else {
		tmp = t_0 * 0.5;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.hypot(y, math.hypot(x, z))
	tmp = 0
	if y <= -1.35e+154:
		tmp = t_0 * -0.5
	elif y <= 1.3e+146:
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
	elif y <= 1.55e+170:
		tmp = -0.5 / ((y / z) / z)
	else:
		tmp = t_0 * 0.5
	return tmp
function code(x, y, z)
	t_0 = hypot(y, hypot(x, z))
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = Float64(t_0 * -0.5);
	elseif (y <= 1.3e+146)
		tmp = Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0));
	elseif (y <= 1.55e+170)
		tmp = Float64(-0.5 / Float64(Float64(y / z) / z));
	else
		tmp = Float64(t_0 * 0.5);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = hypot(y, hypot(x, z));
	tmp = 0.0;
	if (y <= -1.35e+154)
		tmp = t_0 * -0.5;
	elseif (y <= 1.3e+146)
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	elseif (y <= 1.55e+170)
		tmp = -0.5 / ((y / z) / z);
	else
		tmp = t_0 * 0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[Sqrt[y ^ 2 + N[Sqrt[x ^ 2 + z ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[y, -1.35e+154], N[(t$95$0 * -0.5), $MachinePrecision], If[LessEqual[y, 1.3e+146], N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+170], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 0.5), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0 \cdot -0.5\\

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\
\;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000003e154

    1. Initial program 11.1%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr90.2%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in y around -inf 75.9%

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

    if -1.35000000000000003e154 < y < 1.30000000000000007e146

    1. Initial program 91.8%

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

    if 1.30000000000000007e146 < y < 1.55e170

    1. Initial program 23.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{y} \cdot -0.5} \]
    4. Simplified33.6%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
      2. clear-num33.6%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{y}{{z}^{2}}}} \]
      3. un-div-inv33.6%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    6. Applied egg-rr33.6%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity33.6%

        \[\leadsto \frac{-0.5}{\frac{\color{blue}{1 \cdot y}}{{z}^{2}}} \]
      2. unpow233.6%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1}{z} \cdot \frac{y}{z}}} \]
    8. Applied egg-rr75.4%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1 \cdot \frac{y}{z}}{z}}} \]
      2. *-lft-identity75.7%

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

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

    if 1.55e170 < y

    1. Initial program 9.3%

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

        \[\leadsto \color{blue}{\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right) \cdot \frac{1}{y \cdot 2}} \]
      2. add-sqr-sqrt9.3%

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr92.4%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in y around inf 84.9%

      \[\leadsto \mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \color{blue}{0.5} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification88.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot -0.5\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+146}:\\ \;\;\;\;\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot 0.5\\ \end{array} \]

Alternative 5: 85.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot -0.5\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+146}:\\ \;\;\;\;\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -1.35e+154)
   (* (hypot y (hypot x z)) -0.5)
   (if (<= y 1.3e+146)
     (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0))
     (if (<= y 1.55e+170) (/ -0.5 (/ (/ y z) z)) (* y 0.5)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.35e+154) {
		tmp = hypot(y, hypot(x, z)) * -0.5;
	} else if (y <= 1.3e+146) {
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	} else if (y <= 1.55e+170) {
		tmp = -0.5 / ((y / z) / z);
	} else {
		tmp = y * 0.5;
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.35e+154) {
		tmp = Math.hypot(y, Math.hypot(x, z)) * -0.5;
	} else if (y <= 1.3e+146) {
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	} else if (y <= 1.55e+170) {
		tmp = -0.5 / ((y / z) / z);
	} else {
		tmp = y * 0.5;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -1.35e+154:
		tmp = math.hypot(y, math.hypot(x, z)) * -0.5
	elif y <= 1.3e+146:
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
	elif y <= 1.55e+170:
		tmp = -0.5 / ((y / z) / z)
	else:
		tmp = y * 0.5
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = Float64(hypot(y, hypot(x, z)) * -0.5);
	elseif (y <= 1.3e+146)
		tmp = Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0));
	elseif (y <= 1.55e+170)
		tmp = Float64(-0.5 / Float64(Float64(y / z) / z));
	else
		tmp = Float64(y * 0.5);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -1.35e+154)
		tmp = hypot(y, hypot(x, z)) * -0.5;
	elseif (y <= 1.3e+146)
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	elseif (y <= 1.55e+170)
		tmp = -0.5 / ((y / z) / z);
	else
		tmp = y * 0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -1.35e+154], N[(N[Sqrt[y ^ 2 + N[Sqrt[x ^ 2 + z ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[y, 1.3e+146], N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+170], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot -0.5\\

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\
\;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000003e154

    1. Initial program 11.1%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \left(\sqrt{\left(x \cdot x + y \cdot y\right) - z \cdot z} \cdot \frac{1}{y \cdot 2}\right)} \]
    3. Applied egg-rr90.2%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \left(\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot \frac{0.5}{y}\right)} \]
    4. Taylor expanded in y around -inf 75.9%

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

    if -1.35000000000000003e154 < y < 1.30000000000000007e146

    1. Initial program 91.8%

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

    if 1.30000000000000007e146 < y < 1.55e170

    1. Initial program 23.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{y} \cdot -0.5} \]
    4. Simplified33.6%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
      2. clear-num33.6%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{y}{{z}^{2}}}} \]
      3. un-div-inv33.6%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    6. Applied egg-rr33.6%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity33.6%

        \[\leadsto \frac{-0.5}{\frac{\color{blue}{1 \cdot y}}{{z}^{2}}} \]
      2. unpow233.6%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1}{z} \cdot \frac{y}{z}}} \]
    8. Applied egg-rr75.4%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1 \cdot \frac{y}{z}}{z}}} \]
      2. *-lft-identity75.7%

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

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

    if 1.55e170 < y

    1. Initial program 9.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{hypot}\left(y, \mathsf{hypot}\left(x, z\right)\right) \cdot -0.5\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+146}:\\ \;\;\;\;\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]

Alternative 6: 85.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+146}:\\ \;\;\;\;\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -1.35e+154)
   (* y 0.5)
   (if (<= y 1.3e+146)
     (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0))
     (if (<= y 1.55e+170) (/ -0.5 (/ (/ y z) z)) (* y 0.5)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.35e+154) {
		tmp = y * 0.5;
	} else if (y <= 1.3e+146) {
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	} else if (y <= 1.55e+170) {
		tmp = -0.5 / ((y / z) / z);
	} 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 <= (-1.35d+154)) then
        tmp = y * 0.5d0
    else if (y <= 1.3d+146) then
        tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
    else if (y <= 1.55d+170) then
        tmp = (-0.5d0) / ((y / z) / z)
    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 <= -1.35e+154) {
		tmp = y * 0.5;
	} else if (y <= 1.3e+146) {
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	} else if (y <= 1.55e+170) {
		tmp = -0.5 / ((y / z) / z);
	} else {
		tmp = y * 0.5;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -1.35e+154:
		tmp = y * 0.5
	elif y <= 1.3e+146:
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
	elif y <= 1.55e+170:
		tmp = -0.5 / ((y / z) / z)
	else:
		tmp = y * 0.5
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = Float64(y * 0.5);
	elseif (y <= 1.3e+146)
		tmp = Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0));
	elseif (y <= 1.55e+170)
		tmp = Float64(-0.5 / Float64(Float64(y / z) / z));
	else
		tmp = Float64(y * 0.5);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -1.35e+154)
		tmp = y * 0.5;
	elseif (y <= 1.3e+146)
		tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
	elseif (y <= 1.55e+170)
		tmp = -0.5 / ((y / z) / z);
	else
		tmp = y * 0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -1.35e+154], N[(y * 0.5), $MachinePrecision], If[LessEqual[y, 1.3e+146], N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+170], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\
\;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.35000000000000003e154 or 1.55e170 < y

    1. Initial program 10.3%

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

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

    if -1.35000000000000003e154 < y < 1.30000000000000007e146

    1. Initial program 91.8%

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

    if 1.30000000000000007e146 < y < 1.55e170

    1. Initial program 23.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{y} \cdot -0.5} \]
    4. Simplified33.6%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{{z}^{2}}{y}} \]
      2. clear-num33.6%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{y}{{z}^{2}}}} \]
      3. un-div-inv33.6%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    6. Applied egg-rr33.6%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity33.6%

        \[\leadsto \frac{-0.5}{\frac{\color{blue}{1 \cdot y}}{{z}^{2}}} \]
      2. unpow233.6%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1}{z} \cdot \frac{y}{z}}} \]
    8. Applied egg-rr75.4%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1 \cdot \frac{y}{z}}{z}}} \]
      2. *-lft-identity75.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+146}:\\ \;\;\;\;\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+170}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]

Alternative 7: 42.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 3.2 \cdot 10^{-122}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-28} \lor \neg \left(x \leq 4.5 \cdot 10^{+24}\right) \land x \leq 4.1 \cdot 10^{+108}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{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 3.2e-122)
   (* y 0.5)
   (if (or (<= x 1.2e-28) (and (not (<= x 4.5e+24)) (<= x 4.1e+108)))
     (* -0.5 (* z (/ z y)))
     (* x (* x (/ 0.5 y))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 3.2e-122) {
		tmp = y * 0.5;
	} else if ((x <= 1.2e-28) || (!(x <= 4.5e+24) && (x <= 4.1e+108))) {
		tmp = -0.5 * (z * (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 <= 3.2d-122) then
        tmp = y * 0.5d0
    else if ((x <= 1.2d-28) .or. (.not. (x <= 4.5d+24)) .and. (x <= 4.1d+108)) then
        tmp = (-0.5d0) * (z * (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 <= 3.2e-122) {
		tmp = y * 0.5;
	} else if ((x <= 1.2e-28) || (!(x <= 4.5e+24) && (x <= 4.1e+108))) {
		tmp = -0.5 * (z * (z / y));
	} else {
		tmp = x * (x * (0.5 / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 3.2e-122:
		tmp = y * 0.5
	elif (x <= 1.2e-28) or (not (x <= 4.5e+24) and (x <= 4.1e+108)):
		tmp = -0.5 * (z * (z / y))
	else:
		tmp = x * (x * (0.5 / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 3.2e-122)
		tmp = Float64(y * 0.5);
	elseif ((x <= 1.2e-28) || (!(x <= 4.5e+24) && (x <= 4.1e+108)))
		tmp = Float64(-0.5 * Float64(z * Float64(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 <= 3.2e-122)
		tmp = y * 0.5;
	elseif ((x <= 1.2e-28) || (~((x <= 4.5e+24)) && (x <= 4.1e+108)))
		tmp = -0.5 * (z * (z / y));
	else
		tmp = x * (x * (0.5 / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 3.2e-122], N[(y * 0.5), $MachinePrecision], If[Or[LessEqual[x, 1.2e-28], And[N[Not[LessEqual[x, 4.5e+24]], $MachinePrecision], LessEqual[x, 4.1e+108]]], N[(-0.5 * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2 \cdot 10^{-122}:\\
\;\;\;\;y \cdot 0.5\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-28} \lor \neg \left(x \leq 4.5 \cdot 10^{+24}\right) \land x \leq 4.1 \cdot 10^{+108}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{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 < 3.2000000000000002e-122

    1. Initial program 71.4%

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

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

    if 3.2000000000000002e-122 < x < 1.2000000000000001e-28 or 4.50000000000000019e24 < x < 4.0999999999999999e108

    1. Initial program 74.4%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{y} \cdot -0.5} \]
    4. Simplified46.3%

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

        \[\leadsto \color{blue}{\left({z}^{2} \cdot \frac{1}{y}\right)} \cdot -0.5 \]
      2. unpow246.3%

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

        \[\leadsto \color{blue}{\left(z \cdot \left(z \cdot \frac{1}{y}\right)\right)} \cdot -0.5 \]
      4. div-inv53.8%

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

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

    if 1.2000000000000001e-28 < x < 4.50000000000000019e24 or 4.0999999999999999e108 < x

    1. Initial program 63.0%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    3. Step-by-step derivation
      1. associate-*r/60.4%

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

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

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{x}^{2}}}} \]
    5. Step-by-step derivation
      1. associate-/r/60.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.2 \cdot 10^{-122}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-28} \lor \neg \left(x \leq 4.5 \cdot 10^{+24}\right) \land x \leq 4.1 \cdot 10^{+108}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \end{array} \]

Alternative 8: 42.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 9.5 \cdot 10^{-129}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-27}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{+24} \lor \neg \left(x \leq 1.15 \cdot 10^{+108}\right):\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 9.5e-129)
   (* y 0.5)
   (if (<= x 1.5e-27)
     (* -0.5 (* z (/ z y)))
     (if (or (<= x 5.8e+24) (not (<= x 1.15e+108)))
       (* x (* x (/ 0.5 y)))
       (/ -0.5 (/ (/ y z) z))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 9.5e-129) {
		tmp = y * 0.5;
	} else if (x <= 1.5e-27) {
		tmp = -0.5 * (z * (z / y));
	} else if ((x <= 5.8e+24) || !(x <= 1.15e+108)) {
		tmp = x * (x * (0.5 / y));
	} else {
		tmp = -0.5 / ((y / z) / 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 (x <= 9.5d-129) then
        tmp = y * 0.5d0
    else if (x <= 1.5d-27) then
        tmp = (-0.5d0) * (z * (z / y))
    else if ((x <= 5.8d+24) .or. (.not. (x <= 1.15d+108))) then
        tmp = x * (x * (0.5d0 / y))
    else
        tmp = (-0.5d0) / ((y / z) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 9.5e-129) {
		tmp = y * 0.5;
	} else if (x <= 1.5e-27) {
		tmp = -0.5 * (z * (z / y));
	} else if ((x <= 5.8e+24) || !(x <= 1.15e+108)) {
		tmp = x * (x * (0.5 / y));
	} else {
		tmp = -0.5 / ((y / z) / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 9.5e-129:
		tmp = y * 0.5
	elif x <= 1.5e-27:
		tmp = -0.5 * (z * (z / y))
	elif (x <= 5.8e+24) or not (x <= 1.15e+108):
		tmp = x * (x * (0.5 / y))
	else:
		tmp = -0.5 / ((y / z) / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 9.5e-129)
		tmp = Float64(y * 0.5);
	elseif (x <= 1.5e-27)
		tmp = Float64(-0.5 * Float64(z * Float64(z / y)));
	elseif ((x <= 5.8e+24) || !(x <= 1.15e+108))
		tmp = Float64(x * Float64(x * Float64(0.5 / y)));
	else
		tmp = Float64(-0.5 / Float64(Float64(y / z) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 9.5e-129)
		tmp = y * 0.5;
	elseif (x <= 1.5e-27)
		tmp = -0.5 * (z * (z / y));
	elseif ((x <= 5.8e+24) || ~((x <= 1.15e+108)))
		tmp = x * (x * (0.5 / y));
	else
		tmp = -0.5 / ((y / z) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 9.5e-129], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 1.5e-27], N[(-0.5 * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 5.8e+24], N[Not[LessEqual[x, 1.15e+108]], $MachinePrecision]], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.5 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 0.5\\

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

\mathbf{elif}\;x \leq 5.8 \cdot 10^{+24} \lor \neg \left(x \leq 1.15 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < 9.5000000000000006e-129

    1. Initial program 71.4%

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

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

    if 9.5000000000000006e-129 < x < 1.5000000000000001e-27

    1. Initial program 78.8%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{y} \cdot -0.5} \]
    4. Simplified40.9%

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

        \[\leadsto \color{blue}{\left({z}^{2} \cdot \frac{1}{y}\right)} \cdot -0.5 \]
      2. unpow240.9%

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

        \[\leadsto \color{blue}{\left(z \cdot \left(z \cdot \frac{1}{y}\right)\right)} \cdot -0.5 \]
      4. div-inv48.9%

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

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

    if 1.5000000000000001e-27 < x < 5.79999999999999958e24 or 1.1499999999999999e108 < x

    1. Initial program 63.0%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{y}} \]
    3. Step-by-step derivation
      1. associate-*r/60.4%

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

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

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{x}^{2}}}} \]
    5. Step-by-step derivation
      1. associate-/r/60.5%

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

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

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

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

    if 5.79999999999999958e24 < x < 1.1499999999999999e108

    1. Initial program 70.6%

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

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

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

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

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

        \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{y}{{z}^{2}}}} \]
      3. un-div-inv51.0%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    6. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{y}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity51.0%

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

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1}{z} \cdot \frac{y}{z}}} \]
    8. Applied egg-rr58.1%

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

        \[\leadsto \frac{-0.5}{\color{blue}{\frac{1 \cdot \frac{y}{z}}{z}}} \]
      2. *-lft-identity58.2%

        \[\leadsto \frac{-0.5}{\frac{\color{blue}{\frac{y}{z}}}{z}} \]
    10. Simplified58.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 9.5 \cdot 10^{-129}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-27}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{+24} \lor \neg \left(x \leq 1.15 \cdot 10^{+108}\right):\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\ \end{array} \]

Alternative 9: 43.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 1.18 \cdot 10^{+51} \lor \neg \left(z \leq 7.5 \cdot 10^{+114}\right) \land z \leq 10^{+133}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z 1.18e+51) (and (not (<= z 7.5e+114)) (<= z 1e+133)))
   (* y 0.5)
   (* -0.5 (* z (/ z y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= 1.18e+51) || (!(z <= 7.5e+114) && (z <= 1e+133))) {
		tmp = y * 0.5;
	} else {
		tmp = -0.5 * (z * (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 ((z <= 1.18d+51) .or. (.not. (z <= 7.5d+114)) .and. (z <= 1d+133)) then
        tmp = y * 0.5d0
    else
        tmp = (-0.5d0) * (z * (z / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= 1.18e+51) || (!(z <= 7.5e+114) && (z <= 1e+133))) {
		tmp = y * 0.5;
	} else {
		tmp = -0.5 * (z * (z / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= 1.18e+51) or (not (z <= 7.5e+114) and (z <= 1e+133)):
		tmp = y * 0.5
	else:
		tmp = -0.5 * (z * (z / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= 1.18e+51) || (!(z <= 7.5e+114) && (z <= 1e+133)))
		tmp = Float64(y * 0.5);
	else
		tmp = Float64(-0.5 * Float64(z * Float64(z / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= 1.18e+51) || (~((z <= 7.5e+114)) && (z <= 1e+133)))
		tmp = y * 0.5;
	else
		tmp = -0.5 * (z * (z / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, 1.18e+51], And[N[Not[LessEqual[z, 7.5e+114]], $MachinePrecision], LessEqual[z, 1e+133]]], N[(y * 0.5), $MachinePrecision], N[(-0.5 * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.18 \cdot 10^{+51} \lor \neg \left(z \leq 7.5 \cdot 10^{+114}\right) \land z \leq 10^{+133}:\\
\;\;\;\;y \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.18e51 or 7.5000000000000001e114 < z < 1e133

    1. Initial program 70.4%

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

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

    if 1.18e51 < z < 7.5000000000000001e114 or 1e133 < z

    1. Initial program 71.7%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{y} \cdot -0.5} \]
    4. Simplified65.3%

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

        \[\leadsto \color{blue}{\left({z}^{2} \cdot \frac{1}{y}\right)} \cdot -0.5 \]
      2. unpow265.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.18 \cdot 10^{+51} \lor \neg \left(z \leq 7.5 \cdot 10^{+114}\right) \land z \leq 10^{+133}:\\ \;\;\;\;y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\ \end{array} \]

Alternative 10: 34.4% 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 70.6%

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

    \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Final simplification33.0%

    \[\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 2023318 
(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)))