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

Percentage Accurate: 90.5% → 96.6%
Time: 14.3s
Alternatives: 9
Speedup: 0.4×

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

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {\left(\sqrt[3]{{\left(\sqrt[3]{z}\right)}^{2}}\right)}^{3}\right)}^{3}\\


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

    1. Initial program 97.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv97.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(-y \cdot \left(4 \cdot \left(z \cdot z - t\right)\right)\right)} + x \cdot x \]
      6. associate-*l*97.4%

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

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

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

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

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

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

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

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

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

    if 1e303 < (*.f64 z z)

    1. Initial program 75.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative75.7%

        \[\leadsto x \cdot x - \color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)} \]
      2. add-sqr-sqrt32.7%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(\sqrt{y \cdot 4} \cdot \sqrt{y \cdot 4}\right)} \]
      3. sqrt-unprod28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\sqrt{\left(y \cdot 4\right) \cdot \left(y \cdot 4\right)}} \]
      4. swap-sqr28.8%

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

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{16}} \]
      6. metadata-eval28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(-4 \cdot -4\right)}} \]
      7. swap-sqr28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\color{blue}{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}} \]
      8. sqrt-unprod0.0%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)} \]
      9. add-sqr-sqrt5.1%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot -4\right)} \]
      10. add-cube-cbrt5.1%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)} \cdot \sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)}\right) \cdot \sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)}} \]
      11. pow35.1%

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

      \[\leadsto x \cdot x - \color{blue}{{\left(\sqrt[3]{4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)}\right)}^{3}} \]
    5. Step-by-step derivation
      1. pow1/332.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)\right)}^{0.3333333333333333}\right)}}^{3} \]
      2. associate-*r*32.7%

        \[\leadsto x \cdot x - {\left({\color{blue}{\left(\left(4 \cdot y\right) \cdot \left({z}^{2} - t\right)\right)}}^{0.3333333333333333}\right)}^{3} \]
      3. unpow-prod-down32.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot y\right)}^{0.3333333333333333} \cdot {\left({z}^{2} - t\right)}^{0.3333333333333333}\right)}}^{3} \]
      4. pow1/332.7%

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

      \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot y\right)}^{0.3333333333333333} \cdot \sqrt[3]{{z}^{2} - t}\right)}}^{3} \]
    7. Step-by-step derivation
      1. unpow1/375.7%

        \[\leadsto x \cdot x - {\left(\color{blue}{\sqrt[3]{4 \cdot y}} \cdot \sqrt[3]{{z}^{2} - t}\right)}^{3} \]
      2. *-commutative75.7%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{\color{blue}{y \cdot 4}} \cdot \sqrt[3]{{z}^{2} - t}\right)}^{3} \]
    8. Simplified75.7%

      \[\leadsto x \cdot x - {\color{blue}{\left(\sqrt[3]{y \cdot 4} \cdot \sqrt[3]{{z}^{2} - t}\right)}}^{3} \]
    9. Taylor expanded in t around 0 75.7%

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{{\left({z}^{2}\right)}^{0.3333333333333333}}\right)}^{3} \]
    10. Step-by-step derivation
      1. unpow1/375.7%

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

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{\sqrt[3]{{z}^{2}}}\right)}^{3} \]
    12. Step-by-step derivation
      1. add-cube-cbrt75.7%

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

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

        \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {\left(\sqrt[3]{\sqrt[3]{\color{blue}{z \cdot z}}}\right)}^{3}\right)}^{3} \]
      4. cbrt-prod92.7%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {\left(\sqrt[3]{\color{blue}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right)}^{3}\right)}^{3} \]
      5. pow292.7%

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

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

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

