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

Percentage Accurate: 90.8% → 96.4%
Time: 7.7s
Alternatives: 9
Speedup: 0.9×

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.8% 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.4% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 1.7 \cdot 10^{+162}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(\left(z\_m \cdot z\_m - t\right) \cdot y\right) \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \mathsf{fma}\left(z\_m \cdot y, z\_m, t \cdot y\right) \cdot -4\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (if (<= z_m 1.7e+162)
   (fma x x (* (* (- (* z_m z_m) t) y) -4.0))
   (fma x x (* (fma (* z_m y) z_m (* t y)) -4.0))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if (z_m <= 1.7e+162) {
		tmp = fma(x, x, ((((z_m * z_m) - t) * y) * -4.0));
	} else {
		tmp = fma(x, x, (fma((z_m * y), z_m, (t * y)) * -4.0));
	}
	return tmp;
}
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (z_m <= 1.7e+162)
		tmp = fma(x, x, Float64(Float64(Float64(Float64(z_m * z_m) - t) * y) * -4.0));
	else
		tmp = fma(x, x, Float64(fma(Float64(z_m * y), z_m, Float64(t * y)) * -4.0));
	end
	return tmp
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := If[LessEqual[z$95$m, 1.7e+162], N[(x * x + N[(N[(N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(N[(z$95$m * y), $MachinePrecision] * z$95$m + N[(t * y), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \mathsf{fma}\left(z\_m \cdot y, z\_m, t \cdot y\right) \cdot -4\right)\\


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

    1. Initial program 88.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
      2. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{x \cdot x} + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) \]
      7. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot 4\right)}\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot 4}\right)\right) \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
      11. lower-*.f64N/A

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

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

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

    if 1.70000000000000001e162 < z

    1. Initial program 66.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
      2. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{x \cdot x} + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) \]
      7. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot 4\right)}\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot 4}\right)\right) \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right)} \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \]
      12. metadata-eval76.0

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

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

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right)} \cdot -4\right) \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(x, x, \left(y \cdot \color{blue}{\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)}\right) \cdot -4\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z\right) \cdot y + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right)} \cdot -4\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \left(\color{blue}{\left(z \cdot z\right)} \cdot y + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(x, x, \left(\color{blue}{z \cdot \left(z \cdot y\right)} + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \left(\color{blue}{\left(z \cdot y\right) \cdot z} + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\mathsf{fma}\left(z \cdot y, z, \left(\mathsf{neg}\left(t\right)\right) \cdot y\right)} \cdot -4\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{fma}\left(\color{blue}{y \cdot z}, z, \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{fma}\left(\color{blue}{y \cdot z}, z, \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
      12. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{fma}\left(y \cdot z, z, \color{blue}{\left(\mathsf{neg}\left(t\right)\right) \cdot y}\right) \cdot -4\right) \]
      13. lower-neg.f6484.8

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

      \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\mathsf{fma}\left(y \cdot z, z, \left(-t\right) \cdot y\right)} \cdot -4\right) \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{fma}\left(\color{blue}{y \cdot z}, z, \left(-t\right) \cdot y\right) \cdot -4\right) \]
      2. *-commutativeN/A

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

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

      \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\mathsf{fma}\left(z \cdot y, z, t \cdot y\right)} \cdot -4\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 63.5% accurate, 0.6× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} t_1 := z\_m \cdot z\_m - t\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-32}:\\ \;\;\;\;\left(4 \cdot y\right) \cdot t\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+197}:\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (let* ((t_1 (- (* z_m z_m) t)))
   (if (<= t_1 -4e-32)
     (* (* 4.0 y) t)
     (if (<= t_1 2e+197) (* x x) (* (* (* -4.0 z_m) y) z_m)))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double t_1 = (z_m * z_m) - t;
	double tmp;
	if (t_1 <= -4e-32) {
		tmp = (4.0 * y) * t;
	} else if (t_1 <= 2e+197) {
		tmp = x * x;
	} else {
		tmp = ((-4.0 * z_m) * y) * z_m;
	}
	return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z_m * z_m) - t
    if (t_1 <= (-4d-32)) then
        tmp = (4.0d0 * y) * t
    else if (t_1 <= 2d+197) then
        tmp = x * x
    else
        tmp = (((-4.0d0) * z_m) * y) * z_m
    end if
    code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
	double t_1 = (z_m * z_m) - t;
	double tmp;
	if (t_1 <= -4e-32) {
		tmp = (4.0 * y) * t;
	} else if (t_1 <= 2e+197) {
		tmp = x * x;
	} else {
		tmp = ((-4.0 * z_m) * y) * z_m;
	}
	return tmp;
}
z_m = math.fabs(z)
def code(x, y, z_m, t):
	t_1 = (z_m * z_m) - t
	tmp = 0
	if t_1 <= -4e-32:
		tmp = (4.0 * y) * t
	elif t_1 <= 2e+197:
		tmp = x * x
	else:
		tmp = ((-4.0 * z_m) * y) * z_m
	return tmp
