Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C

Percentage Accurate: 97.6% → 97.6%
Time: 8.0s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
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, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
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, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}

Alternative 1: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
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, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Derivation
  1. Initial program 97.7%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 62.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ t_2 := -0.25 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+99}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+63}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot z, 0.0625, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (/ (* a b) 4.0)) (t_2 (* -0.25 (* b a))))
   (if (<= t_1 -2e+99)
     t_2
     (if (<= t_1 5e+63)
       (fma y x c)
       (if (<= t_1 5e+154) (fma (* t z) 0.0625 c) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double t_2 = -0.25 * (b * a);
	double tmp;
	if (t_1 <= -2e+99) {
		tmp = t_2;
	} else if (t_1 <= 5e+63) {
		tmp = fma(y, x, c);
	} else if (t_1 <= 5e+154) {
		tmp = fma((t * z), 0.0625, c);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) / 4.0)
	t_2 = Float64(-0.25 * Float64(b * a))
	tmp = 0.0
	if (t_1 <= -2e+99)
		tmp = t_2;
	elseif (t_1 <= 5e+63)
		tmp = fma(y, x, c);
	elseif (t_1 <= 5e+154)
		tmp = fma(Float64(t * z), 0.0625, c);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+99], t$95$2, If[LessEqual[t$95$1, 5e+63], N[(y * x + c), $MachinePrecision], If[LessEqual[t$95$1, 5e+154], N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
t_2 := -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, 0.0625, c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 a b) #s(literal 4 binary64)) < -1.9999999999999999e99 or 5.00000000000000004e154 < (/.f64 (*.f64 a b) #s(literal 4 binary64))

    1. Initial program 96.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites68.9%

        \[\leadsto \color{blue}{-0.25 \cdot \left(b \cdot a\right)} \]

      if -1.9999999999999999e99 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 5.00000000000000011e63

      1. Initial program 98.1%

        \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. Applied rewrites76.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
        2. Taylor expanded in a around 0

          \[\leadsto c + \color{blue}{x \cdot y} \]
        3. Step-by-step derivation
          1. Applied rewrites68.0%

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

          if 5.00000000000000011e63 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 5.00000000000000004e154

          1. Initial program 100.0%

            \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites87.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)} \]
            2. Taylor expanded in a around 0

              \[\leadsto c + \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
            3. Step-by-step derivation
              1. Applied rewrites70.4%

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

            Alternative 3: 61.4% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ t_2 := -0.25 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+99}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+77}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+150}:\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            (FPCore (x y z t a b c)
             :precision binary64
             (let* ((t_1 (/ (* a b) 4.0)) (t_2 (* -0.25 (* b a))))
               (if (<= t_1 -2e+99)
                 t_2
                 (if (<= t_1 2e+77)
                   (fma y x c)
                   (if (<= t_1 5e+150) (* (* 0.0625 z) t) t_2)))))
            double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = (a * b) / 4.0;
            	double t_2 = -0.25 * (b * a);
            	double tmp;
            	if (t_1 <= -2e+99) {
            		tmp = t_2;
            	} else if (t_1 <= 2e+77) {
            		tmp = fma(y, x, c);
            	} else if (t_1 <= 5e+150) {
            		tmp = (0.0625 * z) * t;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b, c)
            	t_1 = Float64(Float64(a * b) / 4.0)
            	t_2 = Float64(-0.25 * Float64(b * a))
            	tmp = 0.0
            	if (t_1 <= -2e+99)
            		tmp = t_2;
            	elseif (t_1 <= 2e+77)
            		tmp = fma(y, x, c);
            	elseif (t_1 <= 5e+150)
            		tmp = Float64(Float64(0.0625 * z) * t);
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+99], t$95$2, If[LessEqual[t$95$1, 2e+77], N[(y * x + c), $MachinePrecision], If[LessEqual[t$95$1, 5e+150], N[(N[(0.0625 * z), $MachinePrecision] * t), $MachinePrecision], t$95$2]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \frac{a \cdot b}{4}\\
            t_2 := -0.25 \cdot \left(b \cdot a\right)\\
            \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+99}:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+77}:\\
            \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
            
            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+150}:\\
            \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (/.f64 (*.f64 a b) #s(literal 4 binary64)) < -1.9999999999999999e99 or 5.00000000000000009e150 < (/.f64 (*.f64 a b) #s(literal 4 binary64))

              1. Initial program 96.5%

                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
              2. Add Preprocessing
              3. Taylor expanded in a around inf

                \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites68.1%

                  \[\leadsto \color{blue}{-0.25 \cdot \left(b \cdot a\right)} \]

                if -1.9999999999999999e99 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 1.99999999999999997e77

                1. Initial program 98.1%

                  \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                4. Step-by-step derivation
                  1. Applied rewrites76.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                  2. Taylor expanded in a around 0

                    \[\leadsto c + \color{blue}{x \cdot y} \]
                  3. Step-by-step derivation
                    1. Applied rewrites68.2%

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

                    if 1.99999999999999997e77 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 5.00000000000000009e150

                    1. Initial program 100.0%

                      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                    2. Add Preprocessing
                    3. Taylor expanded in z around inf

                      \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                    4. Step-by-step derivation
                      1. Applied rewrites65.3%

                        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} \]
                      2. Step-by-step derivation
                        1. Applied rewrites65.3%

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

                      Alternative 4: 89.0% accurate, 0.7× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_1 \leq -100000 \lor \neg \left(t\_1 \leq 5 \cdot 10^{+111}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c)
                       :precision binary64
                       (let* ((t_1 (/ (* z t) 16.0)))
                         (if (or (<= t_1 -100000.0) (not (<= t_1 5e+111)))
                           (fma -0.25 (* b a) (fma (* t z) 0.0625 c))
                           (fma y x (+ c (* (* b a) -0.25))))))
                      double code(double x, double y, double z, double t, double a, double b, double c) {
                      	double t_1 = (z * t) / 16.0;
                      	double tmp;
                      	if ((t_1 <= -100000.0) || !(t_1 <= 5e+111)) {
                      		tmp = fma(-0.25, (b * a), fma((t * z), 0.0625, c));
                      	} else {
                      		tmp = fma(y, x, (c + ((b * a) * -0.25)));
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a, b, c)
                      	t_1 = Float64(Float64(z * t) / 16.0)
                      	tmp = 0.0
                      	if ((t_1 <= -100000.0) || !(t_1 <= 5e+111))
                      		tmp = fma(-0.25, Float64(b * a), fma(Float64(t * z), 0.0625, c));
                      	else
                      		tmp = fma(y, x, Float64(c + Float64(Float64(b * a) * -0.25)));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -100000.0], N[Not[LessEqual[t$95$1, 5e+111]], $MachinePrecision]], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \frac{z \cdot t}{16}\\
                      \mathbf{if}\;t\_1 \leq -100000 \lor \neg \left(t\_1 \leq 5 \cdot 10^{+111}\right):\\
                      \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1e5 or 4.9999999999999997e111 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

                        1. Initial program 94.9%

                          \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                        4. Step-by-step derivation
                          1. Applied rewrites84.8%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)} \]

                          if -1e5 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 4.9999999999999997e111

                          1. Initial program 99.4%

                            \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                          2. Add Preprocessing
                          3. Taylor expanded in z around 0

                            \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                          4. Step-by-step derivation
                            1. Applied rewrites95.6%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                            2. Step-by-step derivation
                              1. Applied rewrites95.6%

                                \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c + \left(b \cdot a\right) \cdot -0.25\right) \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification91.6%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot t}{16} \leq -100000 \lor \neg \left(\frac{z \cdot t}{16} \leq 5 \cdot 10^{+111}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 5: 86.5% accurate, 0.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+135}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \left(t \cdot z\right) \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                            (FPCore (x y z t a b c)
                             :precision binary64
                             (let* ((t_1 (/ (* z t) 16.0)))
                               (if (or (<= t_1 -2e+233) (not (<= t_1 5e+135)))
                                 (fma -0.25 (* b a) (* (* t z) 0.0625))
                                 (fma y x (+ c (* (* b a) -0.25))))))
                            double code(double x, double y, double z, double t, double a, double b, double c) {
                            	double t_1 = (z * t) / 16.0;
                            	double tmp;
                            	if ((t_1 <= -2e+233) || !(t_1 <= 5e+135)) {
                            		tmp = fma(-0.25, (b * a), ((t * z) * 0.0625));
                            	} else {
                            		tmp = fma(y, x, (c + ((b * a) * -0.25)));
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, t, a, b, c)
                            	t_1 = Float64(Float64(z * t) / 16.0)
                            	tmp = 0.0
                            	if ((t_1 <= -2e+233) || !(t_1 <= 5e+135))
                            		tmp = fma(-0.25, Float64(b * a), Float64(Float64(t * z) * 0.0625));
                            	else
                            		tmp = fma(y, x, Float64(c + Float64(Float64(b * a) * -0.25)));
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+233], N[Not[LessEqual[t$95$1, 5e+135]], $MachinePrecision]], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \frac{z \cdot t}{16}\\
                            \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+135}\right):\\
                            \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \left(t \cdot z\right) \cdot 0.0625\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.99999999999999995e233 or 5.00000000000000029e135 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

                              1. Initial program 93.6%

                                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                              2. Add Preprocessing
                              3. Taylor expanded in x around 0

                                \[\leadsto \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                              4. Step-by-step derivation
                                1. Applied rewrites86.0%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)} \]
                                2. Taylor expanded in z around inf

                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, b \cdot a, \frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites86.0%

                                    \[\leadsto \mathsf{fma}\left(-0.25, b \cdot a, \left(t \cdot z\right) \cdot 0.0625\right) \]

                                  if -1.99999999999999995e233 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5.00000000000000029e135

                                  1. Initial program 99.0%

                                    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in z around 0

                                    \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites92.4%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites92.9%

                                        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c + \left(b \cdot a\right) \cdot -0.25\right) \]
                                    3. Recombined 2 regimes into one program.
                                    4. Final simplification91.3%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot t}{16} \leq -2 \cdot 10^{+233} \lor \neg \left(\frac{z \cdot t}{16} \leq 5 \cdot 10^{+135}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \left(t \cdot z\right) \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \]
                                    5. Add Preprocessing

                                    Alternative 6: 85.6% accurate, 0.7× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                                    (FPCore (x y z t a b c)
                                     :precision binary64
                                     (let* ((t_1 (/ (* z t) 16.0)))
                                       (if (or (<= t_1 -2e+233) (not (<= t_1 5e+190)))
                                         (* (* 0.0625 z) t)
                                         (fma y x (+ c (* (* b a) -0.25))))))
                                    double code(double x, double y, double z, double t, double a, double b, double c) {
                                    	double t_1 = (z * t) / 16.0;
                                    	double tmp;
                                    	if ((t_1 <= -2e+233) || !(t_1 <= 5e+190)) {
                                    		tmp = (0.0625 * z) * t;
                                    	} else {
                                    		tmp = fma(y, x, (c + ((b * a) * -0.25)));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, t, a, b, c)
                                    	t_1 = Float64(Float64(z * t) / 16.0)
                                    	tmp = 0.0
                                    	if ((t_1 <= -2e+233) || !(t_1 <= 5e+190))
                                    		tmp = Float64(Float64(0.0625 * z) * t);
                                    	else
                                    		tmp = fma(y, x, Float64(c + Float64(Float64(b * a) * -0.25)));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+233], N[Not[LessEqual[t$95$1, 5e+190]], $MachinePrecision]], N[(N[(0.0625 * z), $MachinePrecision] * t), $MachinePrecision], N[(y * x + N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_1 := \frac{z \cdot t}{16}\\
                                    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\
                                    \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.99999999999999995e233 or 5.00000000000000036e190 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

                                      1. Initial program 92.6%

                                        \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in z around inf

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

                                          \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites83.4%

                                            \[\leadsto \left(0.0625 \cdot z\right) \cdot \color{blue}{t} \]

                                          if -1.99999999999999995e233 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5.00000000000000036e190

                                          1. Initial program 99.0%

                                            \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in z around 0

                                            \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites91.2%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites91.7%

                                                \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c + \left(b \cdot a\right) \cdot -0.25\right) \]
                                            3. Recombined 2 regimes into one program.
                                            4. Final simplification90.0%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot t}{16} \leq -2 \cdot 10^{+233} \lor \neg \left(\frac{z \cdot t}{16} \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \]
                                            5. Add Preprocessing

                                            Alternative 7: 85.3% accurate, 0.8× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b c)
                                             :precision binary64
                                             (let* ((t_1 (/ (* z t) 16.0)))
                                               (if (or (<= t_1 -2e+233) (not (<= t_1 5e+190)))
                                                 (* (* 0.0625 z) t)
                                                 (fma -0.25 (* b a) (fma y x c)))))
                                            double code(double x, double y, double z, double t, double a, double b, double c) {
                                            	double t_1 = (z * t) / 16.0;
                                            	double tmp;
                                            	if ((t_1 <= -2e+233) || !(t_1 <= 5e+190)) {
                                            		tmp = (0.0625 * z) * t;
                                            	} else {
                                            		tmp = fma(-0.25, (b * a), fma(y, x, c));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a, b, c)
                                            	t_1 = Float64(Float64(z * t) / 16.0)
                                            	tmp = 0.0
                                            	if ((t_1 <= -2e+233) || !(t_1 <= 5e+190))
                                            		tmp = Float64(Float64(0.0625 * z) * t);
                                            	else
                                            		tmp = fma(-0.25, Float64(b * a), fma(y, x, c));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+233], N[Not[LessEqual[t$95$1, 5e+190]], $MachinePrecision]], N[(N[(0.0625 * z), $MachinePrecision] * t), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x + c), $MachinePrecision]), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_1 := \frac{z \cdot t}{16}\\
                                            \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\
                                            \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.99999999999999995e233 or 5.00000000000000036e190 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

                                              1. Initial program 92.6%

                                                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in z around inf

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

                                                  \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites83.4%

                                                    \[\leadsto \left(0.0625 \cdot z\right) \cdot \color{blue}{t} \]

                                                  if -1.99999999999999995e233 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5.00000000000000036e190

                                                  1. Initial program 99.0%

                                                    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in z around 0

                                                    \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites91.2%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                  5. Recombined 2 regimes into one program.
                                                  6. Final simplification89.6%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot t}{16} \leq -2 \cdot 10^{+233} \lor \neg \left(\frac{z \cdot t}{16} \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\ \end{array} \]
                                                  7. Add Preprocessing

                                                  Alternative 8: 64.0% accurate, 0.8× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+295} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, -0.25 \cdot \left(a \cdot b\right)\right)\\ \end{array} \end{array} \]
                                                  (FPCore (x y z t a b c)
                                                   :precision binary64
                                                   (let* ((t_1 (/ (* z t) 16.0)))
                                                     (if (or (<= t_1 -1e+295) (not (<= t_1 5e+190)))
                                                       (* (* 0.0625 z) t)
                                                       (fma y x (* -0.25 (* a b))))))
                                                  double code(double x, double y, double z, double t, double a, double b, double c) {
                                                  	double t_1 = (z * t) / 16.0;
                                                  	double tmp;
                                                  	if ((t_1 <= -1e+295) || !(t_1 <= 5e+190)) {
                                                  		tmp = (0.0625 * z) * t;
                                                  	} else {
                                                  		tmp = fma(y, x, (-0.25 * (a * b)));
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(x, y, z, t, a, b, c)
                                                  	t_1 = Float64(Float64(z * t) / 16.0)
                                                  	tmp = 0.0
                                                  	if ((t_1 <= -1e+295) || !(t_1 <= 5e+190))
                                                  		tmp = Float64(Float64(0.0625 * z) * t);
                                                  	else
                                                  		tmp = fma(y, x, Float64(-0.25 * Float64(a * b)));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+295], N[Not[LessEqual[t$95$1, 5e+190]], $MachinePrecision]], N[(N[(0.0625 * z), $MachinePrecision] * t), $MachinePrecision], N[(y * x + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  t_1 := \frac{z \cdot t}{16}\\
                                                  \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+295} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\
                                                  \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(y, x, -0.25 \cdot \left(a \cdot b\right)\right)\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -9.9999999999999998e294 or 5.00000000000000036e190 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

                                                    1. Initial program 91.7%

                                                      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in z around inf

                                                      \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                                                    4. Step-by-step derivation
                                                      1. Applied rewrites85.7%

                                                        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites87.6%

                                                          \[\leadsto \left(0.0625 \cdot z\right) \cdot \color{blue}{t} \]

                                                        if -9.9999999999999998e294 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5.00000000000000036e190

                                                        1. Initial program 99.0%

                                                          \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in z around 0

                                                          \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites90.1%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites90.6%

                                                              \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c + \left(b \cdot a\right) \cdot -0.25\right) \]
                                                            2. Taylor expanded in a around inf

                                                              \[\leadsto \mathsf{fma}\left(y, x, \frac{-1}{4} \cdot \left(a \cdot b\right)\right) \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites70.4%

                                                                \[\leadsto \mathsf{fma}\left(y, x, -0.25 \cdot \left(a \cdot b\right)\right) \]
                                                            4. Recombined 2 regimes into one program.
                                                            5. Final simplification73.4%

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot t}{16} \leq -1 \cdot 10^{+295} \lor \neg \left(\frac{z \cdot t}{16} \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, -0.25 \cdot \left(a \cdot b\right)\right)\\ \end{array} \]
                                                            6. Add Preprocessing

                                                            Alternative 9: 63.6% accurate, 0.8× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+295} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, y \cdot x\right)\\ \end{array} \end{array} \]
                                                            (FPCore (x y z t a b c)
                                                             :precision binary64
                                                             (let* ((t_1 (/ (* z t) 16.0)))
                                                               (if (or (<= t_1 -1e+295) (not (<= t_1 5e+190)))
                                                                 (* (* 0.0625 z) t)
                                                                 (fma -0.25 (* b a) (* y x)))))
                                                            double code(double x, double y, double z, double t, double a, double b, double c) {
                                                            	double t_1 = (z * t) / 16.0;
                                                            	double tmp;
                                                            	if ((t_1 <= -1e+295) || !(t_1 <= 5e+190)) {
                                                            		tmp = (0.0625 * z) * t;
                                                            	} else {
                                                            		tmp = fma(-0.25, (b * a), (y * x));
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            function code(x, y, z, t, a, b, c)
                                                            	t_1 = Float64(Float64(z * t) / 16.0)
                                                            	tmp = 0.0
                                                            	if ((t_1 <= -1e+295) || !(t_1 <= 5e+190))
                                                            		tmp = Float64(Float64(0.0625 * z) * t);
                                                            	else
                                                            		tmp = fma(-0.25, Float64(b * a), Float64(y * x));
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+295], N[Not[LessEqual[t$95$1, 5e+190]], $MachinePrecision]], N[(N[(0.0625 * z), $MachinePrecision] * t), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            t_1 := \frac{z \cdot t}{16}\\
                                                            \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+295} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+190}\right):\\
                                                            \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, y \cdot x\right)\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -9.9999999999999998e294 or 5.00000000000000036e190 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

                                                              1. Initial program 91.7%

                                                                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in z around inf

                                                                \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites85.7%

                                                                  \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites87.6%

                                                                    \[\leadsto \left(0.0625 \cdot z\right) \cdot \color{blue}{t} \]

                                                                  if -9.9999999999999998e294 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5.00000000000000036e190

                                                                  1. Initial program 99.0%

                                                                    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in z around 0

                                                                    \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. Applied rewrites90.1%

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                                    2. Taylor expanded in x around inf

                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, b \cdot a, x \cdot y\right) \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites69.9%

                                                                        \[\leadsto \mathsf{fma}\left(-0.25, b \cdot a, y \cdot x\right) \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Final simplification73.0%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot t}{16} \leq -1 \cdot 10^{+295} \lor \neg \left(\frac{z \cdot t}{16} \leq 5 \cdot 10^{+190}\right):\\ \;\;\;\;\left(0.0625 \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, y \cdot x\right)\\ \end{array} \]
                                                                    6. Add Preprocessing

                                                                    Alternative 10: 62.2% accurate, 0.9× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+99} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+154}\right):\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \end{array} \end{array} \]
                                                                    (FPCore (x y z t a b c)
                                                                     :precision binary64
                                                                     (let* ((t_1 (/ (* a b) 4.0)))
                                                                       (if (or (<= t_1 -2e+99) (not (<= t_1 5e+154)))
                                                                         (* -0.25 (* b a))
                                                                         (fma y x c))))
                                                                    double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                    	double t_1 = (a * b) / 4.0;
                                                                    	double tmp;
                                                                    	if ((t_1 <= -2e+99) || !(t_1 <= 5e+154)) {
                                                                    		tmp = -0.25 * (b * a);
                                                                    	} else {
                                                                    		tmp = fma(y, x, c);
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    function code(x, y, z, t, a, b, c)
                                                                    	t_1 = Float64(Float64(a * b) / 4.0)
                                                                    	tmp = 0.0
                                                                    	if ((t_1 <= -2e+99) || !(t_1 <= 5e+154))
                                                                    		tmp = Float64(-0.25 * Float64(b * a));
                                                                    	else
                                                                    		tmp = fma(y, x, c);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+99], N[Not[LessEqual[t$95$1, 5e+154]], $MachinePrecision]], N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision], N[(y * x + c), $MachinePrecision]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_1 := \frac{a \cdot b}{4}\\
                                                                    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+99} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+154}\right):\\
                                                                    \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if (/.f64 (*.f64 a b) #s(literal 4 binary64)) < -1.9999999999999999e99 or 5.00000000000000004e154 < (/.f64 (*.f64 a b) #s(literal 4 binary64))

                                                                      1. Initial program 96.4%

                                                                        \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in a around inf

                                                                        \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites68.9%

                                                                          \[\leadsto \color{blue}{-0.25 \cdot \left(b \cdot a\right)} \]

                                                                        if -1.9999999999999999e99 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 5.00000000000000004e154

                                                                        1. Initial program 98.3%

                                                                          \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in z around 0

                                                                          \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites73.9%

                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                                          2. Taylor expanded in a around 0

                                                                            \[\leadsto c + \color{blue}{x \cdot y} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites64.4%

                                                                              \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c\right) \]
                                                                          4. Recombined 2 regimes into one program.
                                                                          5. Final simplification65.8%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot b}{4} \leq -2 \cdot 10^{+99} \lor \neg \left(\frac{a \cdot b}{4} \leq 5 \cdot 10^{+154}\right):\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \end{array} \]
                                                                          6. Add Preprocessing

                                                                          Alternative 11: 94.1% accurate, 0.9× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{-53} \lor \neg \left(t \leq 27500000000000\right):\\ \;\;\;\;\mathsf{fma}\left(0.0625, z, \frac{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)}{t}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                                                                          (FPCore (x y z t a b c)
                                                                           :precision binary64
                                                                           (if (or (<= t -1.25e-53) (not (<= t 27500000000000.0)))
                                                                             (* (fma 0.0625 z (/ (fma -0.25 (* b a) (fma y x c)) t)) t)
                                                                             (fma y x (+ c (* (* b a) -0.25)))))
                                                                          double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                          	double tmp;
                                                                          	if ((t <= -1.25e-53) || !(t <= 27500000000000.0)) {
                                                                          		tmp = fma(0.0625, z, (fma(-0.25, (b * a), fma(y, x, c)) / t)) * t;
                                                                          	} else {
                                                                          		tmp = fma(y, x, (c + ((b * a) * -0.25)));
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          function code(x, y, z, t, a, b, c)
                                                                          	tmp = 0.0
                                                                          	if ((t <= -1.25e-53) || !(t <= 27500000000000.0))
                                                                          		tmp = Float64(fma(0.0625, z, Float64(fma(-0.25, Float64(b * a), fma(y, x, c)) / t)) * t);
                                                                          	else
                                                                          		tmp = fma(y, x, Float64(c + Float64(Float64(b * a) * -0.25)));
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.25e-53], N[Not[LessEqual[t, 27500000000000.0]], $MachinePrecision]], N[(N[(0.0625 * z + N[(N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x + c), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(y * x + N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;t \leq -1.25 \cdot 10^{-53} \lor \neg \left(t \leq 27500000000000\right):\\
                                                                          \;\;\;\;\mathsf{fma}\left(0.0625, z, \frac{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)}{t}\right) \cdot t\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 2 regimes
                                                                          2. if t < -1.25e-53 or 2.75e13 < t

                                                                            1. Initial program 96.6%

                                                                              \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in t around inf

                                                                              \[\leadsto \color{blue}{t \cdot \left(\left(\frac{1}{16} \cdot z + \left(\frac{c}{t} + \frac{x \cdot y}{t}\right)\right) - \frac{1}{4} \cdot \frac{a \cdot b}{t}\right)} \]
                                                                            4. Applied rewrites98.5%

                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, z, \frac{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)}{t}\right) \cdot t} \]

                                                                            if -1.25e-53 < t < 2.75e13

                                                                            1. Initial program 99.1%

                                                                              \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in z around 0

                                                                              \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                                            4. Step-by-step derivation
                                                                              1. Applied rewrites95.5%

                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                                              2. Step-by-step derivation
                                                                                1. Applied rewrites96.4%

                                                                                  \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c + \left(b \cdot a\right) \cdot -0.25\right) \]
                                                                              3. Recombined 2 regimes into one program.
                                                                              4. Final simplification97.6%

                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{-53} \lor \neg \left(t \leq 27500000000000\right):\\ \;\;\;\;\mathsf{fma}\left(0.0625, z, \frac{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)}{t}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c + \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \]
                                                                              5. Add Preprocessing

                                                                              Alternative 12: 64.8% accurate, 1.4× speedup?

                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+22} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+105}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\ \end{array} \end{array} \]
                                                                              (FPCore (x y z t a b c)
                                                                               :precision binary64
                                                                               (if (or (<= (* x y) -1e+22) (not (<= (* x y) 5e+105)))
                                                                                 (fma y x c)
                                                                                 (fma -0.25 (* b a) c)))
                                                                              double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                              	double tmp;
                                                                              	if (((x * y) <= -1e+22) || !((x * y) <= 5e+105)) {
                                                                              		tmp = fma(y, x, c);
                                                                              	} else {
                                                                              		tmp = fma(-0.25, (b * a), c);
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              function code(x, y, z, t, a, b, c)
                                                                              	tmp = 0.0
                                                                              	if ((Float64(x * y) <= -1e+22) || !(Float64(x * y) <= 5e+105))
                                                                              		tmp = fma(y, x, c);
                                                                              	else
                                                                              		tmp = fma(-0.25, Float64(b * a), c);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+22], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+105]], $MachinePrecision]], N[(y * x + c), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \begin{array}{l}
                                                                              \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+22} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+105}\right):\\
                                                                              \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 2 regimes
                                                                              2. if (*.f64 x y) < -1e22 or 5.00000000000000046e105 < (*.f64 x y)

                                                                                1. Initial program 95.7%

                                                                                  \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                                2. Add Preprocessing
                                                                                3. Taylor expanded in z around 0

                                                                                  \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites85.9%

                                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                                                  2. Taylor expanded in a around 0

                                                                                    \[\leadsto c + \color{blue}{x \cdot y} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites78.1%

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

                                                                                    if -1e22 < (*.f64 x y) < 5.00000000000000046e105

                                                                                    1. Initial program 99.4%

                                                                                      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                                    2. Add Preprocessing
                                                                                    3. Taylor expanded in z around 0

                                                                                      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. Applied rewrites71.4%

                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                                                      2. Taylor expanded in x around 0

                                                                                        \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, b \cdot a, c\right) \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites65.2%

                                                                                          \[\leadsto \mathsf{fma}\left(-0.25, b \cdot a, c\right) \]
                                                                                      4. Recombined 2 regimes into one program.
                                                                                      5. Final simplification71.1%

                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+22} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+105}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\ \end{array} \]
                                                                                      6. Add Preprocessing

                                                                                      Alternative 13: 41.1% accurate, 1.7× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-18}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \end{array} \]
                                                                                      (FPCore (x y z t a b c)
                                                                                       :precision binary64
                                                                                       (if (or (<= (* x y) -5e+119) (not (<= (* x y) 2e-18))) (* y x) c))
                                                                                      double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                      	double tmp;
                                                                                      	if (((x * y) <= -5e+119) || !((x * y) <= 2e-18)) {
                                                                                      		tmp = y * x;
                                                                                      	} else {
                                                                                      		tmp = c;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      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, a, b, c)
                                                                                      use fmin_fmax_functions
                                                                                          real(8), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          real(8), intent (in) :: z
                                                                                          real(8), intent (in) :: t
                                                                                          real(8), intent (in) :: a
                                                                                          real(8), intent (in) :: b
                                                                                          real(8), intent (in) :: c
                                                                                          real(8) :: tmp
                                                                                          if (((x * y) <= (-5d+119)) .or. (.not. ((x * y) <= 2d-18))) then
                                                                                              tmp = y * x
                                                                                          else
                                                                                              tmp = c
                                                                                          end if
                                                                                          code = tmp
                                                                                      end function
                                                                                      
                                                                                      public static double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                      	double tmp;
                                                                                      	if (((x * y) <= -5e+119) || !((x * y) <= 2e-18)) {
                                                                                      		tmp = y * x;
                                                                                      	} else {
                                                                                      		tmp = c;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(x, y, z, t, a, b, c):
                                                                                      	tmp = 0
                                                                                      	if ((x * y) <= -5e+119) or not ((x * y) <= 2e-18):
                                                                                      		tmp = y * x
                                                                                      	else:
                                                                                      		tmp = c
                                                                                      	return tmp
                                                                                      
                                                                                      function code(x, y, z, t, a, b, c)
                                                                                      	tmp = 0.0
                                                                                      	if ((Float64(x * y) <= -5e+119) || !(Float64(x * y) <= 2e-18))
                                                                                      		tmp = Float64(y * x);
                                                                                      	else
                                                                                      		tmp = c;
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      function tmp_2 = code(x, y, z, t, a, b, c)
                                                                                      	tmp = 0.0;
                                                                                      	if (((x * y) <= -5e+119) || ~(((x * y) <= 2e-18)))
                                                                                      		tmp = y * x;
                                                                                      	else
                                                                                      		tmp = c;
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+119], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e-18]], $MachinePrecision]], N[(y * x), $MachinePrecision], c]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-18}\right):\\
                                                                                      \;\;\;\;y \cdot x\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;c\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if (*.f64 x y) < -4.9999999999999999e119 or 2.0000000000000001e-18 < (*.f64 x y)

                                                                                        1. Initial program 95.8%

                                                                                          \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in x around inf

                                                                                          \[\leadsto \color{blue}{x \cdot y} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites65.1%

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

                                                                                          if -4.9999999999999999e119 < (*.f64 x y) < 2.0000000000000001e-18

                                                                                          1. Initial program 99.4%

                                                                                            \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                                          2. Add Preprocessing
                                                                                          3. Taylor expanded in c around inf

                                                                                            \[\leadsto \color{blue}{c} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. Applied rewrites29.1%

                                                                                              \[\leadsto \color{blue}{c} \]
                                                                                          5. Recombined 2 regimes into one program.
                                                                                          6. Final simplification45.7%

                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-18}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
                                                                                          7. Add Preprocessing

                                                                                          Alternative 14: 48.2% accurate, 6.7× speedup?

                                                                                          \[\begin{array}{l} \\ \mathsf{fma}\left(y, x, c\right) \end{array} \]
                                                                                          (FPCore (x y z t a b c) :precision binary64 (fma y x c))
                                                                                          double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                          	return fma(y, x, c);
                                                                                          }
                                                                                          
                                                                                          function code(x, y, z, t, a, b, c)
                                                                                          	return fma(y, x, c)
                                                                                          end
                                                                                          
                                                                                          code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + c), $MachinePrecision]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          
                                                                                          \\
                                                                                          \mathsf{fma}\left(y, x, c\right)
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          1. Initial program 97.7%

                                                                                            \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                                          2. Add Preprocessing
                                                                                          3. Taylor expanded in z around 0

                                                                                            \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. Applied rewrites78.1%

                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)} \]
                                                                                            2. Taylor expanded in a around 0

                                                                                              \[\leadsto c + \color{blue}{x \cdot y} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites52.0%

                                                                                                \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, c\right) \]
                                                                                              2. Add Preprocessing

                                                                                              Alternative 15: 22.8% accurate, 47.0× speedup?

                                                                                              \[\begin{array}{l} \\ c \end{array} \]
                                                                                              (FPCore (x y z t a b c) :precision binary64 c)
                                                                                              double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                              	return c;
                                                                                              }
                                                                                              
                                                                                              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, a, b, c)
                                                                                              use fmin_fmax_functions
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  real(8), intent (in) :: z
                                                                                                  real(8), intent (in) :: t
                                                                                                  real(8), intent (in) :: a
                                                                                                  real(8), intent (in) :: b
                                                                                                  real(8), intent (in) :: c
                                                                                                  code = c
                                                                                              end function
                                                                                              
                                                                                              public static double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                              	return c;
                                                                                              }
                                                                                              
                                                                                              def code(x, y, z, t, a, b, c):
                                                                                              	return c
                                                                                              
                                                                                              function code(x, y, z, t, a, b, c)
                                                                                              	return c
                                                                                              end
                                                                                              
                                                                                              function tmp = code(x, y, z, t, a, b, c)
                                                                                              	tmp = c;
                                                                                              end
                                                                                              
                                                                                              code[x_, y_, z_, t_, a_, b_, c_] := c
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              
                                                                                              \\
                                                                                              c
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Initial program 97.7%

                                                                                                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                                                              2. Add Preprocessing
                                                                                              3. Taylor expanded in c around inf

                                                                                                \[\leadsto \color{blue}{c} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. Applied rewrites18.5%

                                                                                                  \[\leadsto \color{blue}{c} \]
                                                                                                2. Add Preprocessing

                                                                                                Reproduce

                                                                                                ?
                                                                                                herbie shell --seed 2025021 
                                                                                                (FPCore (x y z t a b c)
                                                                                                  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, C"
                                                                                                  :precision binary64
                                                                                                  (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))