Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B

Percentage Accurate: 90.6% → 96.7%
Time: 10.5s
Alternatives: 9
Speedup: 0.8×

Specification

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

\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 90.6% accurate, 1.0× speedup?

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

\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}

Alternative 1: 96.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot 4, \mathsf{fma}\left(z, -z, t\right), x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 5e+276)
   (fma (* y 4.0) (fma z (- z) t) (* x x))
   (- (* x x) (* z (* z (* y 4.0))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 5e+276) {
		tmp = fma((y * 4.0), fma(z, -z, t), (x * x));
	} else {
		tmp = (x * x) - (z * (z * (y * 4.0)));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 5e+276)
		tmp = fma(Float64(y * 4.0), fma(z, Float64(-z), t), Float64(x * x));
	else
		tmp = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+276], N[(N[(y * 4.0), $MachinePrecision] * N[(z * (-z) + t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, \mathsf{fma}\left(z, -z, t\right), x \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 5.00000000000000001e276

    1. Initial program 96.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv96.3%

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

        \[\leadsto x \cdot x + \color{blue}{\left(\left(-y\right) \cdot 4\right)} \cdot \left(z \cdot z - t\right) \]
      3. +-commutative96.3%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 4\right) \cdot \left(z \cdot z - t\right) + x \cdot x} \]
      4. distribute-lft-neg-out96.3%

        \[\leadsto \color{blue}{\left(-y \cdot 4\right)} \cdot \left(z \cdot z - t\right) + x \cdot x \]
      5. distribute-lft-neg-in96.3%

        \[\leadsto \color{blue}{\left(-\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)} + x \cdot x \]
      6. distribute-rgt-neg-in96.3%

        \[\leadsto \color{blue}{\left(y \cdot 4\right) \cdot \left(-\left(z \cdot z - t\right)\right)} + x \cdot x \]
      7. fma-def98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot 4, -\left(z \cdot z - t\right), x \cdot x\right)} \]
      8. sub-neg98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, -\color{blue}{\left(z \cdot z + \left(-t\right)\right)}, x \cdot x\right) \]
      9. distribute-neg-in98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, \color{blue}{\left(-z \cdot z\right) + \left(-\left(-t\right)\right)}, x \cdot x\right) \]
      10. distribute-rgt-neg-out98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, \color{blue}{z \cdot \left(-z\right)} + \left(-\left(-t\right)\right), x \cdot x\right) \]
      11. remove-double-neg98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, z \cdot \left(-z\right) + \color{blue}{t}, x \cdot x\right) \]
      12. fma-def98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, \color{blue}{\mathsf{fma}\left(z, -z, t\right)}, x \cdot x\right) \]
    3. Simplified98.1%

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

    if 5.00000000000000001e276 < (*.f64 z z)

    1. Initial program 69.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    3. Applied egg-rr69.3%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    4. Step-by-step derivation
      1. fma-udef69.3%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
      3. sub-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
      4. flip--3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
      5. pow-prod-up3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
      6. metadata-eval3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{\color{blue}{4}} - t \cdot t}{{z}^{2} + t} \]
      7. sqr-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
      8. remove-double-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
      9. sub-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
      10. clear-num3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      11. un-div-inv3.4%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      12. clear-num3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
      13. metadata-eval3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      14. pow-sqr3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{\color{blue}{{z}^{2} \cdot {z}^{2}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      15. add-sqr-sqrt2.3%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
      16. sqrt-prod3.4%

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

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
    6. Taylor expanded in z around inf 69.3%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-/r/69.3%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{1} \cdot {z}^{2}} \]
      2. /-rgt-identity69.3%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot 4\right)} \cdot {z}^{2} \]
      3. unpow269.3%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z} \]
    8. Applied egg-rr90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot 4, \mathsf{fma}\left(z, -z, t\right), x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \]

