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

Percentage Accurate: 91.1% → 93.4%
Time: 10.9s
Alternatives: 6
Speedup: 0.5×

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 6 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: 91.1% 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: 93.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right) \leq 5 \cdot 10^{+306}:\\ \;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(\left(z \cdot \frac{z}{t} + -1\right) \cdot \left(t \cdot y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* (- (* z z) t) (* y 4.0)) 5e+306)
   (+ (* x x) (* (* y 4.0) (- t (* z z))))
   (* -4.0 (* (+ (* z (/ z t)) -1.0) (* t y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((((z * z) - t) * (y * 4.0)) <= 5e+306) {
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	} else {
		tmp = -4.0 * (((z * (z / t)) + -1.0) * (t * y));
	}
	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) - t) * (y * 4.0d0)) <= 5d+306) then
        tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
    else
        tmp = (-4.0d0) * (((z * (z / t)) + (-1.0d0)) * (t * y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((((z * z) - t) * (y * 4.0)) <= 5e+306) {
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	} else {
		tmp = -4.0 * (((z * (z / t)) + -1.0) * (t * y));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (((z * z) - t) * (y * 4.0)) <= 5e+306:
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)))
	else:
		tmp = -4.0 * (((z * (z / t)) + -1.0) * (t * y))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(Float64(z * z) - t) * Float64(y * 4.0)) <= 5e+306)
		tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z))));
	else
		tmp = Float64(-4.0 * Float64(Float64(Float64(z * Float64(z / t)) + -1.0) * Float64(t * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((((z * z) - t) * (y * 4.0)) <= 5e+306)
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	else
		tmp = -4.0 * (((z * (z / t)) + -1.0) * (t * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * 4.0), $MachinePrecision]), $MachinePrecision], 5e+306], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(\left(z \cdot \frac{z}{t} + -1\right) \cdot \left(t \cdot y\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 y #s(literal 4 binary64)) (-.f64 (*.f64 z z) t)) < 4.99999999999999993e306

    1. Initial program 96.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing

    if 4.99999999999999993e306 < (*.f64 (*.f64 y #s(literal 4 binary64)) (-.f64 (*.f64 z z) t))

    1. Initial program 70.2%

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

      \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(t \cdot \left(\frac{{z}^{2}}{t} - 1\right)\right)} \]
    4. Step-by-step derivation
      1. unpow270.2%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(t \cdot \left(\frac{\color{blue}{z \cdot z}}{t} - 1\right)\right) \]
      2. *-un-lft-identity70.2%

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

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

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

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

        \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot \left(\frac{{z}^{2}}{t} - 1\right)\right)\right) \cdot -4} \]
      2. associate-*r*83.1%

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

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

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

      \[\leadsto \color{blue}{\left(\left(t \cdot y\right) \cdot \left(\frac{{z}^{2}}{t} + -1\right)\right) \cdot -4} \]
    9. Step-by-step derivation
      1. unpow270.2%

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(t \cdot \left(\frac{\color{blue}{z \cdot z}}{t} - 1\right)\right) \]
      2. *-un-lft-identity70.2%

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(t \cdot \left(\color{blue}{\frac{z}{1} \cdot \frac{z}{t}} - 1\right)\right) \]
    10. Applied egg-rr85.1%

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

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

Alternative 2: 93.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma x x (* (- (* z z) t) (* y -4.0))))
double code(double x, double y, double z, double t) {
	return fma(x, x, (((z * z) - t) * (y * -4.0)));
}
function code(x, y, z, t)
	return fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0)))
end
code[x_, y_, z_, t_] := N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)
\end{array}
Derivation
  1. Initial program 91.3%

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

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

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

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

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

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

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

