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

Percentage Accurate: 90.4% → 96.8%
Time: 9.3s
Alternatives: 13
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 13 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.4% 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.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y #s(literal 4 binary64)) < 2.00000000000000009e93

    1. Initial program 92.8%

      \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000009e93 < (*.f64 y #s(literal 4 binary64))

    1. Initial program 81.2%

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

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

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

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

Alternative 2: 47.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(4 \cdot y\right)\\ t_2 := \left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{if}\;x \leq 4.8 \cdot 10^{-260}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-217}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-135}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-103}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+93}:\\ \;\;\;\;\left(z \cdot \left(-4 \cdot y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (* 4.0 y))) (t_2 (* (* (* z z) y) -4.0)))
   (if (<= x 4.8e-260)
     t_2
     (if (<= x 9.5e-217)
       t_1
       (if (<= x 1.05e-135)
         t_2
         (if (<= x 3.6e-103)
           t_1
           (if (<= x 8.2e+93) (* (* z (* -4.0 y)) z) (* x x))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (4.0 * y);
	double t_2 = ((z * z) * y) * -4.0;
	double tmp;
	if (x <= 4.8e-260) {
		tmp = t_2;
	} else if (x <= 9.5e-217) {
		tmp = t_1;
	} else if (x <= 1.05e-135) {
		tmp = t_2;
	} else if (x <= 3.6e-103) {
		tmp = t_1;
	} else if (x <= 8.2e+93) {
		tmp = (z * (-4.0 * y)) * z;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (4.0d0 * y)
    t_2 = ((z * z) * y) * (-4.0d0)
    if (x <= 4.8d-260) then
        tmp = t_2
    else if (x <= 9.5d-217) then
        tmp = t_1
    else if (x <= 1.05d-135) then
        tmp = t_2
    else if (x <= 3.6d-103) then
        tmp = t_1
    else if (x <= 8.2d+93) then
        tmp = (z * ((-4.0d0) * y)) * z
    else
        tmp = x * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (4.0 * y);
	double t_2 = ((z * z) * y) * -4.0;
	double tmp;
	if (x <= 4.8e-260) {
		tmp = t_2;
	} else if (x <= 9.5e-217) {
		tmp = t_1;
	} else if (x <= 1.05e-135) {
		tmp = t_2;
	} else if (x <= 3.6e-103) {
		tmp = t_1;
	} else if (x <= 8.2e+93) {
		tmp = (z * (-4.0 * y)) * z;
	} else {
		tmp = x * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (4.0 * y)
	t_2 = ((z * z) * y) * -4.0
	tmp = 0
	if x <= 4.8e-260:
		tmp = t_2
	elif x <= 9.5e-217:
		tmp = t_1
	elif x <= 1.05e-135:
		tmp = t_2
	elif x <= 3.6e-103:
		tmp = t_1
	elif x <= 8.2e+93:
		tmp = (z * (-4.0 * y)) * z
	else:
		tmp = x * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(4.0 * y))
	t_2 = Float64(Float64(Float64(z * z) * y) * -4.0)
	tmp = 0.0
	if (x <= 4.8e-260)
		tmp = t_2;
	elseif (x <= 9.5e-217)
		tmp = t_1;
	elseif (x <= 1.05e-135)
		tmp = t_2;
	elseif (x <= 3.6e-103)
		tmp = t_1;
	elseif (x <= 8.2e+93)
		tmp = Float64(Float64(z * Float64(-4.0 * y)) * z);
	else
		tmp = Float64(x * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (4.0 * y);
	t_2 = ((z * z) * y) * -4.0;
	tmp = 0.0;
	if (x <= 4.8e-260)
		tmp = t_2;
	elseif (x <= 9.5e-217)
		tmp = t_1;
	elseif (x <= 1.05e-135)
		tmp = t_2;
	elseif (x <= 3.6e-103)
		tmp = t_1;
	elseif (x <= 8.2e+93)
		tmp = (z * (-4.0 * y)) * z;
	else
		tmp = x * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[x, 4.8e-260], t$95$2, If[LessEqual[x, 9.5e-217], t$95$1, If[LessEqual[x, 1.05e-135], t$95$2, If[LessEqual[x, 3.6e-103], t$95$1, If[LessEqual[x, 8.2e+93], N[(N[(z * N[(-4.0 * y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(x * x), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(4 \cdot y\right)\\
t_2 := \left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\
\mathbf{if}\;x \leq 4.8 \cdot 10^{-260}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-135}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 3.6 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 8.2 \cdot 10^{+93}:\\
\;\;\;\;\left(z \cdot \left(-4 \cdot y\right)\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < 4.8000000000000001e-260 or 9.5000000000000001e-217 < x < 1.05e-135

    1. Initial program 91.4%

      \[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-*.f6438.9

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

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

    if 4.8000000000000001e-260 < x < 9.5000000000000001e-217 or 1.05e-135 < x < 3.5999999999999998e-103

    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 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. *-commutativeN/A

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

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

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

    if 3.5999999999999998e-103 < x < 8.2000000000000002e93

    1. Initial program 94.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 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-*.f6449.7

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

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

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

      if 8.2000000000000002e93 < x

      1. Initial program 82.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-*.f6486.4

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

        \[\leadsto \color{blue}{x \cdot x} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification53.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.8 \cdot 10^{-260}:\\ \;\;\;\;\left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-217}:\\ \;\;\;\;t \cdot \left(4 \cdot y\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-135}:\\ \;\;\;\;\left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-103}:\\ \;\;\;\;t \cdot \left(4 \cdot y\right)\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+93}:\\ \;\;\;\;\left(z \cdot \left(-4 \cdot y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 84.4% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-64}:\\ \;\;\;\;\left(\mathsf{fma}\left(z, z, -t\right) \cdot y\right) \cdot -4\\ \mathbf{elif}\;x \cdot x \leq 4 \cdot 10^{+260}:\\ \;\;\;\;\mathsf{fma}\left(-4, \left(z \cdot z\right) \cdot y, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(t \cdot y\right) \cdot 4\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= (* x x) 2e-64)
       (* (* (fma z z (- t)) y) -4.0)
       (if (<= (* x x) 4e+260)
         (fma -4.0 (* (* z z) y) (* x x))
         (fma x x (* (* t y) 4.0)))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if ((x * x) <= 2e-64) {
    		tmp = (fma(z, z, -t) * y) * -4.0;
    	} else if ((x * x) <= 4e+260) {
    		tmp = fma(-4.0, ((z * z) * y), (x * x));
    	} else {
    		tmp = fma(x, x, ((t * y) * 4.0));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (Float64(x * x) <= 2e-64)
    		tmp = Float64(Float64(fma(z, z, Float64(-t)) * y) * -4.0);
    	elseif (Float64(x * x) <= 4e+260)
    		tmp = fma(-4.0, Float64(Float64(z * z) * y), Float64(x * x));
    	else
    		tmp = fma(x, x, Float64(Float64(t * y) * 4.0));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 2e-64], N[(N[(N[(z * z + (-t)), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 4e+260], N[(-4.0 * N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(t * y), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-64}:\\
    \;\;\;\;\left(\mathsf{fma}\left(z, z, -t\right) \cdot y\right) \cdot -4\\
    
    \mathbf{elif}\;x \cdot x \leq 4 \cdot 10^{+260}:\\
    \;\;\;\;\mathsf{fma}\left(-4, \left(z \cdot z\right) \cdot y, x \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(x, x, \left(t \cdot y\right) \cdot 4\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 x x) < 1.99999999999999993e-64

      1. Initial program 98.1%

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\color{blue}{z \cdot z} + \left(\mathsf{neg}\left(t\right)\right)\right) \cdot y\right) \cdot -4 \]
        7. mul-1-negN/A

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

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

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

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

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

      if 1.99999999999999993e-64 < (*.f64 x x) < 4.00000000000000026e260

      1. Initial program 97.0%

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

        \[\leadsto \color{blue}{{x}^{2} - 4 \cdot \left(y \cdot {z}^{2}\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(y \cdot {z}^{2}\right)} \]
        2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

      if 4.00000000000000026e260 < (*.f64 x x)

      1. Initial program 75.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-eval84.3

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

        \[\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. lower-*.f6491.6

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

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

    Alternative 4: 97.3% accurate, 0.7× speedup?

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

      1. Initial program 97.8%

        \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

      if 1e251 < (*.f64 z z)

      1. Initial program 70.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 46.7% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(4 \cdot y\right)\\ t_2 := \left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{if}\;x \leq 4.8 \cdot 10^{-260}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-217}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-135}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* t (* 4.0 y))) (t_2 (* (* (* z z) y) -4.0)))
       (if (<= x 4.8e-260)
         t_2
         (if (<= x 9.5e-217)
           t_1
           (if (<= x 1.05e-135) t_2 (if (<= x 6.8e-31) t_1 (* x x)))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = t * (4.0 * y);
    	double t_2 = ((z * z) * y) * -4.0;
    	double tmp;
    	if (x <= 4.8e-260) {
    		tmp = t_2;
    	} else if (x <= 9.5e-217) {
    		tmp = t_1;
    	} else if (x <= 1.05e-135) {
    		tmp = t_2;
    	} else if (x <= 6.8e-31) {
    		tmp = t_1;
    	} 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) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_1 = t * (4.0d0 * y)
        t_2 = ((z * z) * y) * (-4.0d0)
        if (x <= 4.8d-260) then
            tmp = t_2
        else if (x <= 9.5d-217) then
            tmp = t_1
        else if (x <= 1.05d-135) then
            tmp = t_2
        else if (x <= 6.8d-31) then
            tmp = t_1
        else
            tmp = x * x
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = t * (4.0 * y);
    	double t_2 = ((z * z) * y) * -4.0;
    	double tmp;
    	if (x <= 4.8e-260) {
    		tmp = t_2;
    	} else if (x <= 9.5e-217) {
    		tmp = t_1;
    	} else if (x <= 1.05e-135) {
    		tmp = t_2;
    	} else if (x <= 6.8e-31) {
    		tmp = t_1;
    	} else {
    		tmp = x * x;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = t * (4.0 * y)
    	t_2 = ((z * z) * y) * -4.0
    	tmp = 0
    	if x <= 4.8e-260:
    		tmp = t_2
    	elif x <= 9.5e-217:
    		tmp = t_1
    	elif x <= 1.05e-135:
    		tmp = t_2
    	elif x <= 6.8e-31:
    		tmp = t_1
    	else:
    		tmp = x * x
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(t * Float64(4.0 * y))
    	t_2 = Float64(Float64(Float64(z * z) * y) * -4.0)
    	tmp = 0.0
    	if (x <= 4.8e-260)
    		tmp = t_2;
    	elseif (x <= 9.5e-217)
    		tmp = t_1;
    	elseif (x <= 1.05e-135)
    		tmp = t_2;
    	elseif (x <= 6.8e-31)
    		tmp = t_1;
    	else
    		tmp = Float64(x * x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = t * (4.0 * y);
    	t_2 = ((z * z) * y) * -4.0;
    	tmp = 0.0;
    	if (x <= 4.8e-260)
    		tmp = t_2;
    	elseif (x <= 9.5e-217)
    		tmp = t_1;
    	elseif (x <= 1.05e-135)
    		tmp = t_2;
    	elseif (x <= 6.8e-31)
    		tmp = t_1;
    	else
    		tmp = x * x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[x, 4.8e-260], t$95$2, If[LessEqual[x, 9.5e-217], t$95$1, If[LessEqual[x, 1.05e-135], t$95$2, If[LessEqual[x, 6.8e-31], t$95$1, N[(x * x), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := t \cdot \left(4 \cdot y\right)\\
    t_2 := \left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\
    \mathbf{if}\;x \leq 4.8 \cdot 10^{-260}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;x \leq 9.5 \cdot 10^{-217}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 1.05 \cdot 10^{-135}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;x \leq 6.8 \cdot 10^{-31}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < 4.8000000000000001e-260 or 9.5000000000000001e-217 < x < 1.05e-135

      1. Initial program 91.4%

        \[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-*.f6438.9

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

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

      if 4.8000000000000001e-260 < x < 9.5000000000000001e-217 or 1.05e-135 < x < 6.8000000000000002e-31

      1. Initial program 96.8%

        \[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. *-commutativeN/A

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

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

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

      if 6.8000000000000002e-31 < x

      1. Initial program 86.7%

        \[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-*.f6467.2

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.8 \cdot 10^{-260}:\\ \;\;\;\;\left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-217}:\\ \;\;\;\;t \cdot \left(4 \cdot y\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-135}:\\ \;\;\;\;\left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-31}:\\ \;\;\;\;t \cdot \left(4 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 93.2% accurate, 0.9× speedup?

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

      1. Initial program 92.2%

        \[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-eval94.4

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

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

      if 1.79999999999999996e232 < x

      1. Initial program 75.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-*.f6491.7

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

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

    Alternative 7: 83.1% accurate, 0.9× speedup?

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

      1. Initial program 98.1%

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\color{blue}{z \cdot z} + \left(\mathsf{neg}\left(t\right)\right)\right) \cdot y\right) \cdot -4 \]
        7. mul-1-negN/A

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

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

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

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

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

      if 1e-61 < (*.f64 x x)

      1. Initial program 85.1%

        \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 82.7% accurate, 0.9× speedup?

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

      1. Initial program 98.1%

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\color{blue}{z \cdot z} + \left(\mathsf{neg}\left(t\right)\right)\right) \cdot y\right) \cdot -4 \]
        7. mul-1-negN/A

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

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

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

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

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

      if 1e-61 < (*.f64 x x)

      1. Initial program 85.1%

        \[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-eval89.9

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

        \[\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. lower-*.f6480.8

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

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

    Alternative 9: 79.2% accurate, 1.0× speedup?

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

      1. Initial program 92.8%

        \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.9e-45 < z

      1. Initial program 85.4%

        \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 10: 85.2% accurate, 1.0× speedup?

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

      1. Initial program 97.4%

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

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

        \[\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. lower-*.f6485.5

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

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

      if 2e120 < (*.f64 z z)

      1. Initial program 78.7%

        \[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-*.f6470.5

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

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

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

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

      Alternative 11: 85.0% accurate, 1.0× speedup?

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

        1. Initial program 97.4%

          \[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-*.f6484.8

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

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

        if 2e120 < (*.f64 z z)

        1. Initial program 78.7%

          \[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-*.f6470.5

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

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

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

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

        Alternative 12: 44.4% accurate, 1.6× speedup?

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

          1. Initial program 92.3%

            \[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. *-commutativeN/A

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

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

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

          if 6.8000000000000002e-31 < x

          1. Initial program 86.7%

            \[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-*.f6467.2

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

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

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

        Alternative 13: 41.0% accurate, 4.5× 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 90.6%

          \[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-*.f6443.0

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

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

        Developer Target 1: 90.5% 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 2024268 
        (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))))