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

Percentage Accurate: 90.2% → 94.6%
Time: 12.1s
Alternatives: 11
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.2% 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: 94.6% accurate, 0.7× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 4.2 \cdot 10^{+164}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z\_m, z\_m, 0 - t\right), y \cdot -4, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x - \mathsf{fma}\left(z\_m \cdot \left(y \cdot 4\right), z\_m, t \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (if (<= z_m 4.2e+164)
   (fma (fma z_m z_m (- 0.0 t)) (* y -4.0) (* x x))
   (- (* x x) (fma (* z_m (* y 4.0)) z_m (* t (* y -4.0))))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if (z_m <= 4.2e+164) {
		tmp = fma(fma(z_m, z_m, (0.0 - t)), (y * -4.0), (x * x));
	} else {
		tmp = (x * x) - fma((z_m * (y * 4.0)), z_m, (t * (y * -4.0)));
	}
	return tmp;
}
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (z_m <= 4.2e+164)
		tmp = fma(fma(z_m, z_m, Float64(0.0 - t)), Float64(y * -4.0), Float64(x * x));
	else
		tmp = Float64(Float64(x * x) - fma(Float64(z_m * Float64(y * 4.0)), z_m, Float64(t * Float64(y * -4.0))));
	end
	return tmp
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := If[LessEqual[z$95$m, 4.2e+164], N[(N[(z$95$m * z$95$m + N[(0.0 - t), $MachinePrecision]), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(N[(z$95$m * N[(y * 4.0), $MachinePrecision]), $MachinePrecision] * z$95$m + N[(t * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|

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

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


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

    1. Initial program 94.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) + x \cdot x} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) + x \cdot x \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(z \cdot z - t\right) \cdot \left(\mathsf{neg}\left(y \cdot 4\right)\right)} + x \cdot x \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot z - t, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot z + \left(\mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, z, \mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      12. metadata-evalN/A

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

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

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

    if 4.1999999999999998e164 < z

    1. Initial program 61.9%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

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

        \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot \left(z \cdot z\right) + \left(y \cdot 4\right) \cdot \left(\mathsf{neg}\left(t\right)\right)\right)} \]
      3. *-commutativeN/A

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

        \[\leadsto x \cdot x - \left(\color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z} + \left(\mathsf{neg}\left(t\right)\right) \cdot \left(y \cdot 4\right)\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot x - \color{blue}{\mathsf{fma}\left(\left(y \cdot 4\right) \cdot z, z, \left(\mathsf{neg}\left(t\right)\right) \cdot \left(y \cdot 4\right)\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot x - \mathsf{fma}\left(\color{blue}{\left(y \cdot 4\right) \cdot z}, z, \left(\mathsf{neg}\left(t\right)\right) \cdot \left(y \cdot 4\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto x \cdot x - \mathsf{fma}\left(\color{blue}{\left(y \cdot 4\right)} \cdot z, z, \left(\mathsf{neg}\left(t\right)\right) \cdot \left(y \cdot 4\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto x \cdot x - \mathsf{fma}\left(\left(y \cdot 4\right) \cdot z, z, \color{blue}{\left(y \cdot 4\right) \cdot \left(\mathsf{neg}\left(t\right)\right)}\right) \]
      9. neg-mul-1N/A

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

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

        \[\leadsto x \cdot x - \mathsf{fma}\left(\left(y \cdot 4\right) \cdot z, z, \color{blue}{\left(-1 \cdot \left(y \cdot 4\right)\right)} \cdot t\right) \]
      12. neg-mul-1N/A

        \[\leadsto x \cdot x - \mathsf{fma}\left(\left(y \cdot 4\right) \cdot z, z, \color{blue}{\left(\mathsf{neg}\left(y \cdot 4\right)\right)} \cdot t\right) \]
      13. *-lowering-*.f64N/A

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

        \[\leadsto x \cdot x - \mathsf{fma}\left(\left(y \cdot 4\right) \cdot z, z, \color{blue}{\left(y \cdot \left(\mathsf{neg}\left(4\right)\right)\right)} \cdot t\right) \]
      15. *-lowering-*.f64N/A

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

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

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

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

Alternative 2: 89.8% accurate, 0.6× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 5 \cdot 10^{+86}:\\ \;\;\;\;\mathsf{fma}\left(y, t \cdot 4, x \cdot x\right)\\ \mathbf{elif}\;z\_m \cdot z\_m \leq 2 \cdot 10^{+287}:\\ \;\;\;\;\mathsf{fma}\left(z\_m \cdot z\_m, y \cdot -4, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (if (<= (* z_m z_m) 5e+86)
   (fma y (* t 4.0) (* x x))
   (if (<= (* z_m z_m) 2e+287)
     (fma (* z_m z_m) (* y -4.0) (* x x))
     (* z_m (* z_m (* y -4.0))))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if ((z_m * z_m) <= 5e+86) {
		tmp = fma(y, (t * 4.0), (x * x));
	} else if ((z_m * z_m) <= 2e+287) {
		tmp = fma((z_m * z_m), (y * -4.0), (x * x));
	} else {
		tmp = z_m * (z_m * (y * -4.0));
	}
	return tmp;
}
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (Float64(z_m * z_m) <= 5e+86)
		tmp = fma(y, Float64(t * 4.0), Float64(x * x));
	elseif (Float64(z_m * z_m) <= 2e+287)
		tmp = fma(Float64(z_m * z_m), Float64(y * -4.0), Float64(x * x));
	else
		tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0)));
	end
	return tmp
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 5e+86], N[(y * N[(t * 4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 2e+287], N[(N[(z$95$m * z$95$m), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
z_m = \left|z\right|

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

\mathbf{elif}\;z\_m \cdot z\_m \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\mathsf{fma}\left(z\_m \cdot z\_m, y \cdot -4, x \cdot x\right)\\

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


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

    1. Initial program 97.9%

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

      \[\leadsto \color{blue}{{x}^{2} - -4 \cdot \left(t \cdot y\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{{x}^{2} + \left(\mathsf{neg}\left(-4\right)\right) \cdot \left(t \cdot y\right)} \]
      2. metadata-evalN/A

        \[\leadsto {x}^{2} + \color{blue}{4} \cdot \left(t \cdot y\right) \]
      3. +-commutativeN/A

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

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

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} + {x}^{2} \]
      6. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, {x}^{2}\right) \]
      9. +-rgt-identityN/A

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

        \[\leadsto \mathsf{fma}\left(y, t \cdot 4, \color{blue}{x \cdot x} + 0\right) \]
      11. accelerator-lowering-fma.f6493.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t \cdot 4, \mathsf{fma}\left(x, x, 0\right)\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(y, t \cdot 4, \color{blue}{x \cdot x}\right) \]
      2. *-lowering-*.f6493.5

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

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

    if 4.9999999999999998e86 < (*.f64 z z) < 2.0000000000000002e287

    1. Initial program 97.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) + x \cdot x} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) + x \cdot x \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(z \cdot z - t\right) \cdot \left(\mathsf{neg}\left(y \cdot 4\right)\right)} + x \cdot x \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot z - t, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot z + \left(\mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, z, \mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), y \cdot \color{blue}{-4}, x \cdot x\right) \]
      13. *-lowering-*.f6497.4

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot z} + 0, y \cdot -4, x \cdot x\right) \]
      3. accelerator-lowering-fma.f6492.4

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, z, 0\right)}, y \cdot -4, x \cdot x\right) \]
    8. Step-by-step derivation
      1. +-rgt-identityN/A

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

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

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

    if 2.0000000000000002e287 < (*.f64 z z)

    1. Initial program 70.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 inf

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6474.6

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified74.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6484.9

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

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

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

