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

Percentage Accurate: 90.3% → 93.1%
Time: 10.4s
Alternatives: 8
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 8 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.3% 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: 93.1% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(t \cdot \left(4 \cdot \left(\left(z \cdot \left(z \cdot y\right)\right) \cdot \frac{-1}{t}\right)\right) - t \cdot \left(y \cdot 4\right)\right)\\


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

    if 2.0000000000000001e300 < (*.f64 z z)

    1. Initial program 67.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 67.3%

      \[\leadsto x \cdot x - \color{blue}{t \cdot \left(-4 \cdot y + 4 \cdot \frac{y \cdot {z}^{2}}{t}\right)} \]
    4. Step-by-step derivation
      1. +-commutative67.3%

        \[\leadsto x \cdot x - t \cdot \color{blue}{\left(4 \cdot \frac{y \cdot {z}^{2}}{t} + -4 \cdot y\right)} \]
      2. fma-define67.3%

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

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

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

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

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      2. sqrt-prod15.7%

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

        \[\leadsto x \cdot x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      4. sqrt-unprod0.0%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      5. add-sqr-sqrt7.7%

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

        \[\leadsto x \cdot x - \left(-t\right) \cdot \color{blue}{\left(4 \cdot \left(y \cdot \frac{{z}^{2}}{t}\right) + y \cdot -4\right)} \]
      7. distribute-rgt-in7.7%

        \[\leadsto x \cdot x - \color{blue}{\left(\left(4 \cdot \left(y \cdot \frac{{z}^{2}}{t}\right)\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right)} \]
      8. clear-num7.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\frac{1}{\frac{t}{{z}^{2}}}}\right)\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      9. un-div-inv7.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\frac{y}{\frac{t}{{z}^{2}}}}\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      10. add-sqr-sqrt0.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      11. sqrt-unprod15.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      12. sqr-neg15.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \sqrt{\color{blue}{t \cdot t}} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      13. sqrt-prod20.4%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      14. add-sqr-sqrt64.3%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{t} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      15. *-commutative64.3%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(-t\right) \cdot \left(y \cdot -4\right)}\right) \]
      16. add-sqr-sqrt43.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \left(y \cdot -4\right)\right) \]
      17. sqrt-unprod51.6%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot \left(y \cdot -4\right)\right) \]
      18. sqr-neg51.6%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \sqrt{\color{blue}{t \cdot t}} \cdot \left(y \cdot -4\right)\right) \]
      19. sqrt-prod17.4%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \left(y \cdot -4\right)\right) \]
      20. add-sqr-sqrt64.3%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{t} \cdot \left(y \cdot -4\right)\right) \]
      21. add-sqr-sqrt41.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      22. sqrt-unprod59.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \color{blue}{\sqrt{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}}\right) \]
    7. Applied egg-rr64.3%

      \[\leadsto x \cdot x - \color{blue}{\left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right)} \]
    8. Step-by-step derivation
      1. div-inv64.3%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\left(y \cdot \frac{1}{\frac{t}{{z}^{2}}}\right)}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      2. clear-num64.3%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\frac{{z}^{2}}{t}}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      3. unpow264.3%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \frac{\color{blue}{z \cdot z}}{t}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      4. associate-*r/71.6%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\left(z \cdot \frac{z}{t}\right)}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      5. /-rgt-identity71.6%

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

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \left(\color{blue}{z} \cdot \frac{z}{t}\right)\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      7. associate-*r*80.2%

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

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(\left(y \cdot z\right) \cdot \color{blue}{\left(z \cdot \frac{1}{t}\right)}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      9. associate-*r*81.6%

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

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

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

Alternative 2: 91.4% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.45000000000000005e150

    1. Initial program 91.3%

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

    if 1.45000000000000005e150 < x

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(-t\right)} \cdot \left(y \cdot -4\right)\right) \]
    8. Step-by-step derivation
      1. add-exp-log93.2%

        \[\leadsto \color{blue}{e^{\log \left(\mathsf{fma}\left(x, x, \left(-t\right) \cdot \left(y \cdot -4\right)\right)\right)}} \]
      2. add-sqr-sqrt36.0%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \left(y \cdot -4\right)\right)\right)} \]
      3. sqrt-unprod78.5%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot \left(y \cdot -4\right)\right)\right)} \]
      4. sqr-neg78.5%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, \sqrt{\color{blue}{t \cdot t}} \cdot \left(y \cdot -4\right)\right)\right)} \]
      5. sqrt-prod57.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \left(y \cdot -4\right)\right)\right)} \]
      6. add-sqr-sqrt93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, \color{blue}{t} \cdot \left(y \cdot -4\right)\right)\right)} \]
      7. add-sqr-sqrt48.1%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right)\right)} \]
      8. sqrt-unprod93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \color{blue}{\sqrt{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}}\right)\right)} \]
      9. swap-sqr93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-4 \cdot -4\right)}}\right)\right)} \]
      10. metadata-eval93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{16}}\right)\right)} \]
      11. metadata-eval93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(4 \cdot 4\right)}}\right)\right)} \]
      12. swap-sqr93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \sqrt{\color{blue}{\left(y \cdot 4\right) \cdot \left(y \cdot 4\right)}}\right)\right)} \]
      13. sqrt-unprod45.1%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \color{blue}{\left(\sqrt{y \cdot 4} \cdot \sqrt{y \cdot 4}\right)}\right)\right)} \]
      14. add-sqr-sqrt93.2%

        \[\leadsto e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \color{blue}{\left(y \cdot 4\right)}\right)\right)} \]
    9. Applied egg-rr93.2%

      \[\leadsto \color{blue}{e^{\log \left(\mathsf{fma}\left(x, x, t \cdot \left(y \cdot 4\right)\right)\right)}} \]
    10. Step-by-step derivation
      1. rem-exp-log97.0%

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

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

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