Alternative 2: 96.7% accurate, 0.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right)}^{3}\\


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

    1. Initial program 97.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv97.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(-y \cdot \left(4 \cdot \left(z \cdot z - t\right)\right)\right)} + x \cdot x \]
      6. associate-*l*97.4%

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

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

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

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

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

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

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

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

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

    if 1e303 < (*.f64 z z)

    1. Initial program 75.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative75.7%

        \[\leadsto x \cdot x - \color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)} \]
      2. add-sqr-sqrt32.7%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(\sqrt{y \cdot 4} \cdot \sqrt{y \cdot 4}\right)} \]
      3. sqrt-unprod28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\sqrt{\left(y \cdot 4\right) \cdot \left(y \cdot 4\right)}} \]
      4. swap-sqr28.8%

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

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{16}} \]
      6. metadata-eval28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(-4 \cdot -4\right)}} \]
      7. swap-sqr28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\color{blue}{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}} \]
      8. sqrt-unprod0.0%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)} \]
      9. add-sqr-sqrt5.1%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot -4\right)} \]
      10. add-cube-cbrt5.1%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)} \cdot \sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)}\right) \cdot \sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)}} \]
      11. pow35.1%

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

      \[\leadsto x \cdot x - \color{blue}{{\left(\sqrt[3]{4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)}\right)}^{3}} \]
    5. Step-by-step derivation
      1. pow1/332.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)\right)}^{0.3333333333333333}\right)}}^{3} \]
      2. associate-*r*32.7%

        \[\leadsto x \cdot x - {\left({\color{blue}{\left(\left(4 \cdot y\right) \cdot \left({z}^{2} - t\right)\right)}}^{0.3333333333333333}\right)}^{3} \]
      3. unpow-prod-down32.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot y\right)}^{0.3333333333333333} \cdot {\left({z}^{2} - t\right)}^{0.3333333333333333}\right)}}^{3} \]
      4. pow1/332.7%

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

      \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot y\right)}^{0.3333333333333333} \cdot \sqrt[3]{{z}^{2} - t}\right)}}^{3} \]
    7. Step-by-step derivation
      1. unpow1/375.7%

        \[\leadsto x \cdot x - {\left(\color{blue}{\sqrt[3]{4 \cdot y}} \cdot \sqrt[3]{{z}^{2} - t}\right)}^{3} \]
      2. *-commutative75.7%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{\color{blue}{y \cdot 4}} \cdot \sqrt[3]{{z}^{2} - t}\right)}^{3} \]
    8. Simplified75.7%

      \[\leadsto x \cdot x - {\color{blue}{\left(\sqrt[3]{y \cdot 4} \cdot \sqrt[3]{{z}^{2} - t}\right)}}^{3} \]
    9. Taylor expanded in t around 0 75.7%

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{{\left({z}^{2}\right)}^{0.3333333333333333}}\right)}^{3} \]
    10. Step-by-step derivation
      1. unpow1/375.7%

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

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{\sqrt[3]{{z}^{2}}}\right)}^{3} \]
    12. Step-by-step derivation
      1. add075.7%

        \[\leadsto x \cdot x - {\color{blue}{\left(\sqrt[3]{y \cdot 4} \cdot \sqrt[3]{{z}^{2}} + 0\right)}}^{3} \]
      2. *-commutative75.7%

        \[\leadsto x \cdot x - {\left(\color{blue}{\sqrt[3]{{z}^{2}} \cdot \sqrt[3]{y \cdot 4}} + 0\right)}^{3} \]
      3. fma-define75.7%

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

        \[\leadsto x \cdot x - {\left(\mathsf{fma}\left(\sqrt[3]{\color{blue}{z \cdot z}}, \sqrt[3]{y \cdot 4}, 0\right)\right)}^{3} \]
      5. cbrt-prod92.7%

        \[\leadsto x \cdot x - {\left(\mathsf{fma}\left(\color{blue}{\sqrt[3]{z} \cdot \sqrt[3]{z}}, \sqrt[3]{y \cdot 4}, 0\right)\right)}^{3} \]
      6. pow292.7%

        \[\leadsto x \cdot x - {\left(\mathsf{fma}\left(\color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}, \sqrt[3]{y \cdot 4}, 0\right)\right)}^{3} \]
    13. Applied egg-rr92.7%

      \[\leadsto x \cdot x - {\color{blue}{\left(\mathsf{fma}\left({\left(\sqrt[3]{z}\right)}^{2}, \sqrt[3]{y \cdot 4}, 0\right)\right)}}^{3} \]
    14. Step-by-step derivation
      1. fma-undefine92.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{y \cdot 4} + 0\right)}}^{3} \]
      2. add092.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{y \cdot 4}\right)}}^{3} \]
      3. *-commutative92.7%

        \[\leadsto x \cdot x - {\left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{\color{blue}{4 \cdot y}}\right)}^{3} \]
    15. Simplified92.7%

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

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

