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

Percentage Accurate: 90.1% → 96.1%
Time: 9.4s
Alternatives: 11
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 11 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 96.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;4 \cdot y \leq 5 \cdot 10^{-119}:\\ \;\;\;\;\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) 5e-119)
   (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) <= 5e-119) {
		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) <= 5e-119)
		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], 5e-119], 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 5 \cdot 10^{-119}:\\
\;\;\;\;\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)) < 4.99999999999999993e-119

    1. Initial program 92.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. 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 rewrites99.3%

      \[\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 4.99999999999999993e-119 < (*.f64 y #s(literal 4 binary64))

    1. Initial program 91.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;4 \cdot y \leq 5 \cdot 10^{-119}:\\ \;\;\;\;\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: 59.8% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;x \cdot x \leq 4.8 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x x) < 1.05000000000000003e-293 or 5.6e-104 < (*.f64 x x) < 4.8000000000000003e65

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

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

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

    if 1.05000000000000003e-293 < (*.f64 x x) < 5.6e-104

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.8000000000000003e65 < (*.f64 x x)

      1. Initial program 90.0%

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

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

          \[\leadsto \color{blue}{x \cdot x} \]
        2. lower-*.f6479.0

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

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

    Alternative 3: 58.5% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(4 \cdot y\right) \cdot t\\ \mathbf{if}\;x \cdot x \leq 1.2 \cdot 10^{-293}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot x \leq 1.35 \cdot 10^{-107}:\\ \;\;\;\;\left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\ \mathbf{elif}\;x \cdot x \leq 4.8 \cdot 10^{+65}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* (* 4.0 y) t)))
       (if (<= (* x x) 1.2e-293)
         t_1
         (if (<= (* x x) 1.35e-107)
           (* (* (* z z) y) -4.0)
           (if (<= (* x x) 4.8e+65) t_1 (* x x))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (4.0 * y) * t;
    	double tmp;
    	if ((x * x) <= 1.2e-293) {
    		tmp = t_1;
    	} else if ((x * x) <= 1.35e-107) {
    		tmp = ((z * z) * y) * -4.0;
    	} else if ((x * x) <= 4.8e+65) {
    		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) :: tmp
        t_1 = (4.0d0 * y) * t
        if ((x * x) <= 1.2d-293) then
            tmp = t_1
        else if ((x * x) <= 1.35d-107) then
            tmp = ((z * z) * y) * (-4.0d0)
        else if ((x * x) <= 4.8d+65) 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 = (4.0 * y) * t;
    	double tmp;
    	if ((x * x) <= 1.2e-293) {
    		tmp = t_1;
    	} else if ((x * x) <= 1.35e-107) {
    		tmp = ((z * z) * y) * -4.0;
    	} else if ((x * x) <= 4.8e+65) {
    		tmp = t_1;
    	} else {
    		tmp = x * x;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = (4.0 * y) * t
    	tmp = 0
    	if (x * x) <= 1.2e-293:
    		tmp = t_1
    	elif (x * x) <= 1.35e-107:
    		tmp = ((z * z) * y) * -4.0
    	elif (x * x) <= 4.8e+65:
    		tmp = t_1
    	else:
    		tmp = x * x
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(4.0 * y) * t)
    	tmp = 0.0
    	if (Float64(x * x) <= 1.2e-293)
    		tmp = t_1;
    	elseif (Float64(x * x) <= 1.35e-107)
    		tmp = Float64(Float64(Float64(z * z) * y) * -4.0);
    	elseif (Float64(x * x) <= 4.8e+65)
    		tmp = t_1;
    	else
    		tmp = Float64(x * x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = (4.0 * y) * t;
    	tmp = 0.0;
    	if ((x * x) <= 1.2e-293)
    		tmp = t_1;
    	elseif ((x * x) <= 1.35e-107)
    		tmp = ((z * z) * y) * -4.0;
    	elseif ((x * x) <= 4.8e+65)
    		tmp = t_1;
    	else
    		tmp = x * x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(4.0 * y), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1.2e-293], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 1.35e-107], N[(N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 4.8e+65], t$95$1, N[(x * x), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(4 \cdot y\right) \cdot t\\
    \mathbf{if}\;x \cdot x \leq 1.2 \cdot 10^{-293}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \cdot x \leq 1.35 \cdot 10^{-107}:\\
    \;\;\;\;\left(\left(z \cdot z\right) \cdot y\right) \cdot -4\\
    
    \mathbf{elif}\;x \cdot x \leq 4.8 \cdot 10^{+65}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 x x) < 1.2e-293 or 1.35e-107 < (*.f64 x x) < 4.8000000000000003e65

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

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

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

      if 1.2e-293 < (*.f64 x x) < 1.35e-107

      1. Initial program 92.0%

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

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

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

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

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

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

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

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

      if 4.8000000000000003e65 < (*.f64 x x)

      1. Initial program 90.0%

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

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

          \[\leadsto \color{blue}{x \cdot x} \]
        2. lower-*.f6479.0

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

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

    Alternative 4: 88.5% accurate, 0.6× speedup?

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

      1. Initial program 98.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-eval99.3

          \[\leadsto \mathsf{fma}\left(x, x, \left(\left(z \cdot z - t\right) \cdot y\right) \cdot \color{blue}{-4}\right) \]
      4. Applied rewrites99.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 z around 0

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

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

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

      if 1.9999999999999998e125 < (*.f64 z z) < 2.0000000000000001e270

      1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 z around inf

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

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

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

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

      if 2.0000000000000001e270 < (*.f64 z z)

      1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right) \cdot -4 \]
        6. lower-*.f6477.7

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

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

          \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      9. Recombined 3 regimes into one program.
      10. Add Preprocessing

      Alternative 5: 88.3% accurate, 0.6× speedup?

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

        1. Initial program 98.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-eval99.3

            \[\leadsto \mathsf{fma}\left(x, x, \left(\left(z \cdot z - t\right) \cdot y\right) \cdot \color{blue}{-4}\right) \]
        4. Applied rewrites99.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 z around 0

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

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

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

        if 1.9999999999999998e125 < (*.f64 z z) < 2.0000000000000001e266

        1. Initial program 99.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 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        if 2.0000000000000001e266 < (*.f64 z z)

        1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
        9. Recombined 3 regimes into one program.
        10. Add Preprocessing

        Alternative 6: 94.5% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 6.2 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(\left(z \cdot z - t\right) \cdot y\right) \cdot -4\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 6.2e+156)
           (fma x x (* (* (- (* z z) t) y) -4.0))
           (fma (* z (* -4.0 y)) z (* x x))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= 6.2e+156) {
        		tmp = fma(x, x, ((((z * z) - t) * y) * -4.0));
        	} else {
        		tmp = fma((z * (-4.0 * y)), z, (x * x));
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= 6.2e+156)
        		tmp = fma(x, x, Float64(Float64(Float64(Float64(z * z) - t) * y) * -4.0));
        	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, 6.2e+156], N[(x * x + N[(N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision] * -4.0), $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 6.2 \cdot 10^{+156}:\\
        \;\;\;\;\mathsf{fma}\left(x, x, \left(\left(z \cdot z - t\right) \cdot y\right) \cdot -4\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 < 6.2000000000000004e156

          1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 6.2000000000000004e156 < z

          1. Initial program 72.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. 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 rewrites94.0%

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

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

            \[\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 \leq 6.2 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(\left(z \cdot z - t\right) \cdot y\right) \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \left(-4 \cdot y\right), z, x \cdot x\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 78.6% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 8.5 \cdot 10^{+62}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(t \cdot y\right) \cdot 4\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 8.5e+62)
           (fma x x (* (* t y) 4.0))
           (fma (* z (* -4.0 y)) z (* x x))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= 8.5e+62) {
        		tmp = fma(x, x, ((t * y) * 4.0));
        	} else {
        		tmp = fma((z * (-4.0 * y)), z, (x * x));
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= 8.5e+62)
        		tmp = fma(x, x, Float64(Float64(t * y) * 4.0));
        	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, 8.5e+62], N[(x * x + N[(N[(t * y), $MachinePrecision] * 4.0), $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 8.5 \cdot 10^{+62}:\\
        \;\;\;\;\mathsf{fma}\left(x, x, \left(t \cdot y\right) \cdot 4\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 < 8.4999999999999997e62

          1. Initial program 95.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-eval97.1

              \[\leadsto \mathsf{fma}\left(x, x, \left(\left(z \cdot z - t\right) \cdot y\right) \cdot \color{blue}{-4}\right) \]
          4. Applied rewrites97.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 z around 0

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

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

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

          if 8.4999999999999997e62 < z

          1. Initial program 78.0%

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

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

              \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
            3. +-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 rewrites91.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-*.f6493.6

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

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

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

        Alternative 8: 85.6% accurate, 1.0× speedup?

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

          1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\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 z around 0

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

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

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

          if 4.99999999999999972e193 < (*.f64 z z)

          1. Initial program 75.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 x \cdot x - \color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
            2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
          9. Recombined 2 regimes into one program.
          10. Add Preprocessing

          Alternative 9: 85.9% accurate, 1.0× speedup?

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

            1. Initial program 98.3%

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

              \[\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 4 \cdot \color{blue}{\left(y \cdot t\right)} + {x}^{2} \]
              5. associate-*r*N/A

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

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

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

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

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

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

            if 4.99999999999999972e193 < (*.f64 z z)

            1. Initial program 75.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 x \cdot x - \color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
              2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
            9. Recombined 2 regimes into one program.
            10. Add Preprocessing

            Alternative 10: 45.8% accurate, 1.6× speedup?

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

              1. Initial program 93.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. lower-*.f6438.2

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

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

              if 6e32 < x

              1. Initial program 85.0%

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

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

                  \[\leadsto \color{blue}{x \cdot x} \]
                2. lower-*.f6473.0

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

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

            Alternative 11: 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 92.0%

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

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

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

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

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

            Developer Target 1: 90.2% 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 2024235 
            (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))))