Alternative 3: 63.4% accurate, 0.6× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} t_1 := z\_m \cdot z\_m - t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-107}:\\ \;\;\;\;t \cdot \left(y \cdot 4\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+143}:\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (let* ((t_1 (- (* z_m z_m) t)))
   (if (<= t_1 -2e-107)
     (* t (* y 4.0))
     (if (<= t_1 1e+143) (* x x) (* z_m (* z_m (* y -4.0)))))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double t_1 = (z_m * z_m) - t;
	double tmp;
	if (t_1 <= -2e-107) {
		tmp = t * (y * 4.0);
	} else if (t_1 <= 1e+143) {
		tmp = x * x;
	} else {
		tmp = z_m * (z_m * (y * -4.0));
	}
	return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z_m * z_m) - t
    if (t_1 <= (-2d-107)) then
        tmp = t * (y * 4.0d0)
    else if (t_1 <= 1d+143) then
        tmp = x * x
    else
        tmp = z_m * (z_m * (y * (-4.0d0)))
    end if
    code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
	double t_1 = (z_m * z_m) - t;
	double tmp;
	if (t_1 <= -2e-107) {
		tmp = t * (y * 4.0);
	} else if (t_1 <= 1e+143) {
		tmp = x * x;
	} else {
		tmp = z_m * (z_m * (y * -4.0));
	}
	return tmp;
}
z_m = math.fabs(z)
def code(x, y, z_m, t):
	t_1 = (z_m * z_m) - t
	tmp = 0
	if t_1 <= -2e-107:
		tmp = t * (y * 4.0)
	elif t_1 <= 1e+143:
		tmp = x * x
	else:
		tmp = z_m * (z_m * (y * -4.0))
	return tmp