Alternative 3: 84.9% accurate, 0.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(0 - {\left(\sqrt[3]{y \cdot 4} \cdot {z}^{0.6666666666666666}\right)}^{3}\right)\\


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

    1. Initial program 97.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv97.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(-y \cdot \left(4 \cdot \left(z \cdot z - t\right)\right)\right)} + x \cdot x \]
      6. associate-*l*97.4%

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

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

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

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

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

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

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

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

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

    if 1e303 < (*.f64 z z)

    1. Initial program 75.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative75.7%

        \[\leadsto x \cdot x - \color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)} \]
      2. add-sqr-sqrt32.7%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(\sqrt{y \cdot 4} \cdot \sqrt{y \cdot 4}\right)} \]
      3. sqrt-unprod28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\sqrt{\left(y \cdot 4\right) \cdot \left(y \cdot 4\right)}} \]
      4. swap-sqr28.8%

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

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{16}} \]
      6. metadata-eval28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(-4 \cdot -4\right)}} \]
      7. swap-sqr28.8%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \sqrt{\color{blue}{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}} \]
      8. sqrt-unprod0.0%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)} \]
      9. add-sqr-sqrt5.1%

        \[\leadsto x \cdot x - \left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot -4\right)} \]
      10. add-cube-cbrt5.1%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)} \cdot \sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)}\right) \cdot \sqrt[3]{\left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)}} \]
      11. pow35.1%

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

      \[\leadsto x \cdot x - \color{blue}{{\left(\sqrt[3]{4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)}\right)}^{3}} \]
    5. Step-by-step derivation
      1. pow1/332.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot \left(y \cdot \left({z}^{2} - t\right)\right)\right)}^{0.3333333333333333}\right)}}^{3} \]
      2. associate-*r*32.7%

        \[\leadsto x \cdot x - {\left({\color{blue}{\left(\left(4 \cdot y\right) \cdot \left({z}^{2} - t\right)\right)}}^{0.3333333333333333}\right)}^{3} \]
      3. unpow-prod-down32.7%

        \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot y\right)}^{0.3333333333333333} \cdot {\left({z}^{2} - t\right)}^{0.3333333333333333}\right)}}^{3} \]
      4. pow1/332.7%

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

      \[\leadsto x \cdot x - {\color{blue}{\left({\left(4 \cdot y\right)}^{0.3333333333333333} \cdot \sqrt[3]{{z}^{2} - t}\right)}}^{3} \]
    7. Step-by-step derivation
      1. unpow1/375.7%

        \[\leadsto x \cdot x - {\left(\color{blue}{\sqrt[3]{4 \cdot y}} \cdot \sqrt[3]{{z}^{2} - t}\right)}^{3} \]
      2. *-commutative75.7%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{\color{blue}{y \cdot 4}} \cdot \sqrt[3]{{z}^{2} - t}\right)}^{3} \]
    8. Simplified75.7%

      \[\leadsto x \cdot x - {\color{blue}{\left(\sqrt[3]{y \cdot 4} \cdot \sqrt[3]{{z}^{2} - t}\right)}}^{3} \]
    9. Taylor expanded in t around 0 75.7%

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{{\left({z}^{2}\right)}^{0.3333333333333333}}\right)}^{3} \]
    10. Step-by-step derivation
      1. unpow1/375.7%

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

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{\sqrt[3]{{z}^{2}}}\right)}^{3} \]
    12. Step-by-step derivation
      1. pow1/375.7%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{{\left({z}^{2}\right)}^{0.3333333333333333}}\right)}^{3} \]
      2. pow-pow41.5%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{{z}^{\left(2 \cdot 0.3333333333333333\right)}}\right)}^{3} \]
      3. metadata-eval41.5%

        \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {z}^{\color{blue}{0.6666666666666666}}\right)}^{3} \]
    13. Applied egg-rr41.5%

      \[\leadsto x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot \color{blue}{{z}^{0.6666666666666666}}\right)}^{3} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.7%

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

