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

Percentage Accurate: 90.6% → 96.0%
Time: 8.5s
Alternatives: 5
Speedup: 0.6×

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 5 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.6% 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.0% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 96.1%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot \color{blue}{\left(\left(-\left(-t\right)\right) + \left(-z \cdot z\right)\right)}\right) \]
      6. remove-double-neg97.2%

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

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

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

    if 1.00000000000000005e301 < (*.f64 z z)

    1. Initial program 70.6%

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
      2. unpow282.9%

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. associate-*r*89.3%

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

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

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

Alternative 2: 75.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 4.3 \cdot 10^{+32} \lor \neg \left(z \leq 4.5 \cdot 10^{+91}\right) \land z \leq 1.25 \cdot 10^{+101}:\\ \;\;\;\;x \cdot x - -4 \cdot \left(y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z 4.3e+32) (and (not (<= z 4.5e+91)) (<= z 1.25e+101)))
   (- (* x x) (* -4.0 (* y t)))
   (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= 4.3e+32) || (!(z <= 4.5e+91) && (z <= 1.25e+101))) {
		tmp = (x * x) - (-4.0 * (y * t));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= 4.3d+32) .or. (.not. (z <= 4.5d+91)) .and. (z <= 1.25d+101)) then
        tmp = (x * x) - ((-4.0d0) * (y * t))
    else
        tmp = z * (z * (y * (-4.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= 4.3e+32) || (!(z <= 4.5e+91) && (z <= 1.25e+101))) {
		tmp = (x * x) - (-4.0 * (y * t));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= 4.3e+32) or (not (z <= 4.5e+91) and (z <= 1.25e+101)):
		tmp = (x * x) - (-4.0 * (y * t))
	else:
		tmp = z * (z * (y * -4.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= 4.3e+32) || (!(z <= 4.5e+91) && (z <= 1.25e+101)))
		tmp = Float64(Float64(x * x) - Float64(-4.0 * Float64(y * t)));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= 4.3e+32) || (~((z <= 4.5e+91)) && (z <= 1.25e+101)))
		tmp = (x * x) - (-4.0 * (y * t));
	else
		tmp = z * (z * (y * -4.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, 4.3e+32], And[N[Not[LessEqual[z, 4.5e+91]], $MachinePrecision], LessEqual[z, 1.25e+101]]], N[(N[(x * x), $MachinePrecision] - N[(-4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.3 \cdot 10^{+32} \lor \neg \left(z \leq 4.5 \cdot 10^{+91}\right) \land z \leq 1.25 \cdot 10^{+101}:\\
\;\;\;\;x \cdot x - -4 \cdot \left(y \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.2999999999999997e32 or 4.5e91 < z < 1.24999999999999997e101

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

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

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

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

    if 4.2999999999999997e32 < z < 4.5e91 or 1.24999999999999997e101 < z

    1. Initial program 78.6%

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
      2. unpow277.3%

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. associate-*r*81.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 4.3 \cdot 10^{+32} \lor \neg \left(z \leq 4.5 \cdot 10^{+91}\right) \land z \leq 1.25 \cdot 10^{+101}:\\ \;\;\;\;x \cdot x - -4 \cdot \left(y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 96.1%

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

    if 1.00000000000000005e301 < (*.f64 z z)

    1. Initial program 70.6%

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
      2. unpow282.9%

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. associate-*r*89.3%

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

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

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

Alternative 4: 45.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.13:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\

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


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

    1. Initial program 91.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 34.9%

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

    if 0.13 < z

    1. Initial program 81.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 71.7%

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

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

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. associate-*r*75.5%

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

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

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

Alternative 5: 31.9% accurate, 2.6× speedup?

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

\\
4 \cdot \left(y \cdot t\right)
\end{array}
Derivation
  1. Initial program 88.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 29.8%

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

    \[\leadsto 4 \cdot \left(y \cdot t\right) \]
  5. Add Preprocessing

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

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

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