z_m = abs(z)
function code(x, y, z_m, t)
	t_1 = Float64(Float64(z_m * z_m) - t)
	tmp = 0.0
	if (t_1 <= -2e-107)
		tmp = Float64(t * Float64(y * 4.0));
	elseif (t_1 <= 1e+143)
		tmp = Float64(x * x);
	else
		tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0)));
	end
	return tmp
end
z_m = abs(z);
function tmp_2 = code(x, y, z_m, t)
	t_1 = (z_m * z_m) - t;
	tmp = 0.0;
	if (t_1 <= -2e-107)
		tmp = t * (y * 4.0);
	elseif (t_1 <= 1e+143)
		tmp = x * x;
	else
		tmp = z_m * (z_m * (y * -4.0));
	end
	tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-107], N[(t * N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+143], N[(x * x), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z_m = \left|z\right|

\\
\begin{array}{l}
t_1 := z\_m \cdot z\_m - t\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-107}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+143}:\\
\;\;\;\;x \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 z z) t) < -2e-107

    1. Initial program 97.9%

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

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

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

        \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} + 0 \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} + 0 \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot 4\right)} \cdot t + 0 \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} + 0 \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 4 \cdot t, 0\right)} \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, 0\right) \]
      8. *-lowering-*.f6472.8

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, 0\right) \]
    5. Simplified72.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t \cdot 4, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

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

        \[\leadsto y \cdot \color{blue}{\left(4 \cdot t\right)} \]
      3. associate-*r*N/A

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

        \[\leadsto \color{blue}{\left(y \cdot 4\right) \cdot t} \]
      5. *-lowering-*.f6472.8

        \[\leadsto \color{blue}{\left(y \cdot 4\right)} \cdot t \]
    7. Applied egg-rr72.8%

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

    if -2e-107 < (-.f64 (*.f64 z z) t) < 1e143

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{{x}^{2}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{{x}^{2} + 0} \]
      2. unpow2N/A

        \[\leadsto \color{blue}{x \cdot x} + 0 \]
      3. accelerator-lowering-fma.f6460.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
    5. Simplified60.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{x \cdot x} \]
      2. *-lowering-*.f6460.1

        \[\leadsto \color{blue}{x \cdot x} \]
    7. Applied egg-rr60.1%

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

    if 1e143 < (-.f64 (*.f64 z z) t)

    1. Initial program 80.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 inf

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6462.6

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified62.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6468.5

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

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

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

