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

Percentage Accurate: 90.6% → 96.4%
Time: 7.0s
Alternatives: 9
Speedup: 0.9×

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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.6% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 96.4% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 93.7%

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

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

    if 9.60000000000000007e147 < z

    1. Initial program 62.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. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 2: 63.0% 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 -1 \cdot 10^{+42}:\\ \;\;\;\;\left(t \cdot y\right) \cdot 4\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+76}:\\ \;\;\;\;1 \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z\_m \cdot y\right) \cdot z\_m\right) \cdot -4\\ \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 -1e+42)
         (* (* t y) 4.0)
         (if (<= t_1 5e+76) (* 1.0 (* x x)) (* (* (* z_m y) 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 <= -1e+42) {
    		tmp = (t * y) * 4.0;
    	} else if (t_1 <= 5e+76) {
    		tmp = 1.0 * (x * x);
    	} else {
    		tmp = ((z_m * y) * z_m) * -4.0;
    	}
    	return tmp;
    }
    
    z_m =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z_m, t)
    use fmin_fmax_functions
        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 <= (-1d+42)) then
            tmp = (t * y) * 4.0d0
        else if (t_1 <= 5d+76) then
            tmp = 1.0d0 * (x * x)
        else
            tmp = ((z_m * y) * 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 <= -1e+42) {
    		tmp = (t * y) * 4.0;
    	} else if (t_1 <= 5e+76) {
    		tmp = 1.0 * (x * x);
    	} else {
    		tmp = ((z_m * y) * 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 <= -1e+42:
    		tmp = (t * y) * 4.0
    	elif t_1 <= 5e+76:
    		tmp = 1.0 * (x * x)
    	else:
    		tmp = ((z_m * y) * 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 <= -1e+42)
    		tmp = Float64(Float64(t * y) * 4.0);
    	elseif (t_1 <= 5e+76)
    		tmp = Float64(1.0 * Float64(x * x));
    	else
    		tmp = Float64(Float64(Float64(z_m * y) * 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 <= -1e+42)
    		tmp = (t * y) * 4.0;
    	elseif (t_1 <= 5e+76)
    		tmp = 1.0 * (x * x);
    	else
    		tmp = ((z_m * y) * 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, -1e+42], N[(N[(t * y), $MachinePrecision] * 4.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+76], N[(1.0 * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z$95$m * y), $MachinePrecision] * z$95$m), $MachinePrecision] * -4.0), $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 -1 \cdot 10^{+42}:\\
    \;\;\;\;\left(t \cdot y\right) \cdot 4\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+76}:\\
    \;\;\;\;1 \cdot \left(x \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(z\_m \cdot y\right) \cdot z\_m\right) \cdot -4\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (*.f64 z z) t) < -1.00000000000000004e42

      1. Initial program 97.2%

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

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

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

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

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

      if -1.00000000000000004e42 < (-.f64 (*.f64 z z) t) < 4.99999999999999991e76

      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} \cdot \left(1 + -4 \cdot \frac{y \cdot \left({z}^{2} - t\right)}{{x}^{2}}\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

          \[\leadsto \left(-4 \cdot \frac{\left({z}^{2} - t\right) \cdot y}{\color{blue}{x \cdot x}} + 1\right) \cdot {x}^{2} \]
        6. times-fracN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-4 \cdot \frac{z \cdot z - t}{x}, \frac{y}{x}, 1\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
        16. lower-*.f6481.6

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

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

        \[\leadsto 1 \cdot \left(\color{blue}{x} \cdot x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites67.8%

          \[\leadsto 1 \cdot \left(\color{blue}{x} \cdot x\right) \]

        if 4.99999999999999991e76 < (-.f64 (*.f64 z z) t)

        1. Initial program 80.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. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 3: 90.2% accurate, 0.8× speedup?

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

          1. Initial program 92.8%

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

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

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

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

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

            \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot 4} \]
          6. Taylor expanded in z around 0

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

              \[\leadsto {x}^{2} - \color{blue}{\left(\mathsf{neg}\left(4\right)\right)} \cdot \left(t \cdot y\right) \]
            2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

          if 8.9999999999999995e-15 < z < 9.60000000000000007e147

          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 t around 0

            \[\leadsto \color{blue}{{x}^{2} - 4 \cdot \left(y \cdot {z}^{2}\right)} \]
          4. Step-by-step derivation
            1. fp-cancel-sub-sign-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. *-rgt-identityN/A

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

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

              \[\leadsto -4 \cdot \left(y \cdot {z}^{2}\right) + \color{blue}{x \cdot \left(x \cdot 1\right)} \]
            7. fp-cancel-sign-sub-invN/A

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

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

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

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

              \[\leadsto -4 \cdot \left(y \cdot {z}^{2}\right) - \left(\mathsf{neg}\left(\color{blue}{{x}^{2}}\right)\right) \]
            12. mul-1-negN/A

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

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

              \[\leadsto -4 \cdot \left(y \cdot {z}^{2}\right) - \color{blue}{\left(x \cdot x\right)} \cdot -1 \]
            15. sqr-neg-revN/A

              \[\leadsto -4 \cdot \left(y \cdot {z}^{2}\right) - \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \cdot -1 \]
            16. distribute-lft-neg-outN/A

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

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

              \[\leadsto -4 \cdot \left(y \cdot {z}^{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{{x}^{2}}\right)\right)\right)\right) \cdot -1 \]
            19. mul-1-negN/A

              \[\leadsto -4 \cdot \left(y \cdot {z}^{2}\right) - \left(\mathsf{neg}\left(\color{blue}{-1 \cdot {x}^{2}}\right)\right) \cdot -1 \]
            20. fp-cancel-sign-subN/A

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

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

              \[\leadsto \left(y \cdot {z}^{2}\right) \cdot -4 + \color{blue}{\left(\mathsf{neg}\left({x}^{2}\right)\right)} \cdot -1 \]
          5. Applied rewrites84.1%

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

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

            if 9.60000000000000007e147 < z

            1. Initial program 62.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. *-commutativeN/A

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

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

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

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

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

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

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

                \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 4: 87.3% accurate, 0.9× speedup?

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

              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 t around inf

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

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

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

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

                \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot 4} \]
              6. Taylor expanded in z around 0

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

                  \[\leadsto {x}^{2} - \color{blue}{\left(\mathsf{neg}\left(4\right)\right)} \cdot \left(t \cdot y\right) \]
                2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

              if 3.2999999999999999e38 < z < 4.9999999999999999e144

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

              if 4.9999999999999999e144 < z

              1. Initial program 62.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. *-commutativeN/A

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 5: 95.5% accurate, 0.9× speedup?

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

                1. Initial program 93.7%

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

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

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

                if 9.60000000000000007e147 < z

                1. Initial program 62.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. *-commutativeN/A

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

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

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

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

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

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

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

                    \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
                7. Recombined 2 regimes into one program.
                8. Add Preprocessing

                Alternative 6: 85.2% accurate, 1.2× speedup?

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

                  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 t around inf

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

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

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

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

                    \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot 4} \]
                  6. Taylor expanded in z around 0

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

                      \[\leadsto {x}^{2} - \color{blue}{\left(\mathsf{neg}\left(4\right)\right)} \cdot \left(t \cdot y\right) \]
                    2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

                  if 1.59999999999999996e39 < z

                  1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
                  7. Recombined 2 regimes into one program.
                  8. Add Preprocessing

                  Alternative 7: 45.3% accurate, 1.6× speedup?

                  \[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;x \leq 2.6 \cdot 10^{+53}:\\ \;\;\;\;\left(t \cdot y\right) \cdot 4\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(x \cdot x\right)\\ \end{array} \end{array} \]
                  z_m = (fabs.f64 z)
                  (FPCore (x y z_m t)
                   :precision binary64
                   (if (<= x 2.6e+53) (* (* t y) 4.0) (* 1.0 (* x x))))
                  z_m = fabs(z);
                  double code(double x, double y, double z_m, double t) {
                  	double tmp;
                  	if (x <= 2.6e+53) {
                  		tmp = (t * y) * 4.0;
                  	} else {
                  		tmp = 1.0 * (x * x);
                  	}
                  	return tmp;
                  }
                  
                  z_m =     private
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z_m, t)
                  use fmin_fmax_functions
                      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 <= 2.6d+53) then
                          tmp = (t * y) * 4.0d0
                      else
                          tmp = 1.0d0 * (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 <= 2.6e+53) {
                  		tmp = (t * y) * 4.0;
                  	} else {
                  		tmp = 1.0 * (x * x);
                  	}
                  	return tmp;
                  }
                  
                  z_m = math.fabs(z)
                  def code(x, y, z_m, t):
                  	tmp = 0
                  	if x <= 2.6e+53:
                  		tmp = (t * y) * 4.0
                  	else:
                  		tmp = 1.0 * (x * x)
                  	return tmp
                  
                  z_m = abs(z)
                  function code(x, y, z_m, t)
                  	tmp = 0.0
                  	if (x <= 2.6e+53)
                  		tmp = Float64(Float64(t * y) * 4.0);
                  	else
                  		tmp = Float64(1.0 * 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 <= 2.6e+53)
                  		tmp = (t * y) * 4.0;
                  	else
                  		tmp = 1.0 * (x * x);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  z_m = N[Abs[z], $MachinePrecision]
                  code[x_, y_, z$95$m_, t_] := If[LessEqual[x, 2.6e+53], N[(N[(t * y), $MachinePrecision] * 4.0), $MachinePrecision], N[(1.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  z_m = \left|z\right|
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x \leq 2.6 \cdot 10^{+53}:\\
                  \;\;\;\;\left(t \cdot y\right) \cdot 4\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;1 \cdot \left(x \cdot x\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < 2.59999999999999998e53

                    1. Initial program 90.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. *-commutativeN/A

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

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

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

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

                    if 2.59999999999999998e53 < x

                    1. Initial program 81.4%

                      \[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} \cdot \left(1 + -4 \cdot \frac{y \cdot \left({z}^{2} - t\right)}{{x}^{2}}\right)} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

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

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

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

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

                        \[\leadsto \left(-4 \cdot \frac{\left({z}^{2} - t\right) \cdot y}{\color{blue}{x \cdot x}} + 1\right) \cdot {x}^{2} \]
                      6. times-fracN/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(-4 \cdot \frac{z \cdot z - t}{x}, \frac{y}{x}, 1\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
                      16. lower-*.f6488.3

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

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

                      \[\leadsto 1 \cdot \left(\color{blue}{x} \cdot x\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites75.2%

                        \[\leadsto 1 \cdot \left(\color{blue}{x} \cdot x\right) \]
                    8. Recombined 2 regimes into one program.
                    9. Add Preprocessing

                    Alternative 8: 40.4% accurate, 2.5× speedup?

                    \[\begin{array}{l} z_m = \left|z\right| \\ 1 \cdot \left(x \cdot x\right) \end{array} \]
                    z_m = (fabs.f64 z)
                    (FPCore (x y z_m t) :precision binary64 (* 1.0 (* x x)))
                    z_m = fabs(z);
                    double code(double x, double y, double z_m, double t) {
                    	return 1.0 * (x * x);
                    }
                    
                    z_m =     private
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z_m, t)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z_m
                        real(8), intent (in) :: t
                        code = 1.0d0 * (x * x)
                    end function
                    
                    z_m = Math.abs(z);
                    public static double code(double x, double y, double z_m, double t) {
                    	return 1.0 * (x * x);
                    }
                    
                    z_m = math.fabs(z)
                    def code(x, y, z_m, t):
                    	return 1.0 * (x * x)
                    
                    z_m = abs(z)
                    function code(x, y, z_m, t)
                    	return Float64(1.0 * Float64(x * x))
                    end
                    
                    z_m = abs(z);
                    function tmp = code(x, y, z_m, t)
                    	tmp = 1.0 * (x * x);
                    end
                    
                    z_m = N[Abs[z], $MachinePrecision]
                    code[x_, y_, z$95$m_, t_] := N[(1.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    z_m = \left|z\right|
                    
                    \\
                    1 \cdot \left(x \cdot x\right)
                    \end{array}
                    
                    Derivation
                    1. Initial program 89.3%

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

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

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

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

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

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

                        \[\leadsto \left(-4 \cdot \frac{\left({z}^{2} - t\right) \cdot y}{\color{blue}{x \cdot x}} + 1\right) \cdot {x}^{2} \]
                      6. times-fracN/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(-4 \cdot \frac{z \cdot z - t}{x}, \frac{y}{x}, 1\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
                      16. lower-*.f6464.5

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

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

                      \[\leadsto 1 \cdot \left(\color{blue}{x} \cdot x\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites39.6%

                        \[\leadsto 1 \cdot \left(\color{blue}{x} \cdot x\right) \]
                      2. Add Preprocessing

                      Alternative 9: 5.9% accurate, 2.5× speedup?

                      \[\begin{array}{l} z_m = \left|z\right| \\ \left(y \cdot t\right) \cdot -4 \end{array} \]
                      z_m = (fabs.f64 z)
                      (FPCore (x y z_m t) :precision binary64 (* (* y t) -4.0))
                      z_m = fabs(z);
                      double code(double x, double y, double z_m, double t) {
                      	return (y * t) * -4.0;
                      }
                      
                      z_m =     private
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z_m, t)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z_m
                          real(8), intent (in) :: t
                          code = (y * t) * (-4.0d0)
                      end function
                      
                      z_m = Math.abs(z);
                      public static double code(double x, double y, double z_m, double t) {
                      	return (y * t) * -4.0;
                      }
                      
                      z_m = math.fabs(z)
                      def code(x, y, z_m, t):
                      	return (y * t) * -4.0
                      
                      z_m = abs(z)
                      function code(x, y, z_m, t)
                      	return Float64(Float64(y * t) * -4.0)
                      end
                      
                      z_m = abs(z);
                      function tmp = code(x, y, z_m, t)
                      	tmp = (y * t) * -4.0;
                      end
                      
                      z_m = N[Abs[z], $MachinePrecision]
                      code[x_, y_, z$95$m_, t_] := N[(N[(y * t), $MachinePrecision] * -4.0), $MachinePrecision]
                      
                      \begin{array}{l}
                      z_m = \left|z\right|
                      
                      \\
                      \left(y \cdot t\right) \cdot -4
                      \end{array}
                      
                      Derivation
                      1. Initial program 89.3%

                        \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                      2. Add Preprocessing
                      3. Applied rewrites36.0%

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot -4} \]
                      7. Add Preprocessing

                      Developer Target 1: 90.6% 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)));
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, t)
                      use fmin_fmax_functions
                          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 2024352 
                      (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))))