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

Percentage Accurate: 90.8% → 96.3%
Time: 8.2s
Alternatives: 6
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 6 alternatives:

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

Initial Program: 90.8% accurate, 1.0× speedup?

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

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

Alternative 1: 96.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 96.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-eval98.4

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

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

    if 5.00000000000000016e285 < (*.f64 z z)

    1. Initial program 62.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 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-*.f6473.2

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

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

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

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

    Alternative 2: 61.4% accurate, 0.6× speedup?

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

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

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

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

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

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

        if -5.0000000000000002e237 < (-.f64 (*.f64 z z) t) < 2.0000000000000001e235

        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. flip--N/A

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

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

            \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right) \cdot \left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)}}} \]
          5. clear-numN/A

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

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

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}}} \]
          8. inv-powN/A

            \[\leadsto \frac{1}{\color{blue}{{\left(x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)}^{-1}}} \]
          9. lower-pow.f6497.1

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \frac{{z}^{2}}{t} + t \cdot \color{blue}{\left(y \cdot -1\right)}, -4, x \cdot x\right)\right)}^{-1}} \]
          6. associate-*r*N/A

            \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \frac{{z}^{2}}{t} + \color{blue}{\left(t \cdot y\right) \cdot -1}, -4, x \cdot x\right)\right)}^{-1}} \]
          7. distribute-lft-outN/A

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

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

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

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

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

            \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \color{blue}{\mathsf{fma}\left(z, \frac{z}{t}, -1\right)}, -4, x \cdot x\right)\right)}^{-1}} \]
          13. lower-/.f6490.6

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

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

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

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

              \[\leadsto \color{blue}{x \cdot x} \]
            2. lower-*.f6461.8

              \[\leadsto \color{blue}{x \cdot x} \]
          4. Applied rewrites61.8%

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

          if 2.0000000000000001e235 < (-.f64 (*.f64 z z) t)

          1. Initial program 70.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. *-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-*.f6464.2

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

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

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

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

          Alternative 3: 91.7% accurate, 0.8× speedup?

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

            1. Initial program 97.9%

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

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

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

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

              if 9.99999999999999914e28 < (*.f64 z z)

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

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

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

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

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

              Alternative 4: 85.6% accurate, 1.0× speedup?

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

                1. Initial program 97.2%

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

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

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

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

                  if 1.0000000000000001e230 < (*.f64 z z)

                  1. Initial program 66.0%

                    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                  2. Add Preprocessing
                  3. 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-*.f6473.0

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

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

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

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

                  Alternative 5: 59.3% accurate, 1.2× speedup?

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

                    1. Initial program 90.9%

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

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

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

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

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

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

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

                      if 3.6e6 < (*.f64 x x)

                      1. Initial program 85.6%

                        \[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. flip--N/A

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

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

                          \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right) \cdot \left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)}}} \]
                        5. clear-numN/A

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

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

                          \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}}} \]
                        8. inv-powN/A

                          \[\leadsto \frac{1}{\color{blue}{{\left(x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)}^{-1}}} \]
                        9. lower-pow.f6485.6

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

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

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

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

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

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

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

                          \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \frac{{z}^{2}}{t} + t \cdot \color{blue}{\left(y \cdot -1\right)}, -4, x \cdot x\right)\right)}^{-1}} \]
                        6. associate-*r*N/A

                          \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \frac{{z}^{2}}{t} + \color{blue}{\left(t \cdot y\right) \cdot -1}, -4, x \cdot x\right)\right)}^{-1}} \]
                        7. distribute-lft-outN/A

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

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

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

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

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

                          \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \color{blue}{\mathsf{fma}\left(z, \frac{z}{t}, -1\right)}, -4, x \cdot x\right)\right)}^{-1}} \]
                        13. lower-/.f6480.3

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

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

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

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

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

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

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

                      Alternative 6: 41.4% 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 88.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. flip--N/A

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

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

                          \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right) \cdot \left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)}}} \]
                        5. clear-numN/A

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

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

                          \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}}} \]
                        8. inv-powN/A

                          \[\leadsto \frac{1}{\color{blue}{{\left(x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)}^{-1}}} \]
                        9. lower-pow.f6488.0

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

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

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

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

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

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

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

                          \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \frac{{z}^{2}}{t} + t \cdot \color{blue}{\left(y \cdot -1\right)}, -4, x \cdot x\right)\right)}^{-1}} \]
                        6. associate-*r*N/A

                          \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \frac{{z}^{2}}{t} + \color{blue}{\left(t \cdot y\right) \cdot -1}, -4, x \cdot x\right)\right)}^{-1}} \]
                        7. distribute-lft-outN/A

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

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

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

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

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

                          \[\leadsto \frac{1}{{\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot \color{blue}{\mathsf{fma}\left(z, \frac{z}{t}, -1\right)}, -4, x \cdot x\right)\right)}^{-1}} \]
                        13. lower-/.f6484.3

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

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

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

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

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

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

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

                        Developer Target 1: 90.8% accurate, 1.0× speedup?

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

                        Reproduce

                        ?
                        herbie shell --seed 2024285 
                        (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))))