Alternative 4: 60.2% accurate, 0.6× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} t_1 := z\_m \cdot z\_m - t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-107}:\\ \;\;\;\;t \cdot \left(y \cdot 4\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+143}:\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z\_m \cdot \left(z\_m \cdot -4\right)\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (let* ((t_1 (- (* z_m z_m) t)))
   (if (<= t_1 -2e-107)
     (* t (* y 4.0))
     (if (<= t_1 1e+143) (* x x) (* y (* z_m (* z_m -4.0)))))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double t_1 = (z_m * z_m) - t;
	double tmp;
	if (t_1 <= -2e-107) {
		tmp = t * (y * 4.0);
	} else if (t_1 <= 1e+143) {
		tmp = x * x;
	} else {
		tmp = y * (z_m * (z_m * -4.0));
	}
	return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z_m * z_m) - t
    if (t_1 <= (-2d-107)) then
        tmp = t * (y * 4.0d0)
    else if (t_1 <= 1d+143) then
        tmp = x * x
    else
        tmp = y * (z_m * (z_m * (-4.0d0)))
    end if
    code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
	double t_1 = (z_m * z_m) - t;
	double tmp;
	if (t_1 <= -2e-107) {
		tmp = t * (y * 4.0);
	} else if (t_1 <= 1e+143) {
		tmp = x * x;
	} else {
		tmp = y * (z_m * (z_m * -4.0));
	}
	return tmp;
}
z_m = math.fabs(z)
def code(x, y, z_m, t):
	t_1 = (z_m * z_m) - t
	tmp = 0
	if t_1 <= -2e-107:
		tmp = t * (y * 4.0)
	elif t_1 <= 1e+143:
		tmp = x * x
	else:
		tmp = y * (z_m * (z_m * -4.0))
	return tmp
z_m = abs(z)
function code(x, y, z_m, t)
	t_1 = Float64(Float64(z_m * z_m) - t)
	tmp = 0.0
	if (t_1 <= -2e-107)
		tmp = Float64(t * Float64(y * 4.0));
	elseif (t_1 <= 1e+143)
		tmp = Float64(x * x);
	else
		tmp = Float64(y * Float64(z_m * Float64(z_m * -4.0)));
	end
	return tmp
end
z_m = abs(z);
function tmp_2 = code(x, y, z_m, t)
	t_1 = (z_m * z_m) - t;
	tmp = 0.0;
	if (t_1 <= -2e-107)
		tmp = t * (y * 4.0);
	elseif (t_1 <= 1e+143)
		tmp = x * x;
	else
		tmp = y * (z_m * (z_m * -4.0));
	end
	tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-107], N[(t * N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+143], N[(x * x), $MachinePrecision], N[(y * N[(z$95$m * N[(z$95$m * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z_m = \left|z\right|

\\
\begin{array}{l}
t_1 := z\_m \cdot z\_m - t\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-107}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+143}:\\
\;\;\;\;x \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 z z) t) < -2e-107

    1. Initial program 97.9%

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

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

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

        \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} + 0 \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} + 0 \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot 4\right)} \cdot t + 0 \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} + 0 \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 4 \cdot t, 0\right)} \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, 0\right) \]
      8. *-lowering-*.f6472.8

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, 0\right) \]
    5. Simplified72.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t \cdot 4, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

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

        \[\leadsto y \cdot \color{blue}{\left(4 \cdot t\right)} \]
      3. associate-*r*N/A

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

        \[\leadsto \color{blue}{\left(y \cdot 4\right) \cdot t} \]
      5. *-lowering-*.f6472.8

        \[\leadsto \color{blue}{\left(y \cdot 4\right)} \cdot t \]
    7. Applied egg-rr72.8%

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

    if -2e-107 < (-.f64 (*.f64 z z) t) < 1e143

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{{x}^{2}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{{x}^{2} + 0} \]
      2. unpow2N/A

        \[\leadsto \color{blue}{x \cdot x} + 0 \]
      3. accelerator-lowering-fma.f6460.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
    5. Simplified60.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{x \cdot x} \]
      2. *-lowering-*.f6460.1

        \[\leadsto \color{blue}{x \cdot x} \]
    7. Applied egg-rr60.1%

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

    if 1e143 < (-.f64 (*.f64 z z) t)

    1. Initial program 80.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 inf

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6462.6

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified62.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6468.5

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

      \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
    8. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y \cdot \left(-4 \cdot z\right)\right)} \cdot z \]
      2. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(\left(-4 \cdot z\right) \cdot z\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto y \cdot \color{blue}{\left(\left(-4 \cdot z\right) \cdot z\right)} \]
      5. *-lowering-*.f6462.6

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

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

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

