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

Percentage Accurate: 90.7% → 96.7%
Time: 10.9s
Alternatives: 7
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 7 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.7% 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.7% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e242 < (*.f64 z z)

    1. Initial program 73.1%

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

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}} \]
      4. pow-prod-up9.7%

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

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

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      10. pow-sqr9.7%

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, z, -t\right)}}} \]
      14. add-sqr-sqrt35.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}\right)}} \]
      15. sqrt-prod73.1%

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

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

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt73.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\sqrt{\frac{1}{{z}^{2}}} \cdot \sqrt{\frac{1}{{z}^{2}}}}} \]
      2. times-frac73.1%

        \[\leadsto x \cdot x - \color{blue}{\frac{y}{\sqrt{\frac{1}{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}}} \]
      3. sqrt-div73.1%

        \[\leadsto x \cdot x - \frac{y}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      4. metadata-eval73.1%

        \[\leadsto x \cdot x - \frac{y}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      5. sqrt-pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      6. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{{z}^{\color{blue}{1}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      7. pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{z}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      8. sqrt-div37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \]
      9. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \]
      10. sqrt-pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \]
      11. metadata-eval95.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{{z}^{\color{blue}{1}}}} \]
      12. pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{z}}} \]
    9. Applied egg-rr95.8%

      \[\leadsto x \cdot x - \color{blue}{\frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{z}}} \]
    10. Step-by-step derivation
      1. associate-/r/95.8%

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

        \[\leadsto x \cdot x - \left(\color{blue}{y} \cdot z\right) \cdot \frac{4}{\frac{1}{z}} \]
      3. associate-/r/95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \color{blue}{\left(\frac{4}{1} \cdot z\right)} \]
      4. metadata-eval95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \left(\color{blue}{4} \cdot z\right) \]
    11. Simplified95.8%

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

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

Alternative 2: 96.1% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 98.8%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg99.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-in99.4%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(-y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right) \]
      3. *-commutative99.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-in99.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-eval99.4%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot \color{blue}{-4}\right)\right) \]
    3. Simplified99.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 5.0000000000000004e242 < (*.f64 z z)

    1. Initial program 73.1%

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

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}} \]
      4. pow-prod-up9.7%

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

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

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      10. pow-sqr9.7%

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, z, -t\right)}}} \]
      14. add-sqr-sqrt35.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}\right)}} \]
      15. sqrt-prod73.1%

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

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

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt73.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\sqrt{\frac{1}{{z}^{2}}} \cdot \sqrt{\frac{1}{{z}^{2}}}}} \]
      2. times-frac73.1%

        \[\leadsto x \cdot x - \color{blue}{\frac{y}{\sqrt{\frac{1}{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}}} \]
      3. sqrt-div73.1%

        \[\leadsto x \cdot x - \frac{y}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      4. metadata-eval73.1%

        \[\leadsto x \cdot x - \frac{y}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      5. sqrt-pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      6. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{{z}^{\color{blue}{1}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      7. pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{z}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      8. sqrt-div37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \]
      9. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \]
      10. sqrt-pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \]
      11. metadata-eval95.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{{z}^{\color{blue}{1}}}} \]
      12. pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{z}}} \]
    9. Applied egg-rr95.8%

      \[\leadsto x \cdot x - \color{blue}{\frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{z}}} \]
    10. Step-by-step derivation
      1. associate-/r/95.8%

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

        \[\leadsto x \cdot x - \left(\color{blue}{y} \cdot z\right) \cdot \frac{4}{\frac{1}{z}} \]
      3. associate-/r/95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \color{blue}{\left(\frac{4}{1} \cdot z\right)} \]
      4. metadata-eval95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \left(\color{blue}{4} \cdot z\right) \]
    11. Simplified95.8%

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

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

Alternative 3: 96.7% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e242 < (*.f64 z z)

    1. Initial program 73.1%

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

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}} \]
      4. pow-prod-up9.7%

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

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

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      10. pow-sqr9.7%

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, z, -t\right)}}} \]
      14. add-sqr-sqrt35.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}\right)}} \]
      15. sqrt-prod73.1%

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

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

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt73.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\sqrt{\frac{1}{{z}^{2}}} \cdot \sqrt{\frac{1}{{z}^{2}}}}} \]
      2. times-frac73.1%

        \[\leadsto x \cdot x - \color{blue}{\frac{y}{\sqrt{\frac{1}{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}}} \]
      3. sqrt-div73.1%

        \[\leadsto x \cdot x - \frac{y}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      4. metadata-eval73.1%

        \[\leadsto x \cdot x - \frac{y}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      5. sqrt-pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      6. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{{z}^{\color{blue}{1}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      7. pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{z}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      8. sqrt-div37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \]
      9. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \]
      10. sqrt-pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \]
      11. metadata-eval95.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{{z}^{\color{blue}{1}}}} \]
      12. pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{z}}} \]
    9. Applied egg-rr95.8%

      \[\leadsto x \cdot x - \color{blue}{\frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{z}}} \]
    10. Step-by-step derivation
      1. associate-/r/95.8%

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

        \[\leadsto x \cdot x - \left(\color{blue}{y} \cdot z\right) \cdot \frac{4}{\frac{1}{z}} \]
      3. associate-/r/95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \color{blue}{\left(\frac{4}{1} \cdot z\right)} \]
      4. metadata-eval95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \left(\color{blue}{4} \cdot z\right) \]
    11. Simplified95.8%

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

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

