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

Percentage Accurate: 90.7% → 96.2%
Time: 3.3s
Alternatives: 10
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));
}
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}

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 10 alternatives:

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

Initial Program: 90.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
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.2% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 3.4 \cdot 10^{+148}:\\ \;\;\;\;\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 3.4e+148)
   (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 <= 3.4e+148) {
		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 <= 3.4e+148)
		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, 3.4e+148], 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 3.4 \cdot 10^{+148}:\\
\;\;\;\;\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 < 3.4000000000000003e148

    1. Initial program 97.6%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4000000000000003e148 < z

    1. Initial program 71.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6476.0

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites76.0%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6487.6

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites87.6%

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

Alternative 2: 92.6% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right)\\ \mathbf{elif}\;z\_m \leq 3 \cdot 10^{+124}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(-4 \cdot y\right) \cdot \left(z\_m \cdot z\_m\right)\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 2.3e-33)
   (fma (- t) (* -4.0 y) (* x x))
   (if (<= z_m 3e+124)
     (fma x x (* (* -4.0 y) (* z_m z_m)))
     (* (* (* 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 <= 2.3e-33) {
		tmp = fma(-t, (-4.0 * y), (x * x));
	} else if (z_m <= 3e+124) {
		tmp = fma(x, x, ((-4.0 * y) * (z_m * z_m)));
	} 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 <= 2.3e-33)
		tmp = fma(Float64(-t), Float64(-4.0 * y), Float64(x * x));
	elseif (z_m <= 3e+124)
		tmp = fma(x, x, Float64(Float64(-4.0 * y) * Float64(z_m * z_m)));
	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, 2.3e-33], N[((-t) * N[(-4.0 * y), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 3e+124], N[(x * x + N[(N[(-4.0 * y), $MachinePrecision] * N[(z$95$m * z$95$m), $MachinePrecision]), $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 2.3 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right)\\

\mathbf{elif}\;z\_m \leq 3 \cdot 10^{+124}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(-4 \cdot y\right) \cdot \left(z\_m \cdot z\_m\right)\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 < 2.29999999999999986e-33

    1. Initial program 98.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(t\right), -4 \cdot y, x \cdot x\right) \]
      2. lower-neg.f6496.6

        \[\leadsto \mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right) \]
    6. Applied rewrites96.6%

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

    if 2.29999999999999986e-33 < z < 3e124

    1. Initial program 96.6%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e124 < z

    1. Initial program 74.2%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6475.7

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites75.7%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6485.9

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites85.9%

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

Alternative 3: 88.7% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right)\\ \mathbf{elif}\;z\_m \leq 1.95 \cdot 10^{+123}:\\ \;\;\;\;\mathsf{fma}\left(\left(z\_m \cdot z\_m\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 2.3e-33)
   (fma (- t) (* -4.0 y) (* x x))
   (if (<= z_m 1.95e+123)
     (fma (* (* z_m z_m) 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 <= 2.3e-33) {
		tmp = fma(-t, (-4.0 * y), (x * x));
	} else if (z_m <= 1.95e+123) {
		tmp = fma(((z_m * z_m) * 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 <= 2.3e-33)
		tmp = fma(Float64(-t), Float64(-4.0 * y), Float64(x * x));
	elseif (z_m <= 1.95e+123)
		tmp = fma(Float64(Float64(z_m * z_m) * 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, 2.3e-33], N[((-t) * N[(-4.0 * y), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 1.95e+123], N[(N[(N[(z$95$m * z$95$m), $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 2.3 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right)\\

\mathbf{elif}\;z\_m \leq 1.95 \cdot 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(\left(z\_m \cdot z\_m\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 3 regimes
  2. if z < 2.29999999999999986e-33

    1. Initial program 98.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(t\right), -4 \cdot y, x \cdot x\right) \]
      2. lower-neg.f6496.6

        \[\leadsto \mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right) \]
    6. Applied rewrites96.6%

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

    if 2.29999999999999986e-33 < z < 1.94999999999999996e123

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(z \cdot z\right) \cdot y, -4, x \cdot x\right) \]
      11. lift-*.f6477.0

        \[\leadsto \mathsf{fma}\left(\left(z \cdot z\right) \cdot y, -4, x \cdot x\right) \]
    4. Applied rewrites77.0%

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

    if 1.94999999999999996e123 < z

    1. Initial program 74.3%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6475.6

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites75.6%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6485.7

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites85.7%

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

Alternative 4: 88.4% accurate, 0.7× 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 \infty:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(-4 \cdot y\right) \cdot t\_1\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 INFINITY)
     (fma x x (* (* -4.0 y) t_1))
     (* (* (* 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 <= ((double) INFINITY)) {
		tmp = fma(x, x, ((-4.0 * y) * t_1));
	} 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 <= Inf)
		tmp = fma(x, x, Float64(Float64(-4.0 * y) * t_1));
	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_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(x * x + N[(N[(-4.0 * y), $MachinePrecision] * t$95$1), $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 \infty:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(-4 \cdot y\right) \cdot t\_1\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 (-.f64 (*.f64 z z) t) < +inf.0

    1. Initial program 90.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6436.8

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites36.8%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6439.9

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites39.9%

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

Alternative 5: 85.6% accurate, 0.9× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(-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 z_m) 1e+134)
   (fma (- 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 * z_m) <= 1e+134) {
		tmp = fma(-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 (Float64(z_m * z_m) <= 1e+134)
		tmp = fma(Float64(-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[N[(z$95$m * z$95$m), $MachinePrecision], 1e+134], N[((-t) * 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 \cdot z\_m \leq 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(-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 (*.f64 z z) < 9.99999999999999921e133

    1. Initial program 98.2%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(t\right), -4 \cdot y, x \cdot x\right) \]
      2. lower-neg.f6489.7

        \[\leadsto \mathsf{fma}\left(-t, -4 \cdot y, x \cdot x\right) \]
    6. Applied rewrites89.7%

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

    if 9.99999999999999921e133 < (*.f64 z z)

    1. Initial program 79.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6471.5

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites71.5%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6479.2

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites79.2%

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

Alternative 6: 85.0% accurate, 1.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \cdot z\_m \leq 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(t \cdot y\right) \cdot 4\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 z_m) 1e+134)
   (fma x x (* (* 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 * z_m) <= 1e+134) {
		tmp = fma(x, x, ((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 (Float64(z_m * z_m) <= 1e+134)
		tmp = fma(x, x, Float64(Float64(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[N[(z$95$m * z$95$m), $MachinePrecision], 1e+134], N[(x * x + N[(N[(t * y), $MachinePrecision] * 4.0), $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 \cdot z\_m \leq 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(t \cdot y\right) \cdot 4\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 (*.f64 z z) < 9.99999999999999921e133

    1. Initial program 98.2%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. 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. lift--.f64N/A

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

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

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

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

        \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z - t\right)} \]
      7. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, x, \left(-4 \cdot y\right) \cdot \color{blue}{\left(z \cdot z - t\right)}\right) \]
      20. lift-*.f6498.6

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

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

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

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

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

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

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

    if 9.99999999999999921e133 < (*.f64 z z)

    1. Initial program 79.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6471.5

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites71.5%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6479.2

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites79.2%

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

Alternative 7: 84.9% accurate, 1.2× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;z\_m \leq 9.8 \cdot 10^{+67}:\\ \;\;\;\;\mathsf{fma}\left(t \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.8e+67) (fma (* 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.8e+67) {
		tmp = fma((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.8e+67)
		tmp = fma(Float64(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.8e+67], N[(N[(t * 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.8 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(t \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.7999999999999998e67

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot y, 4, x \cdot x\right) \]
      8. lift-*.f6488.4

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

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

    if 9.7999999999999998e67 < z

    1. Initial program 79.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6471.7

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites71.7%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6479.5

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites79.5%

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

Alternative 8: 61.8% accurate, 0.7× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} t_1 := \left(4 \cdot y\right) \cdot t\\ \mathbf{if}\;z\_m \leq 4.4 \cdot 10^{-299}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z\_m \leq 1.3 \cdot 10^{-250}:\\ \;\;\;\;x \cdot x\\ \mathbf{elif}\;z\_m \leq 3.3 \cdot 10^{-197}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z\_m \leq 2.8 \cdot 10^{+39}:\\ \;\;\;\;x \cdot x\\ \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 (* (* 4.0 y) t)))
   (if (<= z_m 4.4e-299)
     t_1
     (if (<= z_m 1.3e-250)
       (* x x)
       (if (<= z_m 3.3e-197)
         t_1
         (if (<= z_m 2.8e+39) (* 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 = (4.0 * y) * t;
	double tmp;
	if (z_m <= 4.4e-299) {
		tmp = t_1;
	} else if (z_m <= 1.3e-250) {
		tmp = x * x;
	} else if (z_m <= 3.3e-197) {
		tmp = t_1;
	} else if (z_m <= 2.8e+39) {
		tmp = 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 = (4.0d0 * y) * t
    if (z_m <= 4.4d-299) then
        tmp = t_1
    else if (z_m <= 1.3d-250) then
        tmp = x * x
    else if (z_m <= 3.3d-197) then
        tmp = t_1
    else if (z_m <= 2.8d+39) then
        tmp = 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 = (4.0 * y) * t;
	double tmp;
	if (z_m <= 4.4e-299) {
		tmp = t_1;
	} else if (z_m <= 1.3e-250) {
		tmp = x * x;
	} else if (z_m <= 3.3e-197) {
		tmp = t_1;
	} else if (z_m <= 2.8e+39) {
		tmp = 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 = (4.0 * y) * t
	tmp = 0
	if z_m <= 4.4e-299:
		tmp = t_1
	elif z_m <= 1.3e-250:
		tmp = x * x
	elif z_m <= 3.3e-197:
		tmp = t_1
	elif z_m <= 2.8e+39:
		tmp = 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(4.0 * y) * t)
	tmp = 0.0
	if (z_m <= 4.4e-299)
		tmp = t_1;
	elseif (z_m <= 1.3e-250)
		tmp = Float64(x * x);
	elseif (z_m <= 3.3e-197)
		tmp = t_1;
	elseif (z_m <= 2.8e+39)
		tmp = 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 = (4.0 * y) * t;
	tmp = 0.0;
	if (z_m <= 4.4e-299)
		tmp = t_1;
	elseif (z_m <= 1.3e-250)
		tmp = x * x;
	elseif (z_m <= 3.3e-197)
		tmp = t_1;
	elseif (z_m <= 2.8e+39)
		tmp = 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[(4.0 * y), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z$95$m, 4.4e-299], t$95$1, If[LessEqual[z$95$m, 1.3e-250], N[(x * x), $MachinePrecision], If[LessEqual[z$95$m, 3.3e-197], t$95$1, If[LessEqual[z$95$m, 2.8e+39], N[(x * x), $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 := \left(4 \cdot y\right) \cdot t\\
\mathbf{if}\;z\_m \leq 4.4 \cdot 10^{-299}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z\_m \leq 1.3 \cdot 10^{-250}:\\
\;\;\;\;x \cdot x\\

\mathbf{elif}\;z\_m \leq 3.3 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z\_m \leq 2.8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot x\\

\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 < 4.3999999999999999e-299 or 1.30000000000000004e-250 < z < 3.2999999999999997e-197

    1. Initial program 99.0%

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

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot 4 \]
    4. Applied rewrites50.3%

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

        \[\leadsto \left(t \cdot y\right) \cdot 4 \]
      2. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(4 \cdot y\right) \cdot t \]
    6. Applied rewrites50.3%

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

    if 4.3999999999999999e-299 < z < 1.30000000000000004e-250 or 3.2999999999999997e-197 < z < 2.80000000000000001e39

    1. Initial program 98.1%

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

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

        \[\leadsto x \cdot \color{blue}{x} \]
      2. lift-*.f6451.4

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

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

    if 2.80000000000000001e39 < z

    1. Initial program 80.9%

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      6. lift-*.f6468.6

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites68.6%

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

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
      6. lower-*.f6475.6

        \[\leadsto \left(\left(z \cdot y\right) \cdot z\right) \cdot -4 \]
    6. Applied rewrites75.6%

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

Alternative 9: 45.6% accurate, 1.7× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ \begin{array}{l} \mathbf{if}\;x \leq 1.5 \cdot 10^{-32}:\\ \;\;\;\;\left(4 \cdot y\right) \cdot t\\ \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.5e-32) (* (* 4.0 y) t) (* x x)))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
	double tmp;
	if (x <= 1.5e-32) {
		tmp = (4.0 * y) * t;
	} else {
		tmp = 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 <= 1.5d-32) then
        tmp = (4.0d0 * y) * t
    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.5e-32) {
		tmp = (4.0 * y) * t;
	} else {
		tmp = x * x;
	}
	return tmp;
}
z_m = math.fabs(z)
def code(x, y, z_m, t):
	tmp = 0
	if x <= 1.5e-32:
		tmp = (4.0 * y) * t
	else:
		tmp = x * x
	return tmp
z_m = abs(z)
function code(x, y, z_m, t)
	tmp = 0.0
	if (x <= 1.5e-32)
		tmp = Float64(Float64(4.0 * y) * t);
	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.5e-32)
		tmp = (4.0 * y) * t;
	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.5e-32], N[(N[(4.0 * y), $MachinePrecision] * t), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.5e-32

    1. Initial program 91.6%

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

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot 4 \]
    4. Applied rewrites37.0%

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

        \[\leadsto \left(t \cdot y\right) \cdot 4 \]
      2. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(4 \cdot y\right) \cdot t \]
    6. Applied rewrites37.0%

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

    if 1.5e-32 < x

    1. Initial program 88.4%

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

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

        \[\leadsto x \cdot \color{blue}{x} \]
      2. lift-*.f6467.8

        \[\leadsto x \cdot \color{blue}{x} \]
    4. Applied rewrites67.8%

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

Alternative 10: 41.9% accurate, 4.6× 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 =     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 = x * x
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
	return x * x;
}
z_m = math.fabs(z)
def code(x, y, z_m, t):
	return x * x
z_m = abs(z)
function code(x, y, z_m, t)
	return Float64(x * x)
end
z_m = abs(z);
function tmp = code(x, y, z_m, t)
	tmp = x * x;
end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := N[(x * x), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|

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

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

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

      \[\leadsto x \cdot \color{blue}{x} \]
    2. lift-*.f6441.9

      \[\leadsto x \cdot \color{blue}{x} \]
  4. Applied rewrites41.9%

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

Reproduce

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