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

Percentage Accurate: 90.8% → 97.7%
Time: 5.3s
Alternatives: 11
Speedup: 0.8×

Specification

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

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

Initial Program: 90.8% 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: 97.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999964e-6 < x

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \frac{z \cdot z - t}{x \cdot x}, 1\right) \cdot x\right) \cdot x \]
      3. lift-*.f64N/A

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

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \frac{z \cdot z - t}{x \cdot x}, 1\right) \cdot x\right) \cdot x \]
      5. pow2N/A

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \frac{{z}^{2} - t}{x \cdot x}, 1\right) \cdot x\right) \cdot x \]
      6. negate-subN/A

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

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \frac{{z}^{2} + \left(\mathsf{neg}\left(t\right)\right)}{{x}^{2}}, 1\right) \cdot x\right) \cdot x \]
      8. div-add-revN/A

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \frac{{z}^{2}}{{x}^{2}} + \frac{\mathsf{neg}\left(t\right)}{{x}^{2}}, 1\right) \cdot x\right) \cdot x \]
      9. mul-1-negN/A

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \frac{z \cdot z}{x \cdot x} + -1 \cdot \frac{t}{{x}^{2}}, 1\right) \cdot x\right) \cdot x \]
      13. times-fracN/A

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \mathsf{fma}\left(\frac{z}{x}, \frac{z}{x}, \frac{-1 \cdot t}{{x}^{2}}\right), 1\right) \cdot x\right) \cdot x \]
      18. mul-1-negN/A

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \mathsf{fma}\left(\frac{z}{x}, \frac{z}{x}, \frac{-t}{x \cdot x}\right), 1\right) \cdot x\right) \cdot x \]
      22. lift-*.f6498.1

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

      \[\leadsto \left(\mathsf{fma}\left(-4 \cdot y, \mathsf{fma}\left(\frac{z}{x}, \frac{z}{x}, \frac{-t}{x \cdot x}\right), 1\right) \cdot x\right) \cdot x \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 96.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.0999999999999999e-69

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot x - \mathsf{fma}\left(\left(4 \cdot y\right) \cdot z, z, \left(4 \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(t\right)\right)}\right) \]
      18. lower-neg.f6496.9

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

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

    if 4.0999999999999999e-69 < y

    1. Initial program 89.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. pow2N/A

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