Alternative 4: 93.3% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{x}^{2}\\


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

    1. Initial program 92.6%

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

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

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

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

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

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

      \[\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 4.9999999999999995e211 < x

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{{x}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.8%

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

Alternative 5: 91.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{x}^{2}\\


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

    1. Initial program 93.4%

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

    if 1.74999999999999995e140 < x

    1. Initial program 86.1%

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

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

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

Alternative 6: 91.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (* x x) (* (* y 4.0) (- t (* z z))))))
   (if (<= t_1 INFINITY) t_1 (* z (* z (* y 4.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = z * (z * (y * 4.0));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = z * (z * (y * 4.0));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * x) + ((y * 4.0) * (t - (z * z)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = z * (z * (y * 4.0))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(z * Float64(y * 4.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = z * (z * (y * 4.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\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 (*.f64 x x) (*.f64 (*.f64 y 4) (-.f64 (*.f64 z z) t))) < +inf.0

    1. Initial program 95.8%

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

    if +inf.0 < (-.f64 (*.f64 x x) (*.f64 (*.f64 y 4) (-.f64 (*.f64 z z) t)))

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

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

        \[\leadsto \color{blue}{\left(y \cdot {z}^{2}\right) \cdot -4} \]
      2. associate-*l*44.6%

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

      \[\leadsto \color{blue}{y \cdot \left({z}^{2} \cdot -4\right)} \]
    6. Step-by-step derivation
      1. add-cube-cbrt44.6%

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

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

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left({z}^{2} \cdot -4\right) \cdot y}}\right)}^{3} \]
      4. associate-*l*44.6%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{3} \]
    7. Applied egg-rr44.6%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{{z}^{2} \cdot \left(-4 \cdot y\right)}\right)}^{3}} \]
    8. Step-by-step derivation
      1. rem-cube-cbrt44.6%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\color{blue}{\left(y \cdot -4\right)} \cdot \left(-4 \cdot y\right)} \cdot z\right) \cdot z \]
      8. *-commutative44.6%

        \[\leadsto \left(\sqrt{\left(y \cdot -4\right) \cdot \color{blue}{\left(y \cdot -4\right)}} \cdot z\right) \cdot z \]
      9. swap-sqr44.6%

        \[\leadsto \left(\sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-4 \cdot -4\right)}} \cdot z\right) \cdot z \]
      10. metadata-eval44.6%

        \[\leadsto \left(\sqrt{\left(y \cdot y\right) \cdot \color{blue}{16}} \cdot z\right) \cdot z \]
      11. metadata-eval44.6%

        \[\leadsto \left(\sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(4 \cdot 4\right)}} \cdot z\right) \cdot z \]
      12. swap-sqr44.6%

        \[\leadsto \left(\sqrt{\color{blue}{\left(y \cdot 4\right) \cdot \left(y \cdot 4\right)}} \cdot z\right) \cdot z \]
      13. sqrt-unprod44.4%

        \[\leadsto \left(\color{blue}{\left(\sqrt{y \cdot 4} \cdot \sqrt{y \cdot 4}\right)} \cdot z\right) \cdot z \]
      14. add-sqr-sqrt44.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right) \leq \infty:\\ \;\;\;\;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 7: 66.7% accurate, 1.4× speedup?

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

\\
x \cdot x - y \cdot \left(t \cdot -4\right)
\end{array}
Derivation
  1. Initial program 92.4%

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

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

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

      \[\leadsto x \cdot x - \color{blue}{\left(y \cdot t\right)} \cdot -4 \]
    3. associate-*l*70.4%

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

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

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

Alternative 8: 32.0% 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 92.4%

    \[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 33.3%

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

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

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

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

Alternative 9: 2.1% accurate, 13.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (x y z t) :precision binary64 -1.0)
double code(double x, double y, double z, double t) {
	return -1.0;
}
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 = -1.0d0
end function
public static double code(double x, double y, double z, double t) {
	return -1.0;
}
def code(x, y, z, t):
	return -1.0
function code(x, y, z, t)
	return -1.0
end
function tmp = code(x, y, z, t)
	tmp = -1.0;