Alternative 4: 95.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 98.8%

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

    if 5.0000000000000004e242 < (*.f64 z z)

    1. Initial program 73.1%

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

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\frac{{z}^{2} \cdot {z}^{2} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}} \]
      4. pow-prod-up9.7%

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

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

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\frac{{z}^{\color{blue}{\left(2 \cdot 2\right)}} - \left(-t\right) \cdot \left(-t\right)}{{z}^{2} - \left(-t\right)}}} \]
      10. pow-sqr9.7%

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, z, -t\right)}}} \]
      14. add-sqr-sqrt35.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\mathsf{fma}\left(z, z, \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}\right)}} \]
      15. sqrt-prod73.1%

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

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

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt73.1%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\sqrt{\frac{1}{{z}^{2}}} \cdot \sqrt{\frac{1}{{z}^{2}}}}} \]
      2. times-frac73.1%

        \[\leadsto x \cdot x - \color{blue}{\frac{y}{\sqrt{\frac{1}{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}}} \]
      3. sqrt-div73.1%

        \[\leadsto x \cdot x - \frac{y}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      4. metadata-eval73.1%

        \[\leadsto x \cdot x - \frac{y}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      5. sqrt-pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      6. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{{z}^{\color{blue}{1}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      7. pow137.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{z}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      8. sqrt-div37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \]
      9. metadata-eval37.5%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \]
      10. sqrt-pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \]
      11. metadata-eval95.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{{z}^{\color{blue}{1}}}} \]
      12. pow195.8%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{z}}} \]
    9. Applied egg-rr95.8%

      \[\leadsto x \cdot x - \color{blue}{\frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{z}}} \]
    10. Step-by-step derivation
      1. associate-/r/95.8%

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

        \[\leadsto x \cdot x - \left(\color{blue}{y} \cdot z\right) \cdot \frac{4}{\frac{1}{z}} \]
      3. associate-/r/95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \color{blue}{\left(\frac{4}{1} \cdot z\right)} \]
      4. metadata-eval95.8%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \left(\color{blue}{4} \cdot z\right) \]
    11. Simplified95.8%

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

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

Alternative 5: 78.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.2499999999999998e-6

    1. Initial program 93.8%

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

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

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

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

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

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

    if 3.2499999999999998e-6 < z

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, z, -t\right)}}} \]
      14. add-sqr-sqrt47.1%

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

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

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

      \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\frac{1}{{z}^{2}}}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt81.0%

        \[\leadsto x \cdot x - \frac{y \cdot 4}{\color{blue}{\sqrt{\frac{1}{{z}^{2}}} \cdot \sqrt{\frac{1}{{z}^{2}}}}} \]
      2. times-frac81.0%

        \[\leadsto x \cdot x - \color{blue}{\frac{y}{\sqrt{\frac{1}{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}}} \]
      3. sqrt-div81.0%

        \[\leadsto x \cdot x - \frac{y}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      4. metadata-eval81.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      5. sqrt-pow181.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      6. metadata-eval81.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{{z}^{\color{blue}{1}}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      7. pow181.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{\color{blue}{z}}} \cdot \frac{4}{\sqrt{\frac{1}{{z}^{2}}}} \]
      8. sqrt-div81.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\color{blue}{\frac{\sqrt{1}}{\sqrt{{z}^{2}}}}} \]
      9. metadata-eval81.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{\color{blue}{1}}{\sqrt{{z}^{2}}}} \]
      10. sqrt-pow193.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{{z}^{\left(\frac{2}{2}\right)}}}} \]
      11. metadata-eval93.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{{z}^{\color{blue}{1}}}} \]
      12. pow193.0%

        \[\leadsto x \cdot x - \frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{\color{blue}{z}}} \]
    9. Applied egg-rr93.0%

      \[\leadsto x \cdot x - \color{blue}{\frac{y}{\frac{1}{z}} \cdot \frac{4}{\frac{1}{z}}} \]
    10. Step-by-step derivation
      1. associate-/r/93.1%

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

        \[\leadsto x \cdot x - \left(\color{blue}{y} \cdot z\right) \cdot \frac{4}{\frac{1}{z}} \]
      3. associate-/r/93.1%

        \[\leadsto x \cdot x - \left(y \cdot z\right) \cdot \color{blue}{\left(\frac{4}{1} \cdot z\right)} \]
      4. metadata-eval93.1%

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

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

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

Alternative 6: 67.2% 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 91.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 64.9%

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

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

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

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

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

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

Alternative 7: 31.8% 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 91.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 32.0%

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

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

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

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

Developer target: 90.7% 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 2024080 
(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))))