Alternative 5: 96.0% accurate, 0.7× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 2 \cdot 10^{+287}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z\_m, z\_m, 0 - t\right), y \cdot -4, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (if (<= (* z_m z_m) 2e+287)
   (fma (fma z_m z_m (- 0.0 t)) (* y -4.0) (* x x))
   (* z_m (* z_m (* y -4.0)))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if ((z_m * z_m) <= 2e+287) {
		tmp = fma(fma(z_m, z_m, (0.0 - t)), (y * -4.0), (x * x));
	} else {
		tmp = z_m * (z_m * (y * -4.0));
	}
	return tmp;
}
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (Float64(z_m * z_m) <= 2e+287)
		tmp = fma(fma(z_m, z_m, Float64(0.0 - t)), Float64(y * -4.0), Float64(x * x));
	else
		tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0)));
	end
	return tmp
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 2e+287], N[(N[(z$95$m * z$95$m + N[(0.0 - t), $MachinePrecision]), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|

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

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


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

    1. Initial program 97.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. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) + x \cdot x} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) + x \cdot x \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(z \cdot z - t\right) \cdot \left(\mathsf{neg}\left(y \cdot 4\right)\right)} + x \cdot x \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot z - t, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot z + \left(\mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, z, \mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), y \cdot \color{blue}{-4}, x \cdot x\right) \]
      13. *-lowering-*.f6499.4

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

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

    if 2.0000000000000002e287 < (*.f64 z z)

    1. Initial program 70.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 inf

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6474.6

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified74.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6484.9

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

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

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

