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

Percentage Accurate: 90.1% → 95.4%
Time: 6.6s
Alternatives: 7
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 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.1% 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: 95.4% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;z\_m \cdot t\_1\\


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

    1. Initial program 93.5%

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

        \[\leadsto \color{blue}{x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)} \]
      2. 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)} \]
      3. +-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} \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6999999999999998e198 < z

    1. Initial program 93.3%

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
      6. unpow2N/A

        \[\leadsto y \cdot \left(-4 \cdot \color{blue}{\left(z \cdot z\right)}\right) \]
      7. lower-*.f64100.0

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

      \[\leadsto \color{blue}{y \cdot \left(-4 \cdot \left(z \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites93.9%

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

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

    Alternative 2: 76.0% accurate, 0.5× 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 -5 \cdot 10^{-65}:\\ \;\;\;\;y \cdot \left(t \cdot 4\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+303}:\\ \;\;\;\;\mathsf{fma}\left(y, -4 \cdot \left(z\_m \cdot z\_m\right), 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
     (let* ((t_1 (- (* z_m z_m) t)))
       (if (<= t_1 -5e-65)
         (* y (* t 4.0))
         (if (<= t_1 5e+303)
           (fma y (* -4.0 (* z_m z_m)) (* 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 <= -5e-65) {
    		tmp = y * (t * 4.0);
    	} else if (t_1 <= 5e+303) {
    		tmp = fma(y, (-4.0 * (z_m * z_m)), (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 <= -5e-65)
    		tmp = Float64(y * Float64(t * 4.0));
    	elseif (t_1 <= 5e+303)
    		tmp = fma(y, Float64(-4.0 * Float64(z_m * z_m)), 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_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-65], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+303], N[(y * N[(-4.0 * N[(z$95$m * z$95$m), $MachinePrecision]), $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}
    t_1 := z\_m \cdot z\_m - t\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-65}:\\
    \;\;\;\;y \cdot \left(t \cdot 4\right)\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+303}:\\
    \;\;\;\;\mathsf{fma}\left(y, -4 \cdot \left(z\_m \cdot z\_m\right), 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 (*.f64 z z) t) < -4.99999999999999983e-65

      1. Initial program 100.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. associate-*r*N/A

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

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

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

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

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

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

      if -4.99999999999999983e-65 < (-.f64 (*.f64 z z) t) < 4.9999999999999997e303

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

        \[\leadsto \color{blue}{{x}^{2} - 4 \cdot \left(y \cdot {z}^{2}\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(y \cdot {z}^{2}\right)} \]
        2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, -4 \cdot \left(z \cdot z\right), \color{blue}{x \cdot x}\right) \]
        12. lower-*.f6478.1

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

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

      if 4.9999999999999997e303 < (-.f64 (*.f64 z z) t)

      1. Initial program 78.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. associate-*r*N/A

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

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

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

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

          \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
        6. unpow2N/A

          \[\leadsto y \cdot \left(-4 \cdot \color{blue}{\left(z \cdot z\right)}\right) \]
        7. lower-*.f6488.4

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

        \[\leadsto \color{blue}{y \cdot \left(-4 \cdot \left(z \cdot z\right)\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites90.0%

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

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

      Alternative 3: 58.6% accurate, 0.6× speedup?

      \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 10^{-321}:\\ \;\;\;\;x \cdot x\\ \mathbf{elif}\;z\_m \cdot z\_m \leq 8 \cdot 10^{-196}:\\ \;\;\;\;y \cdot \left(t \cdot 4\right)\\ \mathbf{elif}\;z\_m \cdot z\_m \leq 5 \cdot 10^{+114}:\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-4 \cdot \left(z\_m \cdot z\_m\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-321)
         (* x x)
         (if (<= (* z_m z_m) 8e-196)
           (* y (* t 4.0))
           (if (<= (* z_m z_m) 5e+114) (* x x) (* y (* -4.0 (* z_m z_m)))))))
      z_m = fabs(z);
      double code(double x, double y, double z_m, double t) {
      	double tmp;
      	if ((z_m * z_m) <= 1e-321) {
      		tmp = x * x;
      	} else if ((z_m * z_m) <= 8e-196) {
      		tmp = y * (t * 4.0);
      	} else if ((z_m * z_m) <= 5e+114) {
      		tmp = x * x;
      	} else {
      		tmp = y * (-4.0 * (z_m * z_m));
      	}
      	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 ((z_m * z_m) <= 1d-321) then
              tmp = x * x
          else if ((z_m * z_m) <= 8d-196) then
              tmp = y * (t * 4.0d0)
          else if ((z_m * z_m) <= 5d+114) then
              tmp = x * x
          else
              tmp = y * ((-4.0d0) * (z_m * z_m))
          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 ((z_m * z_m) <= 1e-321) {
      		tmp = x * x;
      	} else if ((z_m * z_m) <= 8e-196) {
      		tmp = y * (t * 4.0);
      	} else if ((z_m * z_m) <= 5e+114) {
      		tmp = x * x;
      	} else {
      		tmp = y * (-4.0 * (z_m * z_m));
      	}
      	return tmp;
      }
      
      z_m = math.fabs(z)
      def code(x, y, z_m, t):
      	tmp = 0
      	if (z_m * z_m) <= 1e-321:
      		tmp = x * x
      	elif (z_m * z_m) <= 8e-196:
      		tmp = y * (t * 4.0)
      	elif (z_m * z_m) <= 5e+114:
      		tmp = x * x
      	else:
      		tmp = y * (-4.0 * (z_m * z_m))
      	return tmp
      
      z_m = abs(z)
      function code(x, y, z_m, t)
      	tmp = 0.0
      	if (Float64(z_m * z_m) <= 1e-321)
      		tmp = Float64(x * x);
      	elseif (Float64(z_m * z_m) <= 8e-196)
      		tmp = Float64(y * Float64(t * 4.0));
      	elseif (Float64(z_m * z_m) <= 5e+114)
      		tmp = Float64(x * x);
      	else
      		tmp = Float64(y * Float64(-4.0 * Float64(z_m * z_m)));
      	end
      	return tmp
      end
      
      z_m = abs(z);
      function tmp_2 = code(x, y, z_m, t)
      	tmp = 0.0;
      	if ((z_m * z_m) <= 1e-321)
      		tmp = x * x;
      	elseif ((z_m * z_m) <= 8e-196)
      		tmp = y * (t * 4.0);
      	elseif ((z_m * z_m) <= 5e+114)
      		tmp = x * x;
      	else
      		tmp = y * (-4.0 * (z_m * z_m));
      	end
      	tmp_2 = 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-321], N[(x * x), $MachinePrecision], If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 8e-196], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 5e+114], N[(x * x), $MachinePrecision], N[(y * N[(-4.0 * N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      z_m = \left|z\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z\_m \cdot z\_m \leq 10^{-321}:\\
      \;\;\;\;x \cdot x\\
      
      \mathbf{elif}\;z\_m \cdot z\_m \leq 8 \cdot 10^{-196}:\\
      \;\;\;\;y \cdot \left(t \cdot 4\right)\\
      
      \mathbf{elif}\;z\_m \cdot z\_m \leq 5 \cdot 10^{+114}:\\
      \;\;\;\;x \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;y \cdot \left(-4 \cdot \left(z\_m \cdot z\_m\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 z z) < 9.98013e-322 or 8.0000000000000004e-196 < (*.f64 z z) < 5.0000000000000001e114

        1. Initial program 99.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. unpow2N/A

            \[\leadsto \color{blue}{x \cdot x} \]
          2. lower-*.f6456.8

            \[\leadsto \color{blue}{x \cdot x} \]
        5. Applied rewrites56.8%

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

        if 9.98013e-322 < (*.f64 z z) < 8.0000000000000004e-196

        1. Initial program 92.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. associate-*r*N/A

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

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

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

            \[\leadsto y \cdot \color{blue}{\left(t \cdot 4\right)} \]
          5. lower-*.f6473.2

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

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

        if 5.0000000000000001e114 < (*.f64 z z)

        1. Initial program 86.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. associate-*r*N/A

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

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

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

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

            \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
          6. unpow2N/A

            \[\leadsto y \cdot \left(-4 \cdot \color{blue}{\left(z \cdot z\right)}\right) \]
          7. lower-*.f6480.1

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

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

      Alternative 4: 61.9% accurate, 0.8× speedup?

      \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 6.4 \cdot 10^{-161}:\\ \;\;\;\;x \cdot x\\ \mathbf{elif}\;z\_m \leq 1.15 \cdot 10^{-98}:\\ \;\;\;\;y \cdot \left(t \cdot 4\right)\\ \mathbf{elif}\;z\_m \leq 5.2 \cdot 10^{+55}:\\ \;\;\;\;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
       (if (<= z_m 6.4e-161)
         (* x x)
         (if (<= z_m 1.15e-98)
           (* y (* t 4.0))
           (if (<= z_m 5.2e+55) (* 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 <= 6.4e-161) {
      		tmp = x * x;
      	} else if (z_m <= 1.15e-98) {
      		tmp = y * (t * 4.0);
      	} else if (z_m <= 5.2e+55) {
      		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) :: tmp
          if (z_m <= 6.4d-161) then
              tmp = x * x
          else if (z_m <= 1.15d-98) then
              tmp = y * (t * 4.0d0)
          else if (z_m <= 5.2d+55) 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 tmp;
      	if (z_m <= 6.4e-161) {
      		tmp = x * x;
      	} else if (z_m <= 1.15e-98) {
      		tmp = y * (t * 4.0);
      	} else if (z_m <= 5.2e+55) {
      		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):
      	tmp = 0
      	if z_m <= 6.4e-161:
      		tmp = x * x
      	elif z_m <= 1.15e-98:
      		tmp = y * (t * 4.0)
      	elif z_m <= 5.2e+55:
      		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)
      	tmp = 0.0
      	if (z_m <= 6.4e-161)
      		tmp = Float64(x * x);
      	elseif (z_m <= 1.15e-98)
      		tmp = Float64(y * Float64(t * 4.0));
      	elseif (z_m <= 5.2e+55)
      		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)
      	tmp = 0.0;
      	if (z_m <= 6.4e-161)
      		tmp = x * x;
      	elseif (z_m <= 1.15e-98)
      		tmp = y * (t * 4.0);
      	elseif (z_m <= 5.2e+55)
      		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_] := If[LessEqual[z$95$m, 6.4e-161], N[(x * x), $MachinePrecision], If[LessEqual[z$95$m, 1.15e-98], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 5.2e+55], 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}
      \mathbf{if}\;z\_m \leq 6.4 \cdot 10^{-161}:\\
      \;\;\;\;x \cdot x\\
      
      \mathbf{elif}\;z\_m \leq 1.15 \cdot 10^{-98}:\\
      \;\;\;\;y \cdot \left(t \cdot 4\right)\\
      
      \mathbf{elif}\;z\_m \leq 5.2 \cdot 10^{+55}:\\
      \;\;\;\;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 z < 6.39999999999999971e-161 or 1.15e-98 < z < 5.2e55

        1. Initial program 95.0%

          \[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. unpow2N/A

            \[\leadsto \color{blue}{x \cdot x} \]
          2. lower-*.f6444.4

            \[\leadsto \color{blue}{x \cdot x} \]
        5. Applied rewrites44.4%

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

        if 6.39999999999999971e-161 < z < 1.15e-98

        1. Initial program 92.3%

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

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

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

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

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

            \[\leadsto y \cdot \color{blue}{\left(t \cdot 4\right)} \]
          5. lower-*.f6471.2

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

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

        if 5.2e55 < z

        1. Initial program 86.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. associate-*r*N/A

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

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

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

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

            \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
          6. unpow2N/A

            \[\leadsto y \cdot \left(-4 \cdot \color{blue}{\left(z \cdot z\right)}\right) \]
          7. lower-*.f6477.7

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 6.4 \cdot 10^{-161}:\\ \;\;\;\;x \cdot x\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-98}:\\ \;\;\;\;y \cdot \left(t \cdot 4\right)\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+55}:\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 94.0% accurate, 0.8× speedup?

        \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 2 \cdot 10^{+175}:\\ \;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z\_m \cdot z\_m\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 2e+175)
           (+ (* x x) (* (* y 4.0) (- t (* z_m z_m))))
           (* 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 <= 2e+175) {
        		tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m)));
        	} 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) :: tmp
            if (z_m <= 2d+175) then
                tmp = (x * x) + ((y * 4.0d0) * (t - (z_m * z_m)))
            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 tmp;
        	if (z_m <= 2e+175) {
        		tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m)));
        	} else {
        		tmp = z_m * (z_m * (y * -4.0));
        	}
        	return tmp;
        }
        
        z_m = math.fabs(z)
        def code(x, y, z_m, t):
        	tmp = 0
        	if z_m <= 2e+175:
        		tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m)))
        	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 <= 2e+175)
        		tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z_m * z_m))));
        	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)
        	tmp = 0.0;
        	if (z_m <= 2e+175)
        		tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m)));
        	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_] := If[LessEqual[z$95$m, 2e+175], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z$95$m * z$95$m), $MachinePrecision]), $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 2 \cdot 10^{+175}:\\
        \;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z\_m \cdot z\_m\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 < 1.9999999999999999e175

          1. Initial program 94.6%

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

          if 1.9999999999999999e175 < z

          1. Initial program 81.2%

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

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

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

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

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

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

              \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
            6. unpow2N/A

              \[\leadsto y \cdot \left(-4 \cdot \color{blue}{\left(z \cdot z\right)}\right) \]
            7. lower-*.f6485.9

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

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

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

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

          Alternative 6: 46.0% accurate, 1.6× speedup?

          \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;x \leq 1.35 \cdot 10^{+40}:\\ \;\;\;\;y \cdot \left(t \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 1.35e+40) (* y (* t 4.0)) (* x x)))
          z_m = fabs(z);
          double code(double x, double y, double z_m, double t) {
          	double tmp;
          	if (x <= 1.35e+40) {
          		tmp = y * (t * 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 <= 1.35d+40) then
                  tmp = y * (t * 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 <= 1.35e+40) {
          		tmp = y * (t * 4.0);
          	} else {
          		tmp = x * x;
          	}
          	return tmp;
          }
          
          z_m = math.fabs(z)
          def code(x, y, z_m, t):
          	tmp = 0
          	if x <= 1.35e+40:
          		tmp = y * (t * 4.0)
          	else:
          		tmp = x * x
          	return tmp
          
          z_m = abs(z)
          function code(x, y, z_m, t)
          	tmp = 0.0
          	if (x <= 1.35e+40)
          		tmp = Float64(y * Float64(t * 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 <= 1.35e+40)
          		tmp = y * (t * 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[x, 1.35e+40], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
          
          \begin{array}{l}
          z_m = \left|z\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 1.35 \cdot 10^{+40}:\\
          \;\;\;\;y \cdot \left(t \cdot 4\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;x \cdot x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 1.35000000000000005e40

            1. Initial program 93.6%

              \[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. associate-*r*N/A

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

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

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

                \[\leadsto y \cdot \color{blue}{\left(t \cdot 4\right)} \]
              5. lower-*.f6437.1

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

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

            if 1.35000000000000005e40 < x

            1. Initial program 93.1%

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

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

                \[\leadsto \color{blue}{x \cdot x} \]
              2. lower-*.f6475.0

                \[\leadsto \color{blue}{x \cdot x} \]
            5. Applied rewrites75.0%

              \[\leadsto \color{blue}{x \cdot x} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 7: 41.1% 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 93.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. unpow2N/A

              \[\leadsto \color{blue}{x \cdot x} \]
            2. lower-*.f6441.7

              \[\leadsto \color{blue}{x \cdot x} \]
          5. Applied rewrites41.7%

            \[\leadsto \color{blue}{x \cdot x} \]
          6. 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 2024238 
          (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))))