Alternative 2: 96.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 5e+276)
   (fma x x (* (- (* z z) t) (* y -4.0)))
   (- (* x x) (* z (* z (* y 4.0))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 5e+276) {
		tmp = fma(x, x, (((z * z) - t) * (y * -4.0)));
	} else {
		tmp = (x * x) - (z * (z * (y * 4.0)));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 5e+276)
		tmp = fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0)));
	else
		tmp = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+276], N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 5.00000000000000001e276

    1. Initial program 96.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, -\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)} \]
      2. distribute-lft-neg-in98.1%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(-y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right) \]
      3. *-commutative98.1%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(z \cdot z - t\right) \cdot \left(-y \cdot 4\right)}\right) \]
      4. distribute-rgt-neg-in98.1%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot \left(-4\right)\right)}\right) \]
      5. metadata-eval98.1%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot \color{blue}{-4}\right)\right) \]
    3. Simplified98.1%

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

    if 5.00000000000000001e276 < (*.f64 z z)

    1. Initial program 69.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    3. Applied egg-rr69.3%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    4. Step-by-step derivation
      1. fma-udef69.3%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
      3. sub-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
      4. flip--3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
      5. pow-prod-up3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
      6. metadata-eval3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{\color{blue}{4}} - t \cdot t}{{z}^{2} + t} \]
      7. sqr-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
      8. remove-double-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
      9. sub-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
      10. clear-num3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      11. un-div-inv3.4%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      12. clear-num3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
      13. metadata-eval3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      14. pow-sqr3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{\color{blue}{{z}^{2} \cdot {z}^{2}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      15. add-sqr-sqrt2.3%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
      16. sqrt-prod3.4%

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

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
    6. Taylor expanded in z around inf 69.3%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-/r/69.3%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{1} \cdot {z}^{2}} \]
      2. /-rgt-identity69.3%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot 4\right)} \cdot {z}^{2} \]
      3. unpow269.3%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z} \]
    8. Applied egg-rr90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \]

Alternative 3: 96.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 5e+276)
   (fma (* y 4.0) (- t (* z z)) (* x x))
   (- (* x x) (* z (* z (* y 4.0))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 5e+276) {
		tmp = fma((y * 4.0), (t - (z * z)), (x * x));
	} else {
		tmp = (x * x) - (z * (z * (y * 4.0)));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 5e+276)
		tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x));
	else
		tmp = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+276], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 5.00000000000000001e276

    1. Initial program 96.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv96.3%

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

        \[\leadsto x \cdot x + \color{blue}{\left(\left(-y\right) \cdot 4\right)} \cdot \left(z \cdot z - t\right) \]
      3. +-commutative96.3%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 4\right) \cdot \left(z \cdot z - t\right) + x \cdot x} \]
      4. distribute-lft-neg-out96.3%

        \[\leadsto \color{blue}{\left(-y \cdot 4\right)} \cdot \left(z \cdot z - t\right) + x \cdot x \]
      5. distribute-lft-neg-in96.3%

        \[\leadsto \color{blue}{\left(-\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)} + x \cdot x \]
      6. distribute-rgt-neg-in96.3%

        \[\leadsto \color{blue}{\left(y \cdot 4\right) \cdot \left(-\left(z \cdot z - t\right)\right)} + x \cdot x \]
      7. fma-def98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot 4, -\left(z \cdot z - t\right), x \cdot x\right)} \]
      8. sub-neg98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, -\color{blue}{\left(z \cdot z + \left(-t\right)\right)}, x \cdot x\right) \]
      9. +-commutative98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, -\color{blue}{\left(\left(-t\right) + z \cdot z\right)}, x \cdot x\right) \]
      10. distribute-neg-in98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, \color{blue}{\left(-\left(-t\right)\right) + \left(-z \cdot z\right)}, x \cdot x\right) \]
      11. remove-double-neg98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, \color{blue}{t} + \left(-z \cdot z\right), x \cdot x\right) \]
      12. sub-neg98.1%

        \[\leadsto \mathsf{fma}\left(y \cdot 4, \color{blue}{t - z \cdot z}, x \cdot x\right) \]
    3. Simplified98.1%

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

    if 5.00000000000000001e276 < (*.f64 z z)

    1. Initial program 69.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    3. Applied egg-rr69.3%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    4. Step-by-step derivation
      1. fma-udef69.3%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
      3. sub-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
      4. flip--3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
      5. pow-prod-up3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
      6. metadata-eval3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{\color{blue}{4}} - t \cdot t}{{z}^{2} + t} \]
      7. sqr-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
      8. remove-double-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
      9. sub-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
      10. clear-num3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      11. un-div-inv3.4%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      12. clear-num3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
      13. metadata-eval3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      14. pow-sqr3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{\color{blue}{{z}^{2} \cdot {z}^{2}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      15. add-sqr-sqrt2.3%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
      16. sqrt-prod3.4%

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

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
    6. Taylor expanded in z around inf 69.3%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-/r/69.3%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{1} \cdot {z}^{2}} \]
      2. /-rgt-identity69.3%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot 4\right)} \cdot {z}^{2} \]
      3. unpow269.3%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z} \]
    8. Applied egg-rr90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \]