Alternative 3: 93.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (* x x) (* (* y 4.0) (- t (* z z))))))
   (if (<= t_1 INFINITY) t_1 (* x (- x)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = x * -x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = x * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * x) + ((y * 4.0) * (t - (z * z)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = x * -x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = x * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * (-x)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x x) (*.f64 (*.f64 y #s(literal 4 binary64)) (-.f64 (*.f64 z z) t))) < +inf.0

    1. Initial program 94.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing

    if +inf.0 < (-.f64 (*.f64 x x) (*.f64 (*.f64 y #s(literal 4 binary64)) (-.f64 (*.f64 z z) t)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

        \[\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-neg12.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-{x}^{4}}{-{x}^{2}}} \]
    8. Step-by-step derivation
      1. neg-sub00.0%

        \[\leadsto \frac{\color{blue}{0 - {x}^{4}}}{-{x}^{2}} \]
      2. metadata-eval0.0%

        \[\leadsto \frac{\color{blue}{0 \cdot 0} - {x}^{4}}{-{x}^{2}} \]
      3. metadata-eval0.0%

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

        \[\leadsto \frac{0 \cdot 0 - \color{blue}{{x}^{2} \cdot {x}^{2}}}{-{x}^{2}} \]
      5. pow-prod-down0.0%

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

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

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{-\color{blue}{x \cdot x}} \]
      8. neg-sub00.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{\color{blue}{0 - x \cdot x}} \]
      9. sub-neg0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{\color{blue}{0 + \left(-x \cdot x\right)}} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{-x \cdot x} \cdot \sqrt{-x \cdot x}}} \]
      11. sqrt-unprod0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{\left(-x \cdot x\right) \cdot \left(-x \cdot x\right)}}} \]
      12. sqr-neg0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}}} \]
      13. sqrt-prod0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{x \cdot x}} \]
      15. flip--75.0%

        \[\leadsto \color{blue}{0 - x \cdot x} \]
      16. neg-sub075.0%

        \[\leadsto \color{blue}{-x \cdot x} \]
      17. distribute-lft-neg-in75.0%

        \[\leadsto \color{blue}{\left(-x\right) \cdot x} \]
    9. Applied egg-rr75.0%

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

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