Alternative 6: 95.7% accurate, 0.7× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 2 \cdot 10^{+287}:\\ \;\;\;\;\mathsf{fma}\left(x, x, y \cdot \left(\mathsf{fma}\left(z\_m, z\_m, 0 - t\right) \cdot -4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (if (<= (* z_m z_m) 2e+287)
   (fma x x (* y (* (fma z_m z_m (- 0.0 t)) -4.0)))
   (* z_m (* z_m (* y -4.0)))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if ((z_m * z_m) <= 2e+287) {
		tmp = fma(x, x, (y * (fma(z_m, z_m, (0.0 - t)) * -4.0)));
	} else {
		tmp = z_m * (z_m * (y * -4.0));
	}
	return tmp;
}
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (Float64(z_m * z_m) <= 2e+287)
		tmp = fma(x, x, Float64(y * Float64(fma(z_m, z_m, Float64(0.0 - t)) * -4.0)));
	else
		tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0)));
	end
	return tmp
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 2e+287], N[(x * x + N[(y * N[(N[(z$95$m * z$95$m + N[(0.0 - t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|

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

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


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

    1. Initial program 97.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. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{y \cdot \left(\mathsf{neg}\left(4 \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{y \cdot \left(\mathsf{neg}\left(4 \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      6. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(x, x, y \cdot \color{blue}{\left(\left(z \cdot z - t\right) \cdot \left(\mathsf{neg}\left(4\right)\right)\right)}\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(x, x, y \cdot \left(\color{blue}{\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)} \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, y \cdot \left(\color{blue}{\mathsf{fma}\left(z, z, \mathsf{neg}\left(t\right)\right)} \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(x, x, y \cdot \left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right) \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

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

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

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

    if 2.0000000000000002e287 < (*.f64 z z)

    1. Initial program 70.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 inf

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6474.6

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified74.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6484.9

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

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

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

Alternative 7: 96.3% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 3.6 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z\_m, z\_m, 0 - t\right), y \cdot -4, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z\_m \cdot \frac{z\_m}{\frac{-0.25}{y}}\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
 :precision binary64
 (if (<= z_m 3.6e+151)
   (fma (fma z_m z_m (- 0.0 t)) (* y -4.0) (* x x))
   (* z_m (/ z_m (/ -0.25 y)))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if (z_m <= 3.6e+151) {
		tmp = fma(fma(z_m, z_m, (0.0 - t)), (y * -4.0), (x * x));
	} else {
		tmp = z_m * (z_m / (-0.25 / y));
	}
	return tmp;
}
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (z_m <= 3.6e+151)
		tmp = fma(fma(z_m, z_m, Float64(0.0 - t)), Float64(y * -4.0), Float64(x * x));
	else
		tmp = Float64(z_m * Float64(z_m / Float64(-0.25 / y)));
	end
	return tmp
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := If[LessEqual[z$95$m, 3.6e+151], N[(N[(z$95$m * z$95$m + N[(0.0 - t), $MachinePrecision]), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z$95$m * N[(z$95$m / N[(-0.25 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|

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

\mathbf{else}:\\
\;\;\;\;z\_m \cdot \frac{z\_m}{\frac{-0.25}{y}}\\


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

    1. Initial program 94.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x \cdot x + \left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right) + x \cdot x} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right)\right) + x \cdot x \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(z \cdot z - t\right) \cdot \left(\mathsf{neg}\left(y \cdot 4\right)\right)} + x \cdot x \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot z - t, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot z + \left(\mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, z, \mathsf{neg}\left(t\right)\right)}, \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, \color{blue}{0 - t}\right), \mathsf{neg}\left(y \cdot 4\right), x \cdot x\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), \color{blue}{y \cdot \left(\mathsf{neg}\left(4\right)\right)}, x \cdot x\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, z, 0 - t\right), y \cdot \color{blue}{-4}, x \cdot x\right) \]
      13. *-lowering-*.f6495.7

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

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

    if 3.6e151 < z

    1. Initial program 61.1%

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

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6467.4

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified67.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6490.5

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

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

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot -4\right)\right)} \cdot z \]
      2. *-rgt-identityN/A

        \[\leadsto \left(z \cdot \color{blue}{\left(\left(y \cdot -4\right) \cdot 1\right)}\right) \cdot z \]
      3. *-inversesN/A

        \[\leadsto \left(z \cdot \left(\left(y \cdot -4\right) \cdot \color{blue}{\frac{y \cdot -4}{y \cdot -4}}\right)\right) \cdot z \]
      4. associate-/l*N/A

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

        \[\leadsto \left(z \cdot \color{blue}{\frac{1}{\frac{y \cdot -4}{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}}}\right) \cdot z \]
      6. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{z}{\frac{y \cdot -4}{\left(y \cdot -4\right) \cdot \left(y \cdot -4\right)}}} \cdot z \]
      8. associate-/r*N/A

        \[\leadsto \frac{z}{\color{blue}{\frac{\frac{y \cdot -4}{y \cdot -4}}{y \cdot -4}}} \cdot z \]
      9. *-inversesN/A

        \[\leadsto \frac{z}{\frac{\color{blue}{1}}{y \cdot -4}} \cdot z \]
      10. *-commutativeN/A

        \[\leadsto \frac{z}{\frac{1}{\color{blue}{-4 \cdot y}}} \cdot z \]
      11. associate-/r*N/A

        \[\leadsto \frac{z}{\color{blue}{\frac{\frac{1}{-4}}{y}}} \cdot z \]
      12. metadata-evalN/A

        \[\leadsto \frac{z}{\frac{\color{blue}{\frac{-1}{4}}}{y}} \cdot z \]
      13. metadata-evalN/A

        \[\leadsto \frac{z}{\frac{\color{blue}{\frac{-4}{16}}}{y}} \cdot z \]
      14. metadata-evalN/A

        \[\leadsto \frac{z}{\frac{\frac{-4}{\color{blue}{-4 \cdot -4}}}{y}} \cdot z \]
      15. /-lowering-/.f64N/A

        \[\leadsto \frac{z}{\color{blue}{\frac{\frac{-4}{-4 \cdot -4}}{y}}} \cdot z \]
      16. metadata-evalN/A

        \[\leadsto \frac{z}{\frac{\frac{-4}{\color{blue}{16}}}{y}} \cdot z \]
      17. metadata-eval90.6

        \[\leadsto \frac{z}{\frac{\color{blue}{-0.25}}{y}} \cdot z \]
    9. Applied egg-rr90.6%

      \[\leadsto \color{blue}{\frac{z}{\frac{-0.25}{y}}} \cdot z \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.1%

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

Alternative 8: 85.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 98.1%

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

      \[\leadsto \color{blue}{{x}^{2} - -4 \cdot \left(t \cdot y\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{{x}^{2} + \left(\mathsf{neg}\left(-4\right)\right) \cdot \left(t \cdot y\right)} \]
      2. metadata-evalN/A

        \[\leadsto {x}^{2} + \color{blue}{4} \cdot \left(t \cdot y\right) \]
      3. +-commutativeN/A

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

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

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} + {x}^{2} \]
      6. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, {x}^{2}\right) \]
      9. +-rgt-identityN/A

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

        \[\leadsto \mathsf{fma}\left(y, t \cdot 4, \color{blue}{x \cdot x} + 0\right) \]
      11. accelerator-lowering-fma.f6491.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t \cdot 4, \mathsf{fma}\left(x, x, 0\right)\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(y, t \cdot 4, \color{blue}{x \cdot x}\right) \]
      2. *-lowering-*.f6491.0

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

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

    if 1.00000000000000001e155 < (*.f64 z z)

    1. Initial program 77.5%

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

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6475.8

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6483.2

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

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

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

Alternative 9: 85.7% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 94.5%

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

      \[\leadsto \color{blue}{{x}^{2} - -4 \cdot \left(t \cdot y\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{{x}^{2} + \left(\mathsf{neg}\left(-4\right)\right) \cdot \left(t \cdot y\right)} \]
      2. metadata-evalN/A

        \[\leadsto {x}^{2} + \color{blue}{4} \cdot \left(t \cdot y\right) \]
      3. +-commutativeN/A

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

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

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} + {x}^{2} \]
      6. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, {x}^{2}\right) \]
      9. +-rgt-identityN/A

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

        \[\leadsto \mathsf{fma}\left(y, t \cdot 4, \color{blue}{x \cdot x} + 0\right) \]
      11. accelerator-lowering-fma.f6477.8

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t \cdot 4, \mathsf{fma}\left(x, x, 0\right)\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto y \cdot \left(t \cdot 4\right) + \color{blue}{x \cdot x} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{x \cdot x + y \cdot \left(t \cdot 4\right)} \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, y \cdot \left(t \cdot 4\right)\right)} \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{y \cdot \left(t \cdot 4\right) + 0}\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\mathsf{fma}\left(y, t \cdot 4, 0\right)}\right) \]
      6. *-lowering-*.f6475.9

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, \mathsf{fma}\left(y, t \cdot 4, 0\right)\right)} \]
    8. Step-by-step derivation
      1. +-rgt-identityN/A

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

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(y \cdot t\right) \cdot 4}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(y \cdot t\right) \cdot 4}\right) \]
      4. *-lowering-*.f6475.9

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

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

    if 5.00000000000000004e77 < z

    1. Initial program 70.7%

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

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right) + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot {z}^{2}, 0\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{y \cdot {z}^{2}}, 0\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\left({z}^{2} + 0\right)}, 0\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \left(\color{blue}{z \cdot z} + 0\right), 0\right) \]
      6. accelerator-lowering-fma.f6467.1

        \[\leadsto \mathsf{fma}\left(-4, y \cdot \color{blue}{\mathsf{fma}\left(z, z, 0\right)}, 0\right) \]
    5. Simplified67.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, y \cdot \mathsf{fma}\left(z, z, 0\right), 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{-4 \cdot \left(y \cdot \left(z \cdot z + 0\right)\right)} \]
      2. +-rgt-identityN/A

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

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot \left(z \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot -4\right)} \cdot \left(z \cdot z\right) \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right) \cdot z} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(y \cdot -4\right) \cdot z\right)} \cdot z \]
      8. *-lowering-*.f6483.2

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

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

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