Alternative 4: 95.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+276}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 5.00000000000000001e276

    1. Initial program 96.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]

    if 5.00000000000000001e276 < (*.f64 z z)

    1. Initial program 69.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    3. Applied egg-rr69.3%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    4. Step-by-step derivation
      1. fma-udef69.3%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
      3. sub-neg69.3%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
      4. flip--3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
      5. pow-prod-up3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
      6. metadata-eval3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{\color{blue}{4}} - t \cdot t}{{z}^{2} + t} \]
      7. sqr-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
      8. remove-double-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
      9. sub-neg3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
      10. clear-num3.4%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      11. un-div-inv3.4%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      12. clear-num3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
      13. metadata-eval3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      14. pow-sqr3.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{\color{blue}{{z}^{2} \cdot {z}^{2}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      15. add-sqr-sqrt2.3%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
      16. sqrt-prod3.4%

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

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
    6. Taylor expanded in z around inf 69.3%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-/r/69.3%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{1} \cdot {z}^{2}} \]
      2. /-rgt-identity69.3%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot 4\right)} \cdot {z}^{2} \]
      3. unpow269.3%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z} \]
    8. Applied egg-rr90.9%

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

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

Alternative 5: 78.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{+15}:\\
\;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6e15

    1. Initial program 93.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around 0 71.9%

      \[\leadsto x \cdot x - \color{blue}{-4 \cdot \left(t \cdot y\right)} \]
    3. Step-by-step derivation
      1. *-commutative71.9%

        \[\leadsto x \cdot x - \color{blue}{\left(t \cdot y\right) \cdot -4} \]
      2. *-commutative71.9%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot t\right)} \cdot -4 \]
      3. associate-*l*71.3%

        \[\leadsto x \cdot x - \color{blue}{y \cdot \left(t \cdot -4\right)} \]
    4. Simplified71.3%

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

    if 6e15 < z

    1. Initial program 73.1%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg73.1%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    3. Applied egg-rr73.1%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    4. Step-by-step derivation
      1. fma-udef73.1%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
      3. sub-neg73.1%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
      4. flip--22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
      5. pow-prod-up22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
      6. metadata-eval22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{\color{blue}{4}} - t \cdot t}{{z}^{2} + t} \]
      7. sqr-neg22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
      8. remove-double-neg22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
      9. sub-neg22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
      10. clear-num22.0%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      11. un-div-inv22.0%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      12. clear-num22.0%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
      13. metadata-eval22.0%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      14. pow-sqr22.0%

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
      16. sqrt-prod19.5%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}}} \]
    5. Applied egg-rr68.2%

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
    6. Taylor expanded in z around inf 70.8%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-/r/70.8%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{1} \cdot {z}^{2}} \]
      2. /-rgt-identity70.8%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot 4\right)} \cdot {z}^{2} \]
      3. unpow270.8%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z} \]
    8. Applied egg-rr88.0%

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

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

Alternative 6: 45.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := 4 \cdot \left(y \cdot t\right)\\
\mathbf{if}\;x \leq 5.7 \cdot 10^{+48}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot x - t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.69999999999999968e48

    1. Initial program 85.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in t around inf 30.5%

      \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
    3. Step-by-step derivation
      1. *-commutative30.5%

        \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} \]
    4. Simplified30.5%

      \[\leadsto \color{blue}{4 \cdot \left(y \cdot t\right)} \]

    if 5.69999999999999968e48 < x

    1. Initial program 91.5%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg91.5%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    3. Applied egg-rr91.5%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
    4. Step-by-step derivation
      1. fma-udef91.5%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
      3. sub-neg91.5%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
      4. flip--54.8%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
      5. pow-prod-up54.8%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
      6. metadata-eval54.8%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
      8. remove-double-neg54.8%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
      9. sub-neg54.8%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
      10. clear-num54.8%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      11. un-div-inv54.8%

        \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
      12. clear-num54.8%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
      13. metadata-eval54.8%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      14. pow-sqr54.8%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{\color{blue}{{z}^{2} \cdot {z}^{2}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      15. add-sqr-sqrt22.2%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
      16. sqrt-prod42.4%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}}} \]
    5. Applied egg-rr84.7%

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
    6. Taylor expanded in z around 0 73.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.7 \cdot 10^{+48}:\\ \;\;\;\;4 \cdot \left(y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - 4 \cdot \left(y \cdot t\right)\\ \end{array} \]