Alternative 3: 92.3% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(t \cdot \left(4 \cdot \left(\left(z \cdot \left(z \cdot y\right)\right) \cdot \frac{-1}{t}\right)\right) - t \cdot \left(y \cdot 4\right)\right)\\


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

    1. Initial program 97.2%

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

    if 4.9999999999999999e284 < (*.f64 z z)

    1. Initial program 67.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 67.8%

      \[\leadsto x \cdot x - \color{blue}{t \cdot \left(-4 \cdot y + 4 \cdot \frac{y \cdot {z}^{2}}{t}\right)} \]
    4. Step-by-step derivation
      1. +-commutative67.8%

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

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

        \[\leadsto x \cdot x - t \cdot \mathsf{fma}\left(4, \color{blue}{y \cdot \frac{{z}^{2}}{t}}, -4 \cdot y\right) \]
      4. *-commutative67.8%

        \[\leadsto x \cdot x - t \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, \color{blue}{y \cdot -4}\right) \]
    5. Simplified67.8%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      2. sqrt-prod14.8%

        \[\leadsto x \cdot x - \color{blue}{\sqrt{t \cdot t}} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      3. sqr-neg14.8%

        \[\leadsto x \cdot x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      4. sqrt-unprod0.0%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      5. add-sqr-sqrt8.7%

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

        \[\leadsto x \cdot x - \left(-t\right) \cdot \color{blue}{\left(4 \cdot \left(y \cdot \frac{{z}^{2}}{t}\right) + y \cdot -4\right)} \]
      7. distribute-rgt-in8.7%

        \[\leadsto x \cdot x - \color{blue}{\left(\left(4 \cdot \left(y \cdot \frac{{z}^{2}}{t}\right)\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right)} \]
      8. clear-num8.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\frac{1}{\frac{t}{{z}^{2}}}}\right)\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      9. un-div-inv8.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\frac{y}{\frac{t}{{z}^{2}}}}\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      10. add-sqr-sqrt0.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      11. sqrt-unprod14.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      12. sqr-neg14.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \sqrt{\color{blue}{t \cdot t}} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      13. sqrt-prod19.2%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      14. add-sqr-sqrt64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{t} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      15. *-commutative64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(-t\right) \cdot \left(y \cdot -4\right)}\right) \]
      16. add-sqr-sqrt45.6%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \left(y \cdot -4\right)\right) \]
      17. sqrt-unprod53.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot \left(y \cdot -4\right)\right) \]
      18. sqr-neg53.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \sqrt{\color{blue}{t \cdot t}} \cdot \left(y \cdot -4\right)\right) \]
      19. sqrt-prod16.4%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \left(y \cdot -4\right)\right) \]
      20. add-sqr-sqrt64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{t} \cdot \left(y \cdot -4\right)\right) \]
      21. add-sqr-sqrt40.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      22. sqrt-unprod59.1%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \color{blue}{\sqrt{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}}\right) \]
    7. Applied egg-rr64.9%

      \[\leadsto x \cdot x - \color{blue}{\left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right)} \]
    8. Step-by-step derivation
      1. div-inv64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\left(y \cdot \frac{1}{\frac{t}{{z}^{2}}}\right)}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      2. clear-num64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\frac{{z}^{2}}{t}}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      3. unpow264.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \frac{\color{blue}{z \cdot z}}{t}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      4. associate-*r/71.8%

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

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \left(\color{blue}{\frac{z}{1}} \cdot \frac{z}{t}\right)\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      6. /-rgt-identity71.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \left(\color{blue}{z} \cdot \frac{z}{t}\right)\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      7. associate-*r*79.9%

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

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(\left(y \cdot z\right) \cdot \color{blue}{\left(z \cdot \frac{1}{t}\right)}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      9. associate-*r*81.3%

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

      \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\left(\left(\left(y \cdot z\right) \cdot z\right) \cdot \frac{1}{t}\right)}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.9%

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