Alternative 3: 94.2% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

    if 1.2e175 < z

    1. Initial program 73.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-*.f6479.6

        \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
    4. Applied rewrites79.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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 4: 78.9% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 1.5e19

    1. Initial program 93.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. pow2N/A

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

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

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

      if 1.5e19 < z < 1.2e175

      1. Initial program 89.8%

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

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

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

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

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

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

          \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.2e175 < z

      1. Initial program 73.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-*.f6479.6

          \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
      4. Applied rewrites79.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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
        5. lower-*.f64N/A

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

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

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

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

    Alternative 5: 78.7% accurate, 0.8× speedup?

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

      1. Initial program 93.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. pow2N/A

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

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

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

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

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

          \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

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

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

        if 1.5e19 < z < 1.18000000000000005e151

        1. Initial program 95.7%

          \[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-*.f6483.0

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

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

        if 1.18000000000000005e151 < z

        1. Initial program 71.4%

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

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

          \[\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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
          5. lower-*.f64N/A

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

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

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

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

      Alternative 6: 77.0% accurate, 0.9× speedup?

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

        1. Initial program 93.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. pow2N/A

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

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

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

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

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

            \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

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

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

          if 5.5e14 < z < 1.2e175

          1. Initial program 90.0%

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

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

              \[\leadsto -4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right) \]
            2. associate-*r*N/A

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

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

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

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

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

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

              \[\leadsto \left(\mathsf{neg}\left(\left({z}^{2} - t\right)\right)\right) \cdot \left(4 \cdot y\right) \]
            9. negate-sub2N/A

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

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

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

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

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

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

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

          if 1.2e175 < z

          1. Initial program 73.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-*.f6479.6

              \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
          4. Applied rewrites79.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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
            5. lower-*.f64N/A

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

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

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

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

        Alternative 7: 76.9% accurate, 1.2× speedup?

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

          1. Initial program 93.5%

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

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

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

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

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

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

              \[\leadsto \color{blue}{x \cdot x} + -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. pow2N/A

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

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

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

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

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

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

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

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

            if 4.2e46 < z

            1. Initial program 80.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-*.f6470.8

                \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
            4. Applied rewrites70.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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
              5. lower-*.f64N/A

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

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

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

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

          Alternative 8: 76.4% accurate, 1.2× speedup?

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

            1. Initial program 93.5%

              \[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-*.f6475.8

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

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

            if 4.2e46 < z

            1. Initial program 80.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-*.f6470.8

                \[\leadsto \left(\left(z \cdot z\right) \cdot y\right) \cdot -4 \]
            4. Applied rewrites70.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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
              5. lower-*.f64N/A

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

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

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

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

          Alternative 9: 59.6% accurate, 1.0× speedup?

          \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;z \leq 7.8 \cdot 10^{-180}:\\ \;\;\;\;\left(t \cdot y\right) \cdot 4\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+14}:\\ \;\;\;\;x\_m \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\ \end{array} \end{array} \]
          x_m = (fabs.f64 x)
          (FPCore (x_m y z t)
           :precision binary64
           (if (<= z 7.8e-180)
             (* (* t y) 4.0)
             (if (<= z 5.3e+14) (* x_m x_m) (* (* z (* z y)) -4.0))))
          x_m = fabs(x);
          double code(double x_m, double y, double z, double t) {
          	double tmp;
          	if (z <= 7.8e-180) {
          		tmp = (t * y) * 4.0;
          	} else if (z <= 5.3e+14) {
          		tmp = x_m * x_m;
          	} else {
          		tmp = (z * (z * y)) * -4.0;
          	}
          	return tmp;
          }
          
          x_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_m, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x_m
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (z <= 7.8d-180) then
                  tmp = (t * y) * 4.0d0
              else if (z <= 5.3d+14) then
                  tmp = x_m * x_m
              else
                  tmp = (z * (z * y)) * (-4.0d0)
              end if
              code = tmp
          end function
          
          x_m = Math.abs(x);
          public static double code(double x_m, double y, double z, double t) {
          	double tmp;
          	if (z <= 7.8e-180) {
          		tmp = (t * y) * 4.0;
          	} else if (z <= 5.3e+14) {
          		tmp = x_m * x_m;
          	} else {
          		tmp = (z * (z * y)) * -4.0;
          	}
          	return tmp;
          }
          
          x_m = math.fabs(x)
          def code(x_m, y, z, t):
          	tmp = 0
          	if z <= 7.8e-180:
          		tmp = (t * y) * 4.0
          	elif z <= 5.3e+14:
          		tmp = x_m * x_m
          	else:
          		tmp = (z * (z * y)) * -4.0
          	return tmp
          
          x_m = abs(x)
          function code(x_m, y, z, t)
          	tmp = 0.0
          	if (z <= 7.8e-180)
          		tmp = Float64(Float64(t * y) * 4.0);
          	elseif (z <= 5.3e+14)
          		tmp = Float64(x_m * x_m);
          	else
          		tmp = Float64(Float64(z * Float64(z * y)) * -4.0);
          	end
          	return tmp
          end
          
          x_m = abs(x);
          function tmp_2 = code(x_m, y, z, t)
          	tmp = 0.0;
          	if (z <= 7.8e-180)
          		tmp = (t * y) * 4.0;
          	elseif (z <= 5.3e+14)
          		tmp = x_m * x_m;
          	else
          		tmp = (z * (z * y)) * -4.0;
          	end
          	tmp_2 = tmp;
          end
          
          x_m = N[Abs[x], $MachinePrecision]
          code[x$95$m_, y_, z_, t_] := If[LessEqual[z, 7.8e-180], N[(N[(t * y), $MachinePrecision] * 4.0), $MachinePrecision], If[LessEqual[z, 5.3e+14], N[(x$95$m * x$95$m), $MachinePrecision], N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]
          
          \begin{array}{l}
          x_m = \left|x\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq 7.8 \cdot 10^{-180}:\\
          \;\;\;\;\left(t \cdot y\right) \cdot 4\\
          
          \mathbf{elif}\;z \leq 5.3 \cdot 10^{+14}:\\
          \;\;\;\;x\_m \cdot x\_m\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < 7.8000000000000005e-180

            1. Initial program 92.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-*.f6435.8

                \[\leadsto \left(t \cdot y\right) \cdot 4 \]
            4. Applied rewrites35.8%

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

            if 7.8000000000000005e-180 < z < 5.3e14

            1. Initial program 98.6%

              \[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-*.f6450.4

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

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

            if 5.3e14 < z

            1. Initial program 82.6%

              \[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-*.f6466.4

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

              \[\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(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
              5. lower-*.f64N/A

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

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

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

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

          Alternative 10: 47.3% accurate, 1.7× speedup?

          \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \leq 2 \cdot 10^{-6}:\\ \;\;\;\;\left(t \cdot y\right) \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot x\_m\\ \end{array} \end{array} \]
          x_m = (fabs.f64 x)
          (FPCore (x_m y z t)
           :precision binary64
           (if (<= x_m 2e-6) (* (* t y) 4.0) (* x_m x_m)))
          x_m = fabs(x);
          double code(double x_m, double y, double z, double t) {
          	double tmp;
          	if (x_m <= 2e-6) {
          		tmp = (t * y) * 4.0;
          	} else {
          		tmp = x_m * x_m;
          	}
          	return tmp;
          }
          
          x_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_m, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x_m
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (x_m <= 2d-6) then
                  tmp = (t * y) * 4.0d0
              else
                  tmp = x_m * x_m
              end if
              code = tmp
          end function
          
          x_m = Math.abs(x);
          public static double code(double x_m, double y, double z, double t) {
          	double tmp;
          	if (x_m <= 2e-6) {
          		tmp = (t * y) * 4.0;
          	} else {
          		tmp = x_m * x_m;
          	}
          	return tmp;
          }
          
          x_m = math.fabs(x)
          def code(x_m, y, z, t):
          	tmp = 0
          	if x_m <= 2e-6:
          		tmp = (t * y) * 4.0
          	else:
          		tmp = x_m * x_m
          	return tmp
          
          x_m = abs(x)
          function code(x_m, y, z, t)
          	tmp = 0.0
          	if (x_m <= 2e-6)
          		tmp = Float64(Float64(t * y) * 4.0);
          	else
          		tmp = Float64(x_m * x_m);
          	end
          	return tmp
          end
          
          x_m = abs(x);
          function tmp_2 = code(x_m, y, z, t)
          	tmp = 0.0;
          	if (x_m <= 2e-6)
          		tmp = (t * y) * 4.0;
          	else
          		tmp = x_m * x_m;
          	end
          	tmp_2 = tmp;
          end
          
          x_m = N[Abs[x], $MachinePrecision]
          code[x$95$m_, y_, z_, t_] := If[LessEqual[x$95$m, 2e-6], N[(N[(t * y), $MachinePrecision] * 4.0), $MachinePrecision], N[(x$95$m * x$95$m), $MachinePrecision]]
          
          \begin{array}{l}
          x_m = \left|x\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x\_m \leq 2 \cdot 10^{-6}:\\
          \;\;\;\;\left(t \cdot y\right) \cdot 4\\
          
          \mathbf{else}:\\
          \;\;\;\;x\_m \cdot x\_m\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 1.99999999999999991e-6

            1. Initial program 94.1%

              \[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-*.f6449.2

                \[\leadsto \left(t \cdot y\right) \cdot 4 \]
            4. Applied rewrites49.2%

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

            if 1.99999999999999991e-6 < x

            1. Initial program 87.6%

              \[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-*.f6469.6

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

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

          Alternative 11: 41.2% accurate, 4.6× speedup?

          \[\begin{array}{l} x_m = \left|x\right| \\ x\_m \cdot x\_m \end{array} \]
          x_m = (fabs.f64 x)
          (FPCore (x_m y z t) :precision binary64 (* x_m x_m))
          x_m = fabs(x);
          double code(double x_m, double y, double z, double t) {
          	return x_m * x_m;
          }
          
          x_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_m, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x_m
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              code = x_m * x_m
          end function
          
          x_m = Math.abs(x);
          public static double code(double x_m, double y, double z, double t) {
          	return x_m * x_m;
          }
          
          x_m = math.fabs(x)
          def code(x_m, y, z, t):
          	return x_m * x_m
          
          x_m = abs(x)
          function code(x_m, y, z, t)
          	return Float64(x_m * x_m)
          end
          
          x_m = abs(x);
          function tmp = code(x_m, y, z, t)
          	tmp = x_m * x_m;
          end
          
          x_m = N[Abs[x], $MachinePrecision]
          code[x$95$m_, y_, z_, t_] := N[(x$95$m * x$95$m), $MachinePrecision]
          
          \begin{array}{l}
          x_m = \left|x\right|
          
          \\
          x\_m \cdot x\_m
          \end{array}
          
          Derivation
          1. Initial program 90.8%

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

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

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

          Reproduce

          ?
          herbie shell --seed 2025110 
          (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))))