end
code[x_, y_, z_, t_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 92.4%

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

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

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

      \[\leadsto x \cdot x - \color{blue}{\left(y \cdot t\right)} \cdot -4 \]
    3. associate-*l*70.4%

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

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

      \[\leadsto x \cdot x - \color{blue}{\left(y \cdot t\right) \cdot -4} \]
    2. cancel-sign-sub-inv70.4%

      \[\leadsto \color{blue}{x \cdot x + \left(-y \cdot t\right) \cdot -4} \]
    3. distribute-lft-neg-in70.4%

      \[\leadsto x \cdot x + \color{blue}{\left(-\left(y \cdot t\right) \cdot -4\right)} \]
    4. distribute-rgt-neg-in70.4%

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

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

      \[\leadsto x \cdot x + \color{blue}{4 \cdot \left(y \cdot t\right)} \]
    7. add-sqr-sqrt40.3%

      \[\leadsto x \cdot x + \color{blue}{\sqrt{4 \cdot \left(y \cdot t\right)} \cdot \sqrt{4 \cdot \left(y \cdot t\right)}} \]
    8. sqrt-unprod51.9%

      \[\leadsto x \cdot x + \color{blue}{\sqrt{\left(4 \cdot \left(y \cdot t\right)\right) \cdot \left(4 \cdot \left(y \cdot t\right)\right)}} \]
    9. *-commutative51.9%

      \[\leadsto x \cdot x + \sqrt{\color{blue}{\left(\left(y \cdot t\right) \cdot 4\right)} \cdot \left(4 \cdot \left(y \cdot t\right)\right)} \]
    10. *-commutative51.9%

      \[\leadsto x \cdot x + \sqrt{\left(\left(y \cdot t\right) \cdot 4\right) \cdot \color{blue}{\left(\left(y \cdot t\right) \cdot 4\right)}} \]
    11. swap-sqr51.9%

      \[\leadsto x \cdot x + \sqrt{\color{blue}{\left(\left(y \cdot t\right) \cdot \left(y \cdot t\right)\right) \cdot \left(4 \cdot 4\right)}} \]
    12. metadata-eval51.9%

      \[\leadsto x \cdot x + \sqrt{\left(\left(y \cdot t\right) \cdot \left(y \cdot t\right)\right) \cdot \color{blue}{16}} \]
    13. metadata-eval51.9%

      \[\leadsto x \cdot x + \sqrt{\left(\left(y \cdot t\right) \cdot \left(y \cdot t\right)\right) \cdot \color{blue}{\left(-4 \cdot -4\right)}} \]
    14. swap-sqr51.9%

      \[\leadsto x \cdot x + \sqrt{\color{blue}{\left(\left(y \cdot t\right) \cdot -4\right) \cdot \left(\left(y \cdot t\right) \cdot -4\right)}} \]
    15. associate-*r*51.9%

      \[\leadsto x \cdot x + \sqrt{\color{blue}{\left(y \cdot \left(t \cdot -4\right)\right)} \cdot \left(\left(y \cdot t\right) \cdot -4\right)} \]
    16. associate-*r*51.9%

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

      \[\leadsto x \cdot x + \color{blue}{\sqrt{y \cdot \left(t \cdot -4\right)} \cdot \sqrt{y \cdot \left(t \cdot -4\right)}} \]
    18. add-sqr-sqrt40.1%

      \[\leadsto x \cdot x + \color{blue}{y \cdot \left(t \cdot -4\right)} \]
    19. expm1-log1p-u38.5%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot x + y \cdot \left(t \cdot -4\right)\right)\right)} \]
    20. fma-define38.5%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(x, x, y \cdot \left(t \cdot -4\right)\right)}\right)\right) \]
    21. add-sqr-sqrt20.4%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, x, \color{blue}{\sqrt{y \cdot \left(t \cdot -4\right)} \cdot \sqrt{y \cdot \left(t \cdot -4\right)}}\right)\right)\right) \]
  7. Applied egg-rr56.7%

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot t\right)\right)\right)\right)} \]
  8. Taylor expanded in x around inf 17.3%

    \[\leadsto \mathsf{expm1}\left(\color{blue}{-2 \cdot \log \left(\frac{1}{x}\right)}\right) \]
  9. Step-by-step derivation
    1. log-rec17.3%

      \[\leadsto \mathsf{expm1}\left(-2 \cdot \color{blue}{\left(-\log x\right)}\right) \]
  10. Simplified17.3%

    \[\leadsto \mathsf{expm1}\left(\color{blue}{-2 \cdot \left(-\log x\right)}\right) \]
  11. Taylor expanded in x around 0 2.2%

    \[\leadsto \color{blue}{-1} \]
  12. Final simplification2.2%

    \[\leadsto -1 \]
  13. Add Preprocessing

Developer target: 90.5% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024034 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

  :herbie-target
  (- (* x x) (* 4.0 (* y (- (* z z) t))))

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