Alternative 7: 67.1% accurate, 1.4× speedup?

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

\\
x \cdot x - y \cdot \left(t \cdot -4\right)
\end{array}
Derivation
  1. Initial program 87.0%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Taylor expanded in z around 0 58.7%

    \[\leadsto x \cdot x - \color{blue}{-4 \cdot \left(t \cdot y\right)} \]
  3. Step-by-step derivation
    1. *-commutative58.7%

      \[\leadsto x \cdot x - \color{blue}{\left(t \cdot y\right) \cdot -4} \]
    2. *-commutative58.7%

      \[\leadsto x \cdot x - \color{blue}{\left(y \cdot t\right)} \cdot -4 \]
    3. associate-*l*58.3%

      \[\leadsto x \cdot x - \color{blue}{y \cdot \left(t \cdot -4\right)} \]
  4. Simplified58.3%

    \[\leadsto x \cdot x - \color{blue}{y \cdot \left(t \cdot -4\right)} \]
  5. Final simplification58.3%

    \[\leadsto x \cdot x - y \cdot \left(t \cdot -4\right) \]

Alternative 8: 6.0% accurate, 2.6× speedup?

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

\\
-4 \cdot \left(y \cdot t\right)
\end{array}
Derivation
  1. Initial program 87.0%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Step-by-step derivation
    1. fma-neg87.1%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
  3. Applied egg-rr87.1%

    \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\mathsf{fma}\left(z, z, -t\right)} \]
  4. Step-by-step derivation
    1. fma-udef87.0%

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

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(\color{blue}{{z}^{2}} + \left(-t\right)\right) \]
    3. sub-neg87.0%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left({z}^{2} - t\right)} \]
    4. flip--48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - t \cdot t}{{z}^{2} + t}} \]
    5. pow-prod-up48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{\color{blue}{{z}^{\left(2 + 2\right)}} - t \cdot t}{{z}^{2} + t} \]
    6. metadata-eval48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{\color{blue}{4}} - t \cdot t}{{z}^{2} + t} \]
    7. sqr-neg48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \color{blue}{\left(-t\right) \cdot \left(-t\right)}}{{z}^{2} + t} \]
    8. remove-double-neg48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} + \color{blue}{\left(-\left(-t\right)\right)}} \]
    9. sub-neg48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{\color{blue}{{z}^{2} - \left(-t\right)}} \]
    10. clear-num48.9%

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{1}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
    11. un-div-inv48.8%

      \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{{z}^{2} - \left(-t\right)}{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}}} \]
    12. clear-num48.8%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{\frac{{z}^{4} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}}} \]
    13. metadata-eval48.8%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
    14. pow-sqr48.8%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{\color{blue}{{z}^{2} \cdot {z}^{2}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
    15. add-sqr-sqrt23.2%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}} \]
    16. sqrt-prod33.7%

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}}} \]
  5. Applied egg-rr66.8%

    \[\leadsto x \cdot x - \color{blue}{\frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, t\right)}}} \]
  6. Taylor expanded in z around 0 39.4%

    \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{t}}} \]
  7. Taylor expanded in x around 0 6.1%

    \[\leadsto \color{blue}{-4 \cdot \left(t \cdot y\right)} \]
  8. Final simplification6.1%

    \[\leadsto -4 \cdot \left(y \cdot t\right) \]

Alternative 9: 31.8% accurate, 2.6× speedup?

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

\\
4 \cdot \left(y \cdot t\right)
\end{array}
Derivation
  1. Initial program 87.0%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Taylor expanded in t around inf 26.7%

    \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
  3. Step-by-step derivation
    1. *-commutative26.7%

      \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} \]
  4. Simplified26.7%

    \[\leadsto \color{blue}{4 \cdot \left(y \cdot t\right)} \]
  5. Final simplification26.7%

    \[\leadsto 4 \cdot \left(y \cdot t\right) \]

Developer target: 90.6% accurate, 1.0× speedup?

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

\\
x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)
\end{array}

Reproduce

?
herbie shell --seed 2023308 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

  :herbie-target
  (- (* x x) (* 4.0 (* y (- (* z z) t))))

  (- (* x x) (* (* y 4.0) (- (* z z) t))))