Alternative 10: 59.3% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 94.0%

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

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

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

        \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} + 0 \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(4 \cdot y\right) \cdot t} + 0 \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot 4\right)} \cdot t + 0 \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} + 0 \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 4 \cdot t, 0\right)} \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{t \cdot 4}, 0\right) \]
      8. *-lowering-*.f6450.3

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t \cdot 4, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

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

        \[\leadsto y \cdot \color{blue}{\left(4 \cdot t\right)} \]
      3. associate-*r*N/A

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

        \[\leadsto \color{blue}{\left(y \cdot 4\right) \cdot t} \]
      5. *-lowering-*.f6450.3

        \[\leadsto \color{blue}{\left(y \cdot 4\right)} \cdot t \]
    7. Applied egg-rr50.3%

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

    if 1.99999999999999997e67 < (*.f64 x x)

    1. Initial program 85.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

      \[\leadsto \color{blue}{{x}^{2}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{{x}^{2} + 0} \]
      2. unpow2N/A

        \[\leadsto \color{blue}{x \cdot x} + 0 \]
      3. accelerator-lowering-fma.f6474.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
    5. Simplified74.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{x \cdot x} \]
      2. *-lowering-*.f6474.3

        \[\leadsto \color{blue}{x \cdot x} \]
    7. Applied egg-rr74.3%

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

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

