Linear.V4:$cdot from linear-1.19.1.3, C

Percentage Accurate: 95.9% → 97.8%
Time: 5.6s
Alternatives: 12
Speedup: 1.3×

Specification

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\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 12 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: 95.9% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}

Alternative 1: 97.8% accurate, 1.3× speedup?

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

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 94.9%

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

      \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i} \]
    2. lift-*.f64N/A

      \[\leadsto \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + \color{blue}{c \cdot i} \]
    3. fp-cancel-sign-sub-invN/A

      \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i} \]
    4. fp-cancel-sub-sign-invN/A

      \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(c\right)\right)\right)\right) \cdot i} \]
    5. lift-+.f64N/A

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

      \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(c\right)\right)\right)\right) \cdot i \]
    7. +-commutativeN/A

      \[\leadsto \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} + a \cdot b\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(c\right)\right)\right)\right) \cdot i \]
    8. associate-+l+N/A

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

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

      \[\leadsto \color{blue}{z \cdot t} + \left(\left(x \cdot y + a \cdot b\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(c\right)\right)\right)\right) \cdot i\right) \]
    11. remove-double-negN/A

      \[\leadsto z \cdot t + \left(\left(x \cdot y + a \cdot b\right) + \color{blue}{c} \cdot i\right) \]
    12. lift-*.f64N/A

      \[\leadsto z \cdot t + \left(\left(x \cdot y + a \cdot b\right) + \color{blue}{c \cdot i}\right) \]
    13. associate-+r+N/A

      \[\leadsto z \cdot t + \color{blue}{\left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
    14. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
    15. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} + \left(a \cdot b + c \cdot i\right)\right) \]
    17. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{\mathsf{fma}\left(y, x, a \cdot b + c \cdot i\right)}\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
    19. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i} + a \cdot b\right)\right) \]
    20. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c} + a \cdot b\right)\right) \]
  4. Applied rewrites96.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)} \]
  5. Add Preprocessing