z_m = abs(z)
function code(x, y, z_m, t)
	t_1 = Float64(Float64(z_m * z_m) - t)
	tmp = 0.0
	if (t_1 <= -4e-32)
		tmp = Float64(Float64(4.0 * y) * t);
	elseif (t_1 <= 2e+197)
		tmp = Float64(x * x);
	else
		tmp = Float64(Float64(Float64(-4.0 * z_m) * y) * z_m);
	end
	return tmp
end
z_m = abs(z);
function tmp_2 = code(x, y, z_m, t)
	t_1 = (z_m * z_m) - t;
	tmp = 0.0;
	if (t_1 <= -4e-32)
		tmp = (4.0 * y) * t;
	elseif (t_1 <= 2e+197)
		tmp = x * x;
	else
		tmp = ((-4.0 * z_m) * y) * z_m;
	end
	tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-32], N[(N[(4.0 * y), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2e+197], N[(x * x), $MachinePrecision], N[(N[(N[(-4.0 * z$95$m), $MachinePrecision] * y), $MachinePrecision] * z$95$m), $MachinePrecision]]]]
\begin{array}{l}
z_m = \left|z\right|

\\
\begin{array}{l}
t_1 := z\_m \cdot z\_m - t\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-32}:\\
\;\;\;\;\left(4 \cdot y\right) \cdot t\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+197}:\\
\;\;\;\;x \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 z z) t) < -4.00000000000000022e-32

    1. Initial program 89.5%

      \[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

      \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} \]
      4. lower-*.f6469.1

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

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

    if -4.00000000000000022e-32 < (-.f64 (*.f64 z z) t) < 1.9999999999999999e197

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{{x}^{2}} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \color{blue}{x \cdot x} \]
      2. lower-*.f6463.3

        \[\leadsto \color{blue}{x \cdot x} \]
    5. Applied rewrites63.3%

      \[\leadsto \color{blue}{x \cdot x} \]

    if 1.9999999999999999e197 < (-.f64 (*.f64 z z) t)

    1. Initial program 69.8%

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

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

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
      3. lower-*.f64N/A

        \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
      4. unpow2N/A

        \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
      5. lower-*.f6463.9

        \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
    5. Applied rewrites63.9%

      \[\leadsto \color{blue}{-4 \cdot \left(\left(z \cdot z\right) \cdot y\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites76.5%

        \[\leadsto \left(\left(-4 \cdot z\right) \cdot y\right) \cdot \color{blue}{z} \]
    7. Recombined 3 regimes into one program.
    8. Add Preprocessing

    Alternative 3: 60.1% accurate, 0.6× speedup?

    \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} t_1 := z\_m \cdot z\_m - t\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-32}:\\ \;\;\;\;\left(4 \cdot y\right) \cdot t\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+197}:\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z\_m \cdot z\_m\right) \cdot y\right) \cdot -4\\ \end{array} \end{array} \]
    z_m = (fabs.f64 z)
    (FPCore (x y z_m t)
     :precision binary64
     (let* ((t_1 (- (* z_m z_m) t)))
       (if (<= t_1 -4e-32)
         (* (* 4.0 y) t)
         (if (<= t_1 2e+197) (* x x) (* (* (* z_m z_m) y) -4.0)))))
    z_m = fabs(z);
    double code(double x, double y, double z_m, double t) {
    	double t_1 = (z_m * z_m) - t;
    	double tmp;
    	if (t_1 <= -4e-32) {
    		tmp = (4.0 * y) * t;
    	} else if (t_1 <= 2e+197) {
    		tmp = x * x;
    	} else {
    		tmp = ((z_m * z_m) * y) * -4.0;
    	}
    	return tmp;
    }
    
    z_m = abs(z)
    real(8) function code(x, y, z_m, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z_m
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = (z_m * z_m) - t
        if (t_1 <= (-4d-32)) then
            tmp = (4.0d0 * y) * t
        else if (t_1 <= 2d+197) then
            tmp = x * x
        else
            tmp = ((z_m * z_m) * y) * (-4.0d0)
        end if
        code = tmp
    end function
    
    z_m = Math.abs(z);
    public static double code(double x, double y, double z_m, double t) {
    	double t_1 = (z_m * z_m) - t;
    	double tmp;
    	if (t_1 <= -4e-32) {
    		tmp = (4.0 * y) * t;
    	} else if (t_1 <= 2e+197) {
    		tmp = x * x;
    	} else {
    		tmp = ((z_m * z_m) * y) * -4.0;
    	}
    	return tmp;
    }
    
    z_m = math.fabs(z)
    def code(x, y, z_m, t):
    	t_1 = (z_m * z_m) - t
    	tmp = 0
    	if t_1 <= -4e-32:
    		tmp = (4.0 * y) * t
    	elif t_1 <= 2e+197:
    		tmp = x * x
    	else:
    		tmp = ((z_m * z_m) * y) * -4.0
    	return tmp
    
    z_m = abs(z)
    function code(x, y, z_m, t)
    	t_1 = Float64(Float64(z_m * z_m) - t)
    	tmp = 0.0
    	if (t_1 <= -4e-32)
    		tmp = Float64(Float64(4.0 * y) * t);
    	elseif (t_1 <= 2e+197)
    		tmp = Float64(x * x);
    	else
    		tmp = Float64(Float64(Float64(z_m * z_m) * y) * -4.0);
    	end
    	return tmp
    end
    
    z_m = abs(z);
    function tmp_2 = code(x, y, z_m, t)
    	t_1 = (z_m * z_m) - t;
    	tmp = 0.0;
    	if (t_1 <= -4e-32)
    		tmp = (4.0 * y) * t;
    	elseif (t_1 <= 2e+197)
    		tmp = x * x;
    	else
    		tmp = ((z_m * z_m) * y) * -4.0;
    	end
    	tmp_2 = tmp;
    end
    
    z_m = N[Abs[z], $MachinePrecision]
    code[x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-32], N[(N[(4.0 * y), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 2e+197], N[(x * x), $MachinePrecision], N[(N[(N[(z$95$m * z$95$m), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision]]]]
    
    \begin{array}{l}
    z_m = \left|z\right|
    
    \\
    \begin{array}{l}
    t_1 := z\_m \cdot z\_m - t\\
    \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-32}:\\
    \;\;\;\;\left(4 \cdot y\right) \cdot t\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+197}:\\
    \;\;\;\;x \cdot x\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(z\_m \cdot z\_m\right) \cdot y\right) \cdot -4\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (*.f64 z z) t) < -4.00000000000000022e-32

      1. Initial program 89.5%

        \[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

        \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} \]
        2. associate-*r*N/A

          \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} \]
        4. lower-*.f6469.1

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

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

      if -4.00000000000000022e-32 < (-.f64 (*.f64 z z) t) < 1.9999999999999999e197

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{{x}^{2}} \]
      4. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto \color{blue}{x \cdot x} \]
        2. lower-*.f6463.3

          \[\leadsto \color{blue}{x \cdot x} \]
      5. Applied rewrites63.3%

        \[\leadsto \color{blue}{x \cdot x} \]

      if 1.9999999999999999e197 < (-.f64 (*.f64 z z) t)

      1. Initial program 69.8%

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

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

          \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
        2. *-commutativeN/A

          \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
        3. lower-*.f64N/A

          \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
        4. unpow2N/A

          \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
        5. lower-*.f6463.9

          \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
      5. Applied rewrites63.9%

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

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

    Alternative 4: 96.2% accurate, 0.9× speedup?

    \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 2.15 \cdot 10^{+150}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(\left(z\_m \cdot z\_m - t\right) \cdot y\right) \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\ \end{array} \end{array} \]
    z_m = (fabs.f64 z)
    (FPCore (x y z_m t)
     :precision binary64
     (if (<= z_m 2.15e+150)
       (fma x x (* (* (- (* z_m z_m) t) y) -4.0))
       (* (* (* -4.0 z_m) y) z_m)))
    z_m = fabs(z);
    double code(double x, double y, double z_m, double t) {
    	double tmp;
    	if (z_m <= 2.15e+150) {
    		tmp = fma(x, x, ((((z_m * z_m) - t) * y) * -4.0));
    	} else {
    		tmp = ((-4.0 * z_m) * y) * z_m;
    	}
    	return tmp;
    }
    
    z_m = abs(z)
    function code(x, y, z_m, t)
    	tmp = 0.0
    	if (z_m <= 2.15e+150)
    		tmp = fma(x, x, Float64(Float64(Float64(Float64(z_m * z_m) - t) * y) * -4.0));
    	else
    		tmp = Float64(Float64(Float64(-4.0 * z_m) * y) * z_m);
    	end
    	return tmp
    end
    
    z_m = N[Abs[z], $MachinePrecision]
    code[x_, y_, z$95$m_, t_] := If[LessEqual[z$95$m, 2.15e+150], N[(x * x + N[(N[(N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * z$95$m), $MachinePrecision] * y), $MachinePrecision] * z$95$m), $MachinePrecision]]
    
    \begin{array}{l}
    z_m = \left|z\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z\_m \leq 2.15 \cdot 10^{+150}:\\
    \;\;\;\;\mathsf{fma}\left(x, x, \left(\left(z\_m \cdot z\_m - t\right) \cdot y\right) \cdot -4\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 2.14999999999999999e150

      1. Initial program 87.9%

        \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
        2. sub-negN/A

          \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot x} + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
        5. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) \]
        7. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot 4\right)}\right)\right) \]
        8. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot 4}\right)\right) \]
        9. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
        10. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right)} \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \]
        12. metadata-eval93.0

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

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

      if 2.14999999999999999e150 < z

      1. Initial program 69.1%

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

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

          \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
        2. *-commutativeN/A

          \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
        3. lower-*.f64N/A

          \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
        4. unpow2N/A

          \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
        5. lower-*.f6478.2

          \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
      5. Applied rewrites78.2%

        \[\leadsto \color{blue}{-4 \cdot \left(\left(z \cdot z\right) \cdot y\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites90.9%

          \[\leadsto \left(\left(-4 \cdot z\right) \cdot y\right) \cdot \color{blue}{z} \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 5: 96.2% accurate, 0.9× speedup?

      \[\begin{array}{l} z_m = \left|z\right| \\ \mathsf{fma}\left(x, x, -4 \cdot \mathsf{fma}\left(z\_m \cdot y, z\_m, \left(-t\right) \cdot y\right)\right) \end{array} \]
      z_m = (fabs.f64 z)
      (FPCore (x y z_m t)
       :precision binary64
       (fma x x (* -4.0 (fma (* z_m y) z_m (* (- t) y)))))
      z_m = fabs(z);
      double code(double x, double y, double z_m, double t) {
      	return fma(x, x, (-4.0 * fma((z_m * y), z_m, (-t * y))));
      }
      
      z_m = abs(z)
      function code(x, y, z_m, t)
      	return fma(x, x, Float64(-4.0 * fma(Float64(z_m * y), z_m, Float64(Float64(-t) * y))))
      end
      
      z_m = N[Abs[z], $MachinePrecision]
      code[x_, y_, z$95$m_, t_] := N[(x * x + N[(-4.0 * N[(N[(z$95$m * y), $MachinePrecision] * z$95$m + N[((-t) * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      z_m = \left|z\right|
      
      \\
      \mathsf{fma}\left(x, x, -4 \cdot \mathsf{fma}\left(z\_m \cdot y, z\_m, \left(-t\right) \cdot y\right)\right)
      \end{array}
      
      Derivation
      1. Initial program 86.3%

        \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
        2. sub-negN/A

          \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot x} + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
        5. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) \]
        7. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot 4\right)}\right)\right) \]
        8. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot 4}\right)\right) \]
        9. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
        10. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right)} \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \]
        12. metadata-eval91.8

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

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

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right)} \cdot -4\right) \]
        2. *-commutativeN/A

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

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

          \[\leadsto \mathsf{fma}\left(x, x, \left(y \cdot \color{blue}{\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)}\right) \cdot -4\right) \]
        5. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z\right) \cdot y + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right)} \cdot -4\right) \]
        6. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \left(\color{blue}{\left(z \cdot z\right)} \cdot y + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
        7. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(x, x, \left(\color{blue}{z \cdot \left(z \cdot y\right)} + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, x, \left(\color{blue}{\left(z \cdot y\right) \cdot z} + \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\mathsf{fma}\left(z \cdot y, z, \left(\mathsf{neg}\left(t\right)\right) \cdot y\right)} \cdot -4\right) \]
        10. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{fma}\left(\color{blue}{y \cdot z}, z, \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
        11. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(x, x, \mathsf{fma}\left(\color{blue}{y \cdot z}, z, \left(\mathsf{neg}\left(t\right)\right) \cdot y\right) \cdot -4\right) \]
        12. lower-*.f64N/A

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

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

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

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

      Alternative 6: 85.9% accurate, 1.0× speedup?

      \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 10^{+141}:\\ \;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(t \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\ \end{array} \end{array} \]
      z_m = (fabs.f64 z)
      (FPCore (x y z_m t)
       :precision binary64
       (if (<= (* z_m z_m) 1e+141)
         (fma x x (* 4.0 (* t y)))
         (* (* (* -4.0 z_m) y) z_m)))
      z_m = fabs(z);
      double code(double x, double y, double z_m, double t) {
      	double tmp;
      	if ((z_m * z_m) <= 1e+141) {
      		tmp = fma(x, x, (4.0 * (t * y)));
      	} else {
      		tmp = ((-4.0 * z_m) * y) * z_m;
      	}
      	return tmp;
      }
      
      z_m = abs(z)
      function code(x, y, z_m, t)
      	tmp = 0.0
      	if (Float64(z_m * z_m) <= 1e+141)
      		tmp = fma(x, x, Float64(4.0 * Float64(t * y)));
      	else
      		tmp = Float64(Float64(Float64(-4.0 * z_m) * y) * z_m);
      	end
      	return tmp
      end
      
      z_m = N[Abs[z], $MachinePrecision]
      code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1e+141], N[(x * x + N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * z$95$m), $MachinePrecision] * y), $MachinePrecision] * z$95$m), $MachinePrecision]]
      
      \begin{array}{l}
      z_m = \left|z\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z\_m \cdot z\_m \leq 10^{+141}:\\
      \;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(t \cdot y\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 z z) < 1.00000000000000002e141

        1. Initial program 95.5%

          \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto \color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
          2. sub-negN/A

            \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{x \cdot x} + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
          5. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right) \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) \]
          7. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot 4\right)}\right)\right) \]
          8. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot 4}\right)\right) \]
          9. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
          10. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(\left(z \cdot z - t\right) \cdot y\right) \cdot \left(\mathsf{neg}\left(4\right)\right)}\right) \]
          11. lower-*.f64N/A

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

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

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

          \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{4 \cdot \left(t \cdot y\right)}\right) \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(t \cdot y\right) \cdot 4}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(t \cdot y\right) \cdot 4}\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(y \cdot t\right)} \cdot 4\right) \]
          4. lower-*.f6492.8

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

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

        if 1.00000000000000002e141 < (*.f64 z z)

        1. Initial program 71.6%

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

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

            \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
          2. *-commutativeN/A

            \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
          3. lower-*.f64N/A

            \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
          4. unpow2N/A

            \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
          5. lower-*.f6472.2

            \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
        5. Applied rewrites72.2%

          \[\leadsto \color{blue}{-4 \cdot \left(\left(z \cdot z\right) \cdot y\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites85.3%

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

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

        Alternative 7: 85.6% accurate, 1.0× speedup?

        \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 10^{+141}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot y, 4, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\ \end{array} \end{array} \]
        z_m = (fabs.f64 z)
        (FPCore (x y z_m t)
         :precision binary64
         (if (<= (* z_m z_m) 1e+141)
           (fma (* t y) 4.0 (* x x))
           (* (* (* -4.0 z_m) y) z_m)))
        z_m = fabs(z);
        double code(double x, double y, double z_m, double t) {
        	double tmp;
        	if ((z_m * z_m) <= 1e+141) {
        		tmp = fma((t * y), 4.0, (x * x));
        	} else {
        		tmp = ((-4.0 * z_m) * y) * z_m;
        	}
        	return tmp;
        }
        
        z_m = abs(z)
        function code(x, y, z_m, t)
        	tmp = 0.0
        	if (Float64(z_m * z_m) <= 1e+141)
        		tmp = fma(Float64(t * y), 4.0, Float64(x * x));
        	else
        		tmp = Float64(Float64(Float64(-4.0 * z_m) * y) * z_m);
        	end
        	return tmp
        end
        
        z_m = N[Abs[z], $MachinePrecision]
        code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1e+141], N[(N[(t * y), $MachinePrecision] * 4.0 + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * z$95$m), $MachinePrecision] * y), $MachinePrecision] * z$95$m), $MachinePrecision]]
        
        \begin{array}{l}
        z_m = \left|z\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z\_m \cdot z\_m \leq 10^{+141}:\\
        \;\;\;\;\mathsf{fma}\left(t \cdot y, 4, x \cdot x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(-4 \cdot z\_m\right) \cdot y\right) \cdot z\_m\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 z z) < 1.00000000000000002e141

          1. Initial program 95.5%

            \[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

            \[\leadsto \color{blue}{{x}^{2} - -4 \cdot \left(t \cdot y\right)} \]
          4. Step-by-step derivation
            1. cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{{x}^{2} + \left(\mathsf{neg}\left(-4\right)\right) \cdot \left(t \cdot y\right)} \]
            2. metadata-evalN/A

              \[\leadsto {x}^{2} + \color{blue}{4} \cdot \left(t \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right) + {x}^{2}} \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot 4} + {x}^{2} \]
            5. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot y, 4, {x}^{2}\right)} \]
            6. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{t \cdot y}, 4, {x}^{2}\right) \]
            7. unpow2N/A

              \[\leadsto \mathsf{fma}\left(t \cdot y, 4, \color{blue}{x \cdot x}\right) \]
            8. lower-*.f6489.6

              \[\leadsto \mathsf{fma}\left(t \cdot y, 4, \color{blue}{x \cdot x}\right) \]
          5. Applied rewrites89.6%

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

          if 1.00000000000000002e141 < (*.f64 z z)

          1. Initial program 71.6%

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

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

              \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
            2. *-commutativeN/A

              \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
            3. lower-*.f64N/A

              \[\leadsto -4 \cdot \color{blue}{\left({z}^{2} \cdot y\right)} \]
            4. unpow2N/A

              \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
            5. lower-*.f6472.2

              \[\leadsto -4 \cdot \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \]
          5. Applied rewrites72.2%

            \[\leadsto \color{blue}{-4 \cdot \left(\left(z \cdot z\right) \cdot y\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites85.3%

              \[\leadsto \left(\left(-4 \cdot z\right) \cdot y\right) \cdot \color{blue}{z} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 8: 58.7% accurate, 1.2× speedup?

          \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 6.2 \cdot 10^{+71}:\\ \;\;\;\;\left(4 \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
          z_m = (fabs.f64 z)
          (FPCore (x y z_m t)
           :precision binary64
           (if (<= (* x x) 6.2e+71) (* (* 4.0 y) t) (* x x)))
          z_m = fabs(z);
          double code(double x, double y, double z_m, double t) {
          	double tmp;
          	if ((x * x) <= 6.2e+71) {
          		tmp = (4.0 * y) * t;
          	} else {
          		tmp = x * x;
          	}
          	return tmp;
          }
          
          z_m = abs(z)
          real(8) function code(x, y, z_m, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z_m
              real(8), intent (in) :: t
              real(8) :: tmp
              if ((x * x) <= 6.2d+71) then
                  tmp = (4.0d0 * y) * t
              else
                  tmp = x * x
              end if
              code = tmp
          end function
          
          z_m = Math.abs(z);
          public static double code(double x, double y, double z_m, double t) {
          	double tmp;
          	if ((x * x) <= 6.2e+71) {
          		tmp = (4.0 * y) * t;
          	} else {
          		tmp = x * x;
          	}
          	return tmp;
          }
          
          z_m = math.fabs(z)
          def code(x, y, z_m, t):
          	tmp = 0
          	if (x * x) <= 6.2e+71:
          		tmp = (4.0 * y) * t
          	else:
          		tmp = x * x
          	return tmp
          
          z_m = abs(z)
          function code(x, y, z_m, t)
          	tmp = 0.0
          	if (Float64(x * x) <= 6.2e+71)
          		tmp = Float64(Float64(4.0 * y) * t);
          	else
          		tmp = Float64(x * x);
          	end
          	return tmp
          end
          
          z_m = abs(z);
          function tmp_2 = code(x, y, z_m, t)
          	tmp = 0.0;
          	if ((x * x) <= 6.2e+71)
          		tmp = (4.0 * y) * t;
          	else
          		tmp = x * x;
          	end
          	tmp_2 = tmp;
          end
          
          z_m = N[Abs[z], $MachinePrecision]
          code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 6.2e+71], N[(N[(4.0 * y), $MachinePrecision] * t), $MachinePrecision], N[(x * x), $MachinePrecision]]
          
          \begin{array}{l}
          z_m = \left|z\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \cdot x \leq 6.2 \cdot 10^{+71}:\\
          \;\;\;\;\left(4 \cdot y\right) \cdot t\\
          
          \mathbf{else}:\\
          \;\;\;\;x \cdot x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 x x) < 6.20000000000000036e71

            1. Initial program 91.1%

              \[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

              \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} \]
              4. lower-*.f6448.3

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

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

            if 6.20000000000000036e71 < (*.f64 x x)

            1. Initial program 80.8%

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

              \[\leadsto \color{blue}{{x}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{x \cdot x} \]
              2. lower-*.f6476.4

                \[\leadsto \color{blue}{x \cdot x} \]
            5. Applied rewrites76.4%

              \[\leadsto \color{blue}{x \cdot x} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 9: 40.7% accurate, 4.5× speedup?

          \[\begin{array}{l} z_m = \left|z\right| \\ x \cdot x \end{array} \]
          z_m = (fabs.f64 z)
          (FPCore (x y z_m t) :precision binary64 (* x x))
          z_m = fabs(z);
          double code(double x, double y, double z_m, double t) {
          	return x * x;
          }
          
          z_m = abs(z)
          real(8) function code(x, y, z_m, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z_m
              real(8), intent (in) :: t
              code = x * x
          end function
          
          z_m = Math.abs(z);
          public static double code(double x, double y, double z_m, double t) {
          	return x * x;
          }
          
          z_m = math.fabs(z)
          def code(x, y, z_m, t):
          	return x * x
          
          z_m = abs(z)
          function code(x, y, z_m, t)
          	return Float64(x * x)
          end
          
          z_m = abs(z);
          function tmp = code(x, y, z_m, t)
          	tmp = x * x;
          end
          
          z_m = N[Abs[z], $MachinePrecision]
          code[x_, y_, z$95$m_, t_] := N[(x * x), $MachinePrecision]
          
          \begin{array}{l}
          z_m = \left|z\right|
          
          \\
          x \cdot x
          \end{array}
          
          Derivation
          1. Initial program 86.3%

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

            \[\leadsto \color{blue}{{x}^{2}} \]
          4. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \color{blue}{x \cdot x} \]
            2. lower-*.f6442.5

              \[\leadsto \color{blue}{x \cdot x} \]
          5. Applied rewrites42.5%

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

          Developer Target 1: 90.8% 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 2024276 
          (FPCore (x y z t)
            :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
            :precision binary64
          
            :alt
            (! :herbie-platform default (- (* x x) (* 4 (* y (- (* z z) t)))))
          
            (- (* x x) (* (* y 4.0) (- (* z z) t))))