Alternative 4: 92.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+284}:\\ \;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - \left(t \cdot \left(y \cdot 4\right) + t \cdot \left(4 \cdot \left(\left(z \cdot y\right) \cdot \frac{z}{t}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 5e+284)
   (+ (* x x) (* (* y 4.0) (- t (* z z))))
   (- (* x x) (+ (* t (* y 4.0)) (* t (* 4.0 (* (* z y) (/ z t))))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 5e+284) {
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	} else {
		tmp = (x * x) - ((t * (y * 4.0)) + (t * (4.0 * ((z * y) * (z / t)))));
	}
	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) <= 5d+284) then
        tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
    else
        tmp = (x * x) - ((t * (y * 4.0d0)) + (t * (4.0d0 * ((z * y) * (z / t)))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 5e+284) {
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	} else {
		tmp = (x * x) - ((t * (y * 4.0)) + (t * (4.0 * ((z * y) * (z / t)))));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * z) <= 5e+284:
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)))
	else:
		tmp = (x * x) - ((t * (y * 4.0)) + (t * (4.0 * ((z * y) * (z / t)))))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 5e+284)
		tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z))));
	else
		tmp = Float64(Float64(x * x) - Float64(Float64(t * Float64(y * 4.0)) + Float64(t * Float64(4.0 * Float64(Float64(z * y) * Float64(z / t))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * z) <= 5e+284)
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	else
		tmp = (x * x) - ((t * (y * 4.0)) + (t * (4.0 * ((z * y) * (z / t)))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+284], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(N[(t * N[(y * 4.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(4.0 * N[(N[(z * y), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 97.2%

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

    if 4.9999999999999999e284 < (*.f64 z z)

    1. Initial program 67.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 67.8%

      \[\leadsto x \cdot x - \color{blue}{t \cdot \left(-4 \cdot y + 4 \cdot \frac{y \cdot {z}^{2}}{t}\right)} \]
    4. Step-by-step derivation
      1. +-commutative67.8%

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

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

        \[\leadsto x \cdot x - t \cdot \mathsf{fma}\left(4, \color{blue}{y \cdot \frac{{z}^{2}}{t}}, -4 \cdot y\right) \]
      4. *-commutative67.8%

        \[\leadsto x \cdot x - t \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, \color{blue}{y \cdot -4}\right) \]
    5. Simplified67.8%

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

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      2. sqrt-prod14.8%

        \[\leadsto x \cdot x - \color{blue}{\sqrt{t \cdot t}} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      3. sqr-neg14.8%

        \[\leadsto x \cdot x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      4. sqrt-unprod0.0%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \mathsf{fma}\left(4, y \cdot \frac{{z}^{2}}{t}, y \cdot -4\right) \]
      5. add-sqr-sqrt8.7%

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

        \[\leadsto x \cdot x - \left(-t\right) \cdot \color{blue}{\left(4 \cdot \left(y \cdot \frac{{z}^{2}}{t}\right) + y \cdot -4\right)} \]
      7. distribute-rgt-in8.7%

        \[\leadsto x \cdot x - \color{blue}{\left(\left(4 \cdot \left(y \cdot \frac{{z}^{2}}{t}\right)\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right)} \]
      8. clear-num8.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\frac{1}{\frac{t}{{z}^{2}}}}\right)\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      9. un-div-inv8.7%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\frac{y}{\frac{t}{{z}^{2}}}}\right) \cdot \left(-t\right) + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      10. add-sqr-sqrt0.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      11. sqrt-unprod14.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      12. sqr-neg14.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \sqrt{\color{blue}{t \cdot t}} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      13. sqrt-prod19.2%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      14. add-sqr-sqrt64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot \color{blue}{t} + \left(y \cdot -4\right) \cdot \left(-t\right)\right) \]
      15. *-commutative64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(-t\right) \cdot \left(y \cdot -4\right)}\right) \]
      16. add-sqr-sqrt45.6%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \left(y \cdot -4\right)\right) \]
      17. sqrt-unprod53.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot \left(y \cdot -4\right)\right) \]
      18. sqr-neg53.0%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \sqrt{\color{blue}{t \cdot t}} \cdot \left(y \cdot -4\right)\right) \]
      19. sqrt-prod16.4%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \left(y \cdot -4\right)\right) \]
      20. add-sqr-sqrt64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + \color{blue}{t} \cdot \left(y \cdot -4\right)\right) \]
      21. add-sqr-sqrt40.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      22. sqrt-unprod59.1%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \color{blue}{\sqrt{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}}\right) \]
    7. Applied egg-rr64.9%

      \[\leadsto x \cdot x - \color{blue}{\left(\left(4 \cdot \frac{y}{\frac{t}{{z}^{2}}}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right)} \]
    8. Step-by-step derivation
      1. div-inv64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \color{blue}{\left(y \cdot \frac{1}{\frac{t}{{z}^{2}}}\right)}\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      2. clear-num64.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \color{blue}{\frac{{z}^{2}}{t}}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      3. unpow264.9%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \frac{\color{blue}{z \cdot z}}{t}\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      4. associate-*r/71.8%

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

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \left(\color{blue}{\frac{z}{1}} \cdot \frac{z}{t}\right)\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      6. /-rgt-identity71.8%

        \[\leadsto x \cdot x - \left(\left(4 \cdot \left(y \cdot \left(\color{blue}{z} \cdot \frac{z}{t}\right)\right)\right) \cdot t + t \cdot \left(y \cdot 4\right)\right) \]
      7. associate-*r*79.9%

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

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

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

Alternative 5: 92.7% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 4.9999999999999999e294

    1. Initial program 93.5%

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

    if 4.9999999999999999e294 < (*.f64 x x)

    1. Initial program 76.9%

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

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

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

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

Alternative 6: 59.3% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 9.99999999999999914e28

    1. Initial program 91.5%

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

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

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

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

    if 9.99999999999999914e28 < (*.f64 x x)

    1. Initial program 86.9%

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

      \[\leadsto x \cdot x - \color{blue}{4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)} \]
    4. Simplified72.5%

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

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

Alternative 7: 67.0% accurate, 1.4× speedup?

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

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

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

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

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

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

Alternative 8: 30.9% accurate, 2.6× speedup?

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

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

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

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

    \[\leadsto \color{blue}{4 \cdot \left(y \cdot t\right)} \]
  6. Final simplification31.3%

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

Developer target: 90.3% 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 2024100 
(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))))