Alternative 2: 42.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+156}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{+28}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-55}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{-262}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* c i) -5e+156)
   (* i c)
   (if (<= (* c i) -5e+28)
     (* b a)
     (if (<= (* c i) -5e-55)
       (* y x)
       (if (<= (* c i) -2e-313)
         (* t z)
         (if (<= (* c i) 5e-262)
           (* b a)
           (if (<= (* c i) 5e+92) (* y x) (* i c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -5e+156) {
		tmp = i * c;
	} else if ((c * i) <= -5e+28) {
		tmp = b * a;
	} else if ((c * i) <= -5e-55) {
		tmp = y * x;
	} else if ((c * i) <= -2e-313) {
		tmp = t * z;
	} else if ((c * i) <= 5e-262) {
		tmp = b * a;
	} else if ((c * i) <= 5e+92) {
		tmp = y * x;
	} else {
		tmp = i * 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, i)
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), intent (in) :: i
    real(8) :: tmp
    if ((c * i) <= (-5d+156)) then
        tmp = i * c
    else if ((c * i) <= (-5d+28)) then
        tmp = b * a
    else if ((c * i) <= (-5d-55)) then
        tmp = y * x
    else if ((c * i) <= (-2d-313)) then
        tmp = t * z
    else if ((c * i) <= 5d-262) then
        tmp = b * a
    else if ((c * i) <= 5d+92) then
        tmp = y * x
    else
        tmp = i * 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 i) {
	double tmp;
	if ((c * i) <= -5e+156) {
		tmp = i * c;
	} else if ((c * i) <= -5e+28) {
		tmp = b * a;
	} else if ((c * i) <= -5e-55) {
		tmp = y * x;
	} else if ((c * i) <= -2e-313) {
		tmp = t * z;
	} else if ((c * i) <= 5e-262) {
		tmp = b * a;
	} else if ((c * i) <= 5e+92) {
		tmp = y * x;
	} else {
		tmp = i * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -5e+156:
		tmp = i * c
	elif (c * i) <= -5e+28:
		tmp = b * a
	elif (c * i) <= -5e-55:
		tmp = y * x
	elif (c * i) <= -2e-313:
		tmp = t * z
	elif (c * i) <= 5e-262:
		tmp = b * a
	elif (c * i) <= 5e+92:
		tmp = y * x
	else:
		tmp = i * c
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(c * i) <= -5e+156)
		tmp = Float64(i * c);
	elseif (Float64(c * i) <= -5e+28)
		tmp = Float64(b * a);
	elseif (Float64(c * i) <= -5e-55)
		tmp = Float64(y * x);
	elseif (Float64(c * i) <= -2e-313)
		tmp = Float64(t * z);
	elseif (Float64(c * i) <= 5e-262)
		tmp = Float64(b * a);
	elseif (Float64(c * i) <= 5e+92)
		tmp = Float64(y * x);
	else
		tmp = Float64(i * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c * i) <= -5e+156)
		tmp = i * c;
	elseif ((c * i) <= -5e+28)
		tmp = b * a;
	elseif ((c * i) <= -5e-55)
		tmp = y * x;
	elseif ((c * i) <= -2e-313)
		tmp = t * z;
	elseif ((c * i) <= 5e-262)
		tmp = b * a;
	elseif ((c * i) <= 5e+92)
		tmp = y * x;
	else
		tmp = i * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5e+156], N[(i * c), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e+28], N[(b * a), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-55], N[(y * x), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e-313], N[(t * z), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e-262], N[(b * a), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+92], N[(y * x), $MachinePrecision], N[(i * c), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+156}:\\
\;\;\;\;i \cdot c\\

\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{+28}:\\
\;\;\;\;b \cdot a\\

\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-55}:\\
\;\;\;\;y \cdot x\\

\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\
\;\;\;\;t \cdot z\\

\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{-262}:\\
\;\;\;\;b \cdot a\\

\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\
\;\;\;\;y \cdot x\\

\mathbf{else}:\\
\;\;\;\;i \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -4.99999999999999992e156 or 5.00000000000000022e92 < (*.f64 c i)

    1. Initial program 90.8%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
      4. fp-cancel-sign-sub-invN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
      11. *-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
      12. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
      14. lower-*.f6490.7

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
    5. Applied rewrites90.7%

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

      \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
    7. Step-by-step derivation
      1. Applied rewrites24.3%

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

        \[\leadsto a \cdot b \]
      3. Step-by-step derivation
        1. Applied rewrites15.0%

          \[\leadsto b \cdot a \]
        2. Taylor expanded in c around inf

          \[\leadsto \color{blue}{c \cdot i} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{i \cdot c} \]
          2. lower-*.f6473.8

            \[\leadsto \color{blue}{i \cdot c} \]
        4. Applied rewrites73.8%

          \[\leadsto \color{blue}{i \cdot c} \]

        if -4.99999999999999992e156 < (*.f64 c i) < -4.99999999999999957e28 or -1.99999999998e-313 < (*.f64 c i) < 4.99999999999999992e-262

        1. Initial program 94.8%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
          4. fp-cancel-sign-sub-invN/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
          5. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
          7. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
          8. fp-cancel-sub-sign-invN/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
          11. *-lft-identityN/A

            \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
          12. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
          14. lower-*.f6479.7

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
        5. Applied rewrites79.7%

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

          \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
        7. Step-by-step derivation
          1. Applied rewrites71.2%

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

            \[\leadsto a \cdot b \]
          3. Step-by-step derivation
            1. Applied rewrites50.0%

              \[\leadsto b \cdot a \]

            if -4.99999999999999957e28 < (*.f64 c i) < -5.0000000000000002e-55 or 4.99999999999999992e-262 < (*.f64 c i) < 5.00000000000000022e92

            1. Initial program 98.7%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in z around 0

              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
              4. fp-cancel-sign-sub-invN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
              5. distribute-lft-neg-outN/A

                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
              7. mul-1-negN/A

                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
              8. fp-cancel-sub-sign-invN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
              11. *-lft-identityN/A

                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
              12. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
              13. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              14. lower-*.f6475.7

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
            5. Applied rewrites75.7%

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

              \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
            7. Step-by-step derivation
              1. Applied rewrites69.5%

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

                \[\leadsto a \cdot b \]
              3. Step-by-step derivation
                1. Applied rewrites25.8%

                  \[\leadsto b \cdot a \]
                2. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{x \cdot y} \]
                3. Step-by-step derivation
                  1. *-commutativeN/A

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

                    \[\leadsto \color{blue}{y \cdot x} \]
                4. Applied rewrites47.7%

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

                if -5.0000000000000002e-55 < (*.f64 c i) < -1.99999999998e-313

                1. Initial program 95.7%

                  \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                  4. fp-cancel-sign-sub-invN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                  5. distribute-lft-neg-outN/A

                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                  7. mul-1-negN/A

                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                  8. fp-cancel-sub-sign-invN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                  11. *-lft-identityN/A

                    \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                  12. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                  13. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                  14. lower-*.f6447.5

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                5. Applied rewrites47.5%

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

                  \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                7. Step-by-step derivation
                  1. Applied rewrites47.6%

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

                    \[\leadsto a \cdot b \]
                  3. Step-by-step derivation
                    1. Applied rewrites24.3%

                      \[\leadsto b \cdot a \]
                    2. Taylor expanded in z around inf

                      \[\leadsto \color{blue}{t \cdot z} \]
                    3. Step-by-step derivation
                      1. lower-*.f6454.9

                        \[\leadsto \color{blue}{t \cdot z} \]
                    4. Applied rewrites54.9%

                      \[\leadsto \color{blue}{t \cdot z} \]
                  4. Recombined 4 regimes into one program.
                  5. Add Preprocessing

                  Alternative 3: 66.6% accurate, 0.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, a, y \cdot x\right)\\ \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+74}:\\ \;\;\;\;\mathsf{fma}\left(b, a, i \cdot c\right)\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b c i)
                   :precision binary64
                   (let* ((t_1 (fma b a (* y x))))
                     (if (<= (* c i) -5e+74)
                       (fma b a (* i c))
                       (if (<= (* c i) -5e-55)
                         t_1
                         (if (<= (* c i) -2e-313)
                           (fma b a (* t z))
                           (if (<= (* c i) 5e+92) t_1 (fma i c (* y x))))))))
                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	double t_1 = fma(b, a, (y * x));
                  	double tmp;
                  	if ((c * i) <= -5e+74) {
                  		tmp = fma(b, a, (i * c));
                  	} else if ((c * i) <= -5e-55) {
                  		tmp = t_1;
                  	} else if ((c * i) <= -2e-313) {
                  		tmp = fma(b, a, (t * z));
                  	} else if ((c * i) <= 5e+92) {
                  		tmp = t_1;
                  	} else {
                  		tmp = fma(i, c, (y * x));
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t, a, b, c, i)
                  	t_1 = fma(b, a, Float64(y * x))
                  	tmp = 0.0
                  	if (Float64(c * i) <= -5e+74)
                  		tmp = fma(b, a, Float64(i * c));
                  	elseif (Float64(c * i) <= -5e-55)
                  		tmp = t_1;
                  	elseif (Float64(c * i) <= -2e-313)
                  		tmp = fma(b, a, Float64(t * z));
                  	elseif (Float64(c * i) <= 5e+92)
                  		tmp = t_1;
                  	else
                  		tmp = fma(i, c, Float64(y * x));
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * a + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -5e+74], N[(b * a + N[(i * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-55], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -2e-313], N[(b * a + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+92], t$95$1, N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \mathsf{fma}\left(b, a, y \cdot x\right)\\
                  \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+74}:\\
                  \;\;\;\;\mathsf{fma}\left(b, a, i \cdot c\right)\\
                  
                  \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-55}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\
                  \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\
                  
                  \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if (*.f64 c i) < -4.99999999999999963e74

                    1. Initial program 92.5%

                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                    2. Add Preprocessing
                    3. Taylor expanded in z around 0

                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                      3. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                      4. fp-cancel-sign-sub-invN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                      5. distribute-lft-neg-outN/A

                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                      7. mul-1-negN/A

                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                      8. fp-cancel-sub-sign-invN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                      9. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                      10. metadata-evalN/A

                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                      11. *-lft-identityN/A

                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                      12. lower-fma.f64N/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                      13. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                      14. lower-*.f6490.2

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                    5. Applied rewrites90.2%

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

                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites86.9%

                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c\right) \]

                      if -4.99999999999999963e74 < (*.f64 c i) < -5.0000000000000002e-55 or -1.99999999998e-313 < (*.f64 c i) < 5.00000000000000022e92

                      1. Initial program 96.7%

                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                      2. Add Preprocessing
                      3. Taylor expanded in z around 0

                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                        2. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                        4. fp-cancel-sign-sub-invN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                        5. distribute-lft-neg-outN/A

                          \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                        7. mul-1-negN/A

                          \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                        8. fp-cancel-sub-sign-invN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                        10. metadata-evalN/A

                          \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                        11. *-lft-identityN/A

                          \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                        12. lower-fma.f64N/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                        14. lower-*.f6476.8

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                      5. Applied rewrites76.8%

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

                        \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                      7. Step-by-step derivation
                        1. Applied rewrites71.3%

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

                        if -5.0000000000000002e-55 < (*.f64 c i) < -1.99999999998e-313

                        1. Initial program 95.7%

                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                          2. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                          3. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                          4. lower-fma.f64N/A

                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                          5. lower-*.f6477.4

                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                        5. Applied rewrites77.4%

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

                          \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
                        7. Step-by-step derivation
                          1. Applied rewrites77.4%

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

                          if 5.00000000000000022e92 < (*.f64 c i)

                          1. Initial program 91.6%

                            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                          2. Add Preprocessing
                          3. Taylor expanded in z around 0

                            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                            2. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                            3. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                            4. fp-cancel-sign-sub-invN/A

                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                            5. distribute-lft-neg-outN/A

                              \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                            6. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                            7. mul-1-negN/A

                              \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                            8. fp-cancel-sub-sign-invN/A

                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                            9. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                            10. metadata-evalN/A

                              \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                            11. *-lft-identityN/A

                              \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                            12. lower-fma.f64N/A

                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                            13. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                            14. lower-*.f6489.5

                              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                          5. Applied rewrites89.5%

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

                            \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                          7. Step-by-step derivation
                            1. Applied rewrites29.1%

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

                              \[\leadsto a \cdot b \]
                            3. Step-by-step derivation
                              1. Applied rewrites16.6%

                                \[\leadsto b \cdot a \]
                              2. Taylor expanded in a around 0

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

                                  \[\leadsto \mathsf{fma}\left(i, \color{blue}{c}, y \cdot x\right) \]
                              4. Recombined 4 regimes into one program.
                              5. Add Preprocessing

                              Alternative 4: 62.9% accurate, 0.5× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, a, y \cdot x\right)\\ \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+157}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (let* ((t_1 (fma b a (* y x))))
                                 (if (<= (* c i) -1e+157)
                                   (* i c)
                                   (if (<= (* c i) -5e-55)
                                     t_1
                                     (if (<= (* c i) -2e-313)
                                       (fma b a (* t z))
                                       (if (<= (* c i) 5e+92) t_1 (* i c)))))))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	double t_1 = fma(b, a, (y * x));
                              	double tmp;
                              	if ((c * i) <= -1e+157) {
                              		tmp = i * c;
                              	} else if ((c * i) <= -5e-55) {
                              		tmp = t_1;
                              	} else if ((c * i) <= -2e-313) {
                              		tmp = fma(b, a, (t * z));
                              	} else if ((c * i) <= 5e+92) {
                              		tmp = t_1;
                              	} else {
                              		tmp = i * c;
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	t_1 = fma(b, a, Float64(y * x))
                              	tmp = 0.0
                              	if (Float64(c * i) <= -1e+157)
                              		tmp = Float64(i * c);
                              	elseif (Float64(c * i) <= -5e-55)
                              		tmp = t_1;
                              	elseif (Float64(c * i) <= -2e-313)
                              		tmp = fma(b, a, Float64(t * z));
                              	elseif (Float64(c * i) <= 5e+92)
                              		tmp = t_1;
                              	else
                              		tmp = Float64(i * c);
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * a + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1e+157], N[(i * c), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-55], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -2e-313], N[(b * a + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+92], t$95$1, N[(i * c), $MachinePrecision]]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := \mathsf{fma}\left(b, a, y \cdot x\right)\\
                              \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+157}:\\
                              \;\;\;\;i \cdot c\\
                              
                              \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-55}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\
                              \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\
                              
                              \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;i \cdot c\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if (*.f64 c i) < -9.99999999999999983e156 or 5.00000000000000022e92 < (*.f64 c i)

                                1. Initial program 92.0%

                                  \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                2. Add Preprocessing
                                3. Taylor expanded in z around 0

                                  \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                  2. lower-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                  3. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                  4. fp-cancel-sign-sub-invN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                  5. distribute-lft-neg-outN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                  7. mul-1-negN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                  8. fp-cancel-sub-sign-invN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                  9. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                  10. metadata-evalN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                  11. *-lft-identityN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                  12. lower-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                  13. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                  14. lower-*.f6490.6

                                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                5. Applied rewrites90.6%

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

                                  \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites23.3%

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

                                    \[\leadsto a \cdot b \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites15.2%

                                      \[\leadsto b \cdot a \]
                                    2. Taylor expanded in c around inf

                                      \[\leadsto \color{blue}{c \cdot i} \]
                                    3. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \color{blue}{i \cdot c} \]
                                      2. lower-*.f6474.7

                                        \[\leadsto \color{blue}{i \cdot c} \]
                                    4. Applied rewrites74.7%

                                      \[\leadsto \color{blue}{i \cdot c} \]

                                    if -9.99999999999999983e156 < (*.f64 c i) < -5.0000000000000002e-55 or -1.99999999998e-313 < (*.f64 c i) < 5.00000000000000022e92

                                    1. Initial program 96.3%

                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in z around 0

                                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                    4. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                      2. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                      3. *-commutativeN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                      4. fp-cancel-sign-sub-invN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                      5. distribute-lft-neg-outN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                      6. *-commutativeN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                      7. mul-1-negN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                      8. fp-cancel-sub-sign-invN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                      9. *-commutativeN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                      10. metadata-evalN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                      11. *-lft-identityN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                      12. lower-fma.f64N/A

                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                      13. *-commutativeN/A

                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                      14. lower-*.f6477.6

                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                    5. Applied rewrites77.6%

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

                                      \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites70.5%

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

                                      if -5.0000000000000002e-55 < (*.f64 c i) < -1.99999999998e-313

                                      1. Initial program 95.7%

                                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in x around 0

                                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                      4. Step-by-step derivation
                                        1. *-commutativeN/A

                                          \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                                        2. lower-fma.f64N/A

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                                        3. *-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                                        4. lower-fma.f64N/A

                                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                                        5. lower-*.f6477.4

                                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                      5. Applied rewrites77.4%

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

                                        \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites77.4%

                                          \[\leadsto \mathsf{fma}\left(b, \color{blue}{a}, t \cdot z\right) \]
                                      8. Recombined 3 regimes into one program.
                                      9. Add Preprocessing

                                      Alternative 5: 42.9% accurate, 0.6× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+156}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{+38}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a b c i)
                                       :precision binary64
                                       (if (<= (* c i) -5e+156)
                                         (* i c)
                                         (if (<= (* c i) -5e+38)
                                           (* b a)
                                           (if (<= (* c i) -2e-313)
                                             (* t z)
                                             (if (<= (* c i) 5e+92) (* b a) (* i c))))))
                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                      	double tmp;
                                      	if ((c * i) <= -5e+156) {
                                      		tmp = i * c;
                                      	} else if ((c * i) <= -5e+38) {
                                      		tmp = b * a;
                                      	} else if ((c * i) <= -2e-313) {
                                      		tmp = t * z;
                                      	} else if ((c * i) <= 5e+92) {
                                      		tmp = b * a;
                                      	} else {
                                      		tmp = i * 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, i)
                                      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), intent (in) :: i
                                          real(8) :: tmp
                                          if ((c * i) <= (-5d+156)) then
                                              tmp = i * c
                                          else if ((c * i) <= (-5d+38)) then
                                              tmp = b * a
                                          else if ((c * i) <= (-2d-313)) then
                                              tmp = t * z
                                          else if ((c * i) <= 5d+92) then
                                              tmp = b * a
                                          else
                                              tmp = i * 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 i) {
                                      	double tmp;
                                      	if ((c * i) <= -5e+156) {
                                      		tmp = i * c;
                                      	} else if ((c * i) <= -5e+38) {
                                      		tmp = b * a;
                                      	} else if ((c * i) <= -2e-313) {
                                      		tmp = t * z;
                                      	} else if ((c * i) <= 5e+92) {
                                      		tmp = b * a;
                                      	} else {
                                      		tmp = i * c;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(x, y, z, t, a, b, c, i):
                                      	tmp = 0
                                      	if (c * i) <= -5e+156:
                                      		tmp = i * c
                                      	elif (c * i) <= -5e+38:
                                      		tmp = b * a
                                      	elif (c * i) <= -2e-313:
                                      		tmp = t * z
                                      	elif (c * i) <= 5e+92:
                                      		tmp = b * a
                                      	else:
                                      		tmp = i * c
                                      	return tmp
                                      
                                      function code(x, y, z, t, a, b, c, i)
                                      	tmp = 0.0
                                      	if (Float64(c * i) <= -5e+156)
                                      		tmp = Float64(i * c);
                                      	elseif (Float64(c * i) <= -5e+38)
                                      		tmp = Float64(b * a);
                                      	elseif (Float64(c * i) <= -2e-313)
                                      		tmp = Float64(t * z);
                                      	elseif (Float64(c * i) <= 5e+92)
                                      		tmp = Float64(b * a);
                                      	else
                                      		tmp = Float64(i * c);
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(x, y, z, t, a, b, c, i)
                                      	tmp = 0.0;
                                      	if ((c * i) <= -5e+156)
                                      		tmp = i * c;
                                      	elseif ((c * i) <= -5e+38)
                                      		tmp = b * a;
                                      	elseif ((c * i) <= -2e-313)
                                      		tmp = t * z;
                                      	elseif ((c * i) <= 5e+92)
                                      		tmp = b * a;
                                      	else
                                      		tmp = i * c;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5e+156], N[(i * c), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e+38], N[(b * a), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e-313], N[(t * z), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+92], N[(b * a), $MachinePrecision], N[(i * c), $MachinePrecision]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+156}:\\
                                      \;\;\;\;i \cdot c\\
                                      
                                      \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{+38}:\\
                                      \;\;\;\;b \cdot a\\
                                      
                                      \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\
                                      \;\;\;\;t \cdot z\\
                                      
                                      \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+92}:\\
                                      \;\;\;\;b \cdot a\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;i \cdot c\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if (*.f64 c i) < -4.99999999999999992e156 or 5.00000000000000022e92 < (*.f64 c i)

                                        1. Initial program 90.8%

                                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in z around 0

                                          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                        4. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                          2. lower-fma.f64N/A

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                          3. *-commutativeN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                          4. fp-cancel-sign-sub-invN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                          5. distribute-lft-neg-outN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                          6. *-commutativeN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                          7. mul-1-negN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                          8. fp-cancel-sub-sign-invN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                          9. *-commutativeN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                          10. metadata-evalN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                          11. *-lft-identityN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                          12. lower-fma.f64N/A

                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                          13. *-commutativeN/A

                                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                          14. lower-*.f6490.7

                                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                        5. Applied rewrites90.7%

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

                                          \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites24.3%

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

                                            \[\leadsto a \cdot b \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites15.0%

                                              \[\leadsto b \cdot a \]
                                            2. Taylor expanded in c around inf

                                              \[\leadsto \color{blue}{c \cdot i} \]
                                            3. Step-by-step derivation
                                              1. *-commutativeN/A

                                                \[\leadsto \color{blue}{i \cdot c} \]
                                              2. lower-*.f6473.8

                                                \[\leadsto \color{blue}{i \cdot c} \]
                                            4. Applied rewrites73.8%

                                              \[\leadsto \color{blue}{i \cdot c} \]

                                            if -4.99999999999999992e156 < (*.f64 c i) < -4.9999999999999997e38 or -1.99999999998e-313 < (*.f64 c i) < 5.00000000000000022e92

                                            1. Initial program 97.4%

                                              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in z around 0

                                              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                            4. Step-by-step derivation
                                              1. *-commutativeN/A

                                                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                              2. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                              3. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                              4. fp-cancel-sign-sub-invN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                              5. distribute-lft-neg-outN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                              6. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                              7. mul-1-negN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                              8. fp-cancel-sub-sign-invN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                              9. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                              10. metadata-evalN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                              11. *-lft-identityN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                              12. lower-fma.f64N/A

                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                              13. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                              14. lower-*.f6477.5

                                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                            5. Applied rewrites77.5%

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

                                              \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites71.7%

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

                                                \[\leadsto a \cdot b \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites39.4%

                                                  \[\leadsto b \cdot a \]

                                                if -4.9999999999999997e38 < (*.f64 c i) < -1.99999999998e-313

                                                1. Initial program 95.2%

                                                  \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in z around 0

                                                  \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                4. Step-by-step derivation
                                                  1. *-commutativeN/A

                                                    \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                  2. lower-fma.f64N/A

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                  3. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                  4. fp-cancel-sign-sub-invN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                  5. distribute-lft-neg-outN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                  6. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                  7. mul-1-negN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                  8. fp-cancel-sub-sign-invN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                  9. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                  10. metadata-evalN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                  11. *-lft-identityN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                  12. lower-fma.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                  13. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                  14. lower-*.f6455.4

                                                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                5. Applied rewrites55.4%

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

                                                  \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites50.9%

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

                                                    \[\leadsto a \cdot b \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites21.6%

                                                      \[\leadsto b \cdot a \]
                                                    2. Taylor expanded in z around inf

                                                      \[\leadsto \color{blue}{t \cdot z} \]
                                                    3. Step-by-step derivation
                                                      1. lower-*.f6446.9

                                                        \[\leadsto \color{blue}{t \cdot z} \]
                                                    4. Applied rewrites46.9%

                                                      \[\leadsto \color{blue}{t \cdot z} \]
                                                  4. Recombined 3 regimes into one program.
                                                  5. Add Preprocessing

                                                  Alternative 6: 88.4% accurate, 0.7× speedup?

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

                                                    1. Initial program 91.2%

                                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in a around 0

                                                      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-lft-identityN/A

                                                        \[\leadsto c \cdot i + \color{blue}{1 \cdot \left(t \cdot z + x \cdot y\right)} \]
                                                      2. metadata-evalN/A

                                                        \[\leadsto c \cdot i + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot \left(t \cdot z + x \cdot y\right) \]
                                                      3. *-commutativeN/A

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

                                                        \[\leadsto i \cdot c + \color{blue}{1} \cdot \left(t \cdot z + x \cdot y\right) \]
                                                      5. *-lft-identityN/A

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

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z + x \cdot y\right)} \]
                                                      7. lower-fma.f64N/A

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

                                                        \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
                                                      9. lower-*.f6490.6

                                                        \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
                                                    5. Applied rewrites90.6%

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

                                                    if -2e7 < (*.f64 x y) < 4.99999999999999977e170

                                                    1. Initial program 97.4%

                                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in x around 0

                                                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                                                      2. lower-fma.f64N/A

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                                                      3. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                                                      4. lower-fma.f64N/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                                                      5. lower-*.f6496.0

                                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                                    5. Applied rewrites96.0%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)} \]
                                                  3. Recombined 2 regimes into one program.
                                                  4. Final simplification93.8%

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

                                                  Alternative 7: 88.6% accurate, 0.7× speedup?

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

                                                    1. Initial program 90.2%

                                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in z around 0

                                                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                      2. lower-fma.f64N/A

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                      3. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                      4. fp-cancel-sign-sub-invN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                      5. distribute-lft-neg-outN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                      6. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                      7. mul-1-negN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                      8. fp-cancel-sub-sign-invN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                      9. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                      10. metadata-evalN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                      11. *-lft-identityN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                      12. lower-fma.f64N/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                      13. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                      14. lower-*.f6487.2

                                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                    5. Applied rewrites87.2%

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

                                                    if -3.99999999999999978e34 < (*.f64 x y) < 1.00000000000000004e192

                                                    1. Initial program 97.6%

                                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in x around 0

                                                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                                                      2. lower-fma.f64N/A

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                                                      3. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                                                      4. lower-fma.f64N/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                                                      5. lower-*.f6494.3

                                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                                    5. Applied rewrites94.3%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)} \]
                                                  3. Recombined 2 regimes into one program.
                                                  4. Final simplification91.7%

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

                                                  Alternative 8: 84.4% accurate, 0.7× speedup?

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

                                                    1. Initial program 90.2%

                                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in z around 0

                                                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                      2. lower-fma.f64N/A

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                      3. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                      4. fp-cancel-sign-sub-invN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                      5. distribute-lft-neg-outN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                      6. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                      7. mul-1-negN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                      8. fp-cancel-sub-sign-invN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                      9. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                      10. metadata-evalN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                      11. *-lft-identityN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                      12. lower-fma.f64N/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                      13. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                      14. lower-*.f6487.2

                                                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                    5. Applied rewrites87.2%

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

                                                      \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites75.7%

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

                                                        \[\leadsto a \cdot b \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites13.5%

                                                          \[\leadsto b \cdot a \]
                                                        2. Taylor expanded in a around 0

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

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

                                                          if -3.99999999999999978e34 < (*.f64 x y) < 1.00000000000000004e192

                                                          1. Initial program 97.6%

                                                            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in x around 0

                                                            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                          4. Step-by-step derivation
                                                            1. *-commutativeN/A

                                                              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                                                            2. lower-fma.f64N/A

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                                                            3. *-commutativeN/A

                                                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                                                            4. lower-fma.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                                                            5. lower-*.f6494.3

                                                              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                                          5. Applied rewrites94.3%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)} \]
                                                        4. Recombined 2 regimes into one program.
                                                        5. Final simplification88.8%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+34} \lor \neg \left(x \cdot y \leq 10^{+192}\right):\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \]
                                                        6. Add Preprocessing

                                                        Alternative 9: 67.2% accurate, 0.9× speedup?

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

                                                          1. Initial program 86.2%

                                                            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in x around 0

                                                            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                          4. Step-by-step derivation
                                                            1. *-commutativeN/A

                                                              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                                                            2. lower-fma.f64N/A

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                                                            3. *-commutativeN/A

                                                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                                                            4. lower-fma.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                                                            5. lower-*.f6485.5

                                                              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                                          5. Applied rewrites85.5%

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

                                                            \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites80.5%

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

                                                            if -1.99999999999999989e119 < (*.f64 a b) < 4.99999999999999976e67

                                                            1. Initial program 99.4%

                                                              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in z around 0

                                                              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                            4. Step-by-step derivation
                                                              1. *-commutativeN/A

                                                                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                              2. lower-fma.f64N/A

                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                              3. *-commutativeN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                              4. fp-cancel-sign-sub-invN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                              5. distribute-lft-neg-outN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                              6. *-commutativeN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                              7. mul-1-negN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                              8. fp-cancel-sub-sign-invN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                              9. *-commutativeN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                              10. metadata-evalN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                              11. *-lft-identityN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                              12. lower-fma.f64N/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                              13. *-commutativeN/A

                                                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                              14. lower-*.f6473.6

                                                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                            5. Applied rewrites73.6%

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

                                                              \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites40.3%

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

                                                                \[\leadsto a \cdot b \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites7.1%

                                                                  \[\leadsto b \cdot a \]
                                                                2. Taylor expanded in a around 0

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

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

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

                                                                Alternative 10: 61.0% accurate, 0.9× speedup?

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

                                                                  1. Initial program 90.2%

                                                                    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in z around 0

                                                                    \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                                    2. lower-fma.f64N/A

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                                    3. *-commutativeN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                                    4. fp-cancel-sign-sub-invN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                                    5. distribute-lft-neg-outN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                                    6. *-commutativeN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                                    7. mul-1-negN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                                    8. fp-cancel-sub-sign-invN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                                    9. *-commutativeN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                                    10. metadata-evalN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                                    11. *-lft-identityN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                                    12. lower-fma.f64N/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                                    13. *-commutativeN/A

                                                                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                    14. lower-*.f6487.2

                                                                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                  5. Applied rewrites87.2%

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

                                                                    \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites75.7%

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

                                                                      \[\leadsto a \cdot b \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites13.5%

                                                                        \[\leadsto b \cdot a \]
                                                                      2. Taylor expanded in x around inf

                                                                        \[\leadsto \color{blue}{x \cdot y} \]
                                                                      3. Step-by-step derivation
                                                                        1. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{y \cdot x} \]
                                                                        2. lower-*.f6467.6

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

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

                                                                      if -3.99999999999999978e34 < (*.f64 x y) < 1.00000000000000004e192

                                                                      1. Initial program 97.6%

                                                                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in x around 0

                                                                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                                                                        2. lower-fma.f64N/A

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                                                                        3. *-commutativeN/A

                                                                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                                                                        4. lower-fma.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                                                                        5. lower-*.f6494.3

                                                                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                                                      5. Applied rewrites94.3%

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

                                                                        \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites65.0%

                                                                          \[\leadsto \mathsf{fma}\left(b, \color{blue}{a}, t \cdot z\right) \]
                                                                      8. Recombined 2 regimes into one program.
                                                                      9. Final simplification66.0%

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

                                                                      Alternative 11: 42.0% accurate, 1.1× speedup?

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

                                                                        1. Initial program 89.7%

                                                                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in z around 0

                                                                          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                                        4. Step-by-step derivation
                                                                          1. *-commutativeN/A

                                                                            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                                          2. lower-fma.f64N/A

                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                                          3. *-commutativeN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                                          4. fp-cancel-sign-sub-invN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                                          5. distribute-lft-neg-outN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                                          6. *-commutativeN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                                          7. mul-1-negN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                                          8. fp-cancel-sub-sign-invN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                                          9. *-commutativeN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                                          10. metadata-evalN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                                          11. *-lft-identityN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                                          12. lower-fma.f64N/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                                          13. *-commutativeN/A

                                                                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                          14. lower-*.f6481.4

                                                                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                        5. Applied rewrites81.4%

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

                                                                          \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites74.0%

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

                                                                            \[\leadsto a \cdot b \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites57.2%

                                                                              \[\leadsto b \cdot a \]

                                                                            if -1.00000000000000005e-4 < (*.f64 a b) < 4.99999999999999976e67

                                                                            1. Initial program 99.3%

                                                                              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in z around 0

                                                                              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                                            4. Step-by-step derivation
                                                                              1. *-commutativeN/A

                                                                                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                                              2. lower-fma.f64N/A

                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                                              3. *-commutativeN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                                              4. fp-cancel-sign-sub-invN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                                              5. distribute-lft-neg-outN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                                              6. *-commutativeN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                                              7. mul-1-negN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                                              8. fp-cancel-sub-sign-invN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                                              9. *-commutativeN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                                              10. metadata-evalN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                                              11. *-lft-identityN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                                              12. lower-fma.f64N/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                                              13. *-commutativeN/A

                                                                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                              14. lower-*.f6471.4

                                                                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                            5. Applied rewrites71.4%

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

                                                                              \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites34.4%

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

                                                                                \[\leadsto a \cdot b \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites3.1%

                                                                                  \[\leadsto b \cdot a \]
                                                                                2. Taylor expanded in c around inf

                                                                                  \[\leadsto \color{blue}{c \cdot i} \]
                                                                                3. Step-by-step derivation
                                                                                  1. *-commutativeN/A

                                                                                    \[\leadsto \color{blue}{i \cdot c} \]
                                                                                  2. lower-*.f6439.1

                                                                                    \[\leadsto \color{blue}{i \cdot c} \]
                                                                                4. Applied rewrites39.1%

                                                                                  \[\leadsto \color{blue}{i \cdot c} \]
                                                                              4. Recombined 2 regimes into one program.
                                                                              5. Final simplification47.3%

                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -0.0001 \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+67}\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                                                                              6. Add Preprocessing

                                                                              Alternative 12: 27.1% accurate, 5.0× speedup?

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

                                                                                \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in z around 0

                                                                                \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. *-commutativeN/A

                                                                                  \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                                                                                2. lower-fma.f64N/A

                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                                                                                3. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, c \cdot i + \color{blue}{y \cdot x}\right) \]
                                                                                4. fp-cancel-sign-sub-invN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i - \left(\mathsf{neg}\left(y\right)\right) \cdot x}\right) \]
                                                                                5. distribute-lft-neg-outN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right) \]
                                                                                6. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \left(\mathsf{neg}\left(\color{blue}{x \cdot y}\right)\right)\right) \]
                                                                                7. mul-1-negN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, c \cdot i - \color{blue}{-1 \cdot \left(x \cdot y\right)}\right) \]
                                                                                8. fp-cancel-sub-sign-invN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{c \cdot i + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}\right) \]
                                                                                9. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)\right) \]
                                                                                10. metadata-evalN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{1} \cdot \left(x \cdot y\right)\right) \]
                                                                                11. *-lft-identityN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, i \cdot c + \color{blue}{x \cdot y}\right) \]
                                                                                12. lower-fma.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                                                                                13. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                                14. lower-*.f6476.0

                                                                                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                                                                              5. Applied rewrites76.0%

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

                                                                                \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites52.5%

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

                                                                                  \[\leadsto a \cdot b \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites27.8%

                                                                                    \[\leadsto b \cdot a \]
                                                                                  2. Add Preprocessing

                                                                                  Reproduce

                                                                                  ?
                                                                                  herbie shell --seed 2024354 
                                                                                  (FPCore (x y z t a b c i)
                                                                                    :name "Linear.V4:$cdot from linear-1.19.1.3, C"
                                                                                    :precision binary64
                                                                                    (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))