Alternative 11: 40.8% accurate, 4.5× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ x \cdot x \end{array} \]
z_m = (fabs.f64 z)
(FPCore (x y z_m t) :precision binary64 (* x x))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	return x * x;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    code = x * x
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
	return x * x;
}
z_m = math.fabs(z)
def code(x, y, z_m, t):
	return x * x
z_m = abs(z)
function code(x, y, z_m, t)
	return Float64(x * x)
end
z_m = abs(z);
function tmp = code(x, y, z_m, t)
	tmp = x * x;
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := N[(x * x), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|

\\
x \cdot x
\end{array}
Derivation
  1. Initial program 90.2%

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

    \[\leadsto \color{blue}{{x}^{2}} \]
  4. Step-by-step derivation
    1. +-rgt-identityN/A

      \[\leadsto \color{blue}{{x}^{2} + 0} \]
    2. unpow2N/A

      \[\leadsto \color{blue}{x \cdot x} + 0 \]
    3. accelerator-lowering-fma.f6440.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
  5. Simplified40.7%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 0\right)} \]
  6. Step-by-step derivation
    1. +-rgt-identityN/A

      \[\leadsto \color{blue}{x \cdot x} \]
    2. *-lowering-*.f6440.7

      \[\leadsto \color{blue}{x \cdot x} \]
  7. Applied egg-rr40.7%

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

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

  :alt
  (! :herbie-platform default (- (* x x) (* 4 (* y (- (* z z) t)))))

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