Alternative 4: 45.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.2 \cdot 10^{+16}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\

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


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

    1. Initial program 92.9%

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

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

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

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

    if 7.2e16 < x

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

        \[\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-neg89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-{x}^{4}}{-{x}^{2}}} \]
    8. Step-by-step derivation
      1. neg-sub011.5%

        \[\leadsto \frac{\color{blue}{0 - {x}^{4}}}{-{x}^{2}} \]
      2. metadata-eval11.5%

        \[\leadsto \frac{\color{blue}{0 \cdot 0} - {x}^{4}}{-{x}^{2}} \]
      3. metadata-eval11.5%

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

        \[\leadsto \frac{0 \cdot 0 - \color{blue}{{x}^{2} \cdot {x}^{2}}}{-{x}^{2}} \]
      5. pow-prod-down11.5%

        \[\leadsto \frac{0 \cdot 0 - \color{blue}{{\left(x \cdot x\right)}^{2}}}{-{x}^{2}} \]
      6. pow211.5%

        \[\leadsto \frac{0 \cdot 0 - \color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}}{-{x}^{2}} \]
      7. pow211.5%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{-\color{blue}{x \cdot x}} \]
      8. neg-sub011.5%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{\color{blue}{0 - x \cdot x}} \]
      9. sub-neg11.5%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{\color{blue}{0 + \left(-x \cdot x\right)}} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{-x \cdot x} \cdot \sqrt{-x \cdot x}}} \]
      11. sqrt-unprod0.6%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{\left(-x \cdot x\right) \cdot \left(-x \cdot x\right)}}} \]
      12. sqr-neg0.6%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}}} \]
      13. sqrt-prod4.4%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}}} \]
      14. add-sqr-sqrt4.4%

        \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{x \cdot x}} \]
      15. flip--4.7%

        \[\leadsto \color{blue}{0 - x \cdot x} \]
      16. neg-sub04.7%

        \[\leadsto \color{blue}{-x \cdot x} \]
      17. add-sqr-sqrt0.0%

        \[\leadsto \color{blue}{\sqrt{-x \cdot x} \cdot \sqrt{-x \cdot x}} \]
      18. sqrt-unprod56.6%

        \[\leadsto \color{blue}{\sqrt{\left(-x \cdot x\right) \cdot \left(-x \cdot x\right)}} \]
      19. sqr-neg56.6%

        \[\leadsto \sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}} \]
      20. sqrt-prod68.0%

        \[\leadsto \color{blue}{\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}} \]
      21. add-sqr-sqrt68.0%

        \[\leadsto \color{blue}{x \cdot x} \]
    9. Applied egg-rr68.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7.2 \cdot 10^{+16}:\\ \;\;\;\;y \cdot \left(t \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.6% accurate, 1.4× speedup?

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

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

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

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

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

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

    \[\leadsto x \cdot x - -4 \cdot \left(t \cdot y\right) \]
  7. Add Preprocessing

Alternative 6: 41.3% accurate, 4.3× speedup?

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

\\
x \cdot x
\end{array}
Derivation
  1. Initial program 91.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-inv91.3%

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

      \[\leadsto x \cdot x + \color{blue}{\left(\left(-y\right) \cdot 4\right)} \cdot \left(z \cdot z - t\right) \]
    3. +-commutative91.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-out91.3%

      \[\leadsto \color{blue}{\left(-y \cdot 4\right)} \cdot \left(z \cdot z - t\right) + x \cdot x \]
    5. distribute-lft-neg-in91.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-in91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-{x}^{4}}{-{x}^{2}}} \]
  8. Step-by-step derivation
    1. neg-sub08.5%

      \[\leadsto \frac{\color{blue}{0 - {x}^{4}}}{-{x}^{2}} \]
    2. metadata-eval8.5%

      \[\leadsto \frac{\color{blue}{0 \cdot 0} - {x}^{4}}{-{x}^{2}} \]
    3. metadata-eval8.5%

      \[\leadsto \frac{0 \cdot 0 - {x}^{\color{blue}{\left(2 + 2\right)}}}{-{x}^{2}} \]
    4. pow-prod-up8.6%

      \[\leadsto \frac{0 \cdot 0 - \color{blue}{{x}^{2} \cdot {x}^{2}}}{-{x}^{2}} \]
    5. pow-prod-down8.6%

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

      \[\leadsto \frac{0 \cdot 0 - \color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}}{-{x}^{2}} \]
    7. pow28.6%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{-\color{blue}{x \cdot x}} \]
    8. neg-sub08.6%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{\color{blue}{0 - x \cdot x}} \]
    9. sub-neg8.6%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{\color{blue}{0 + \left(-x \cdot x\right)}} \]
    10. add-sqr-sqrt0.0%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{-x \cdot x} \cdot \sqrt{-x \cdot x}}} \]
    11. sqrt-unprod0.6%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{\left(-x \cdot x\right) \cdot \left(-x \cdot x\right)}}} \]
    12. sqr-neg0.6%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}}} \]
    13. sqrt-prod3.4%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}}} \]
    14. add-sqr-sqrt3.4%

      \[\leadsto \frac{0 \cdot 0 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{0 + \color{blue}{x \cdot x}} \]
    15. flip--5.9%

      \[\leadsto \color{blue}{0 - x \cdot x} \]
    16. neg-sub05.9%

      \[\leadsto \color{blue}{-x \cdot x} \]
    17. add-sqr-sqrt2.3%

      \[\leadsto \color{blue}{\sqrt{-x \cdot x} \cdot \sqrt{-x \cdot x}} \]
    18. sqrt-unprod34.7%

      \[\leadsto \color{blue}{\sqrt{\left(-x \cdot x\right) \cdot \left(-x \cdot x\right)}} \]
    19. sqr-neg34.7%

      \[\leadsto \sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}} \]
    20. sqrt-prod41.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}} \]
    21. add-sqr-sqrt41.6%

      \[\leadsto \color{blue}{x \cdot x} \]
  9. Applied egg-rr41.6%

    \[\leadsto \color{blue}{x \cdot x} \]
  10. Add Preprocessing

Developer target: 91.1% 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 2024110 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

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

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