Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 74.0% → 82.4%
Time: 9.2s
Alternatives: 21
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 82.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (+
          (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
          (* j (- (* c t) (* i y))))))
   (if (<= t_1 INFINITY) t_1 (* (* c (- t (/ (* b z) j))) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (c * (t - ((b * z) / j))) * j;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (c * (t - ((b * z) / j))) * j;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (c * (t - ((b * z) / j))) * j
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * Float64(t - Float64(Float64(b * z) / j))) * j);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (c * (t - ((b * z) / j))) * j;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * N[(t - N[(N[(b * z), $MachinePrecision] / j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0

    1. Initial program 90.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y))))

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites40.8%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
      2. lower--.f64N/A

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
      3. lower-/.f64N/A

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
      4. lift-*.f6457.7

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
    7. Applied rewrites57.7%

      \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 50.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -4.5 \cdot 10^{+126}:\\ \;\;\;\;\left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j\\ \mathbf{elif}\;c \leq -180000:\\ \;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\ \mathbf{elif}\;c \leq 3.85 \cdot 10^{-171}:\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{elif}\;c \leq 10^{-33}:\\ \;\;\;\;\left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= c -4.5e+126)
   (* (* c (- t (/ (* b z) j))) j)
   (if (<= c -180000.0)
     (* (fma (- i) y (* c t)) j)
     (if (<= c 3.85e-171)
       (* (fma (- a) t (* z y)) x)
       (if (<= c 1e-33)
         (* (* y (- (/ (* x z) j) i)) j)
         (* c (- (* j t) (* b z))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (c <= -4.5e+126) {
		tmp = (c * (t - ((b * z) / j))) * j;
	} else if (c <= -180000.0) {
		tmp = fma(-i, y, (c * t)) * j;
	} else if (c <= 3.85e-171) {
		tmp = fma(-a, t, (z * y)) * x;
	} else if (c <= 1e-33) {
		tmp = (y * (((x * z) / j) - i)) * j;
	} else {
		tmp = c * ((j * t) - (b * z));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (c <= -4.5e+126)
		tmp = Float64(Float64(c * Float64(t - Float64(Float64(b * z) / j))) * j);
	elseif (c <= -180000.0)
		tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j);
	elseif (c <= 3.85e-171)
		tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x);
	elseif (c <= 1e-33)
		tmp = Float64(Float64(y * Float64(Float64(Float64(x * z) / j) - i)) * j);
	else
		tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -4.5e+126], N[(N[(c * N[(t - N[(N[(b * z), $MachinePrecision] / j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[c, -180000.0], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[c, 3.85e-171], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[c, 1e-33], N[(N[(y * N[(N[(N[(x * z), $MachinePrecision] / j), $MachinePrecision] - i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.5 \cdot 10^{+126}:\\
\;\;\;\;\left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j\\

\mathbf{elif}\;c \leq -180000:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\

\mathbf{elif}\;c \leq 3.85 \cdot 10^{-171}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\

\mathbf{elif}\;c \leq 10^{-33}:\\
\;\;\;\;\left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -4.49999999999999974e126

    1. Initial program 70.3%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites65.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
      2. lower--.f64N/A

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
      3. lower-/.f64N/A

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
      4. lift-*.f6468.8

        \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]
    7. Applied rewrites68.8%

      \[\leadsto \left(c \cdot \left(t - \frac{b \cdot z}{j}\right)\right) \cdot j \]

    if -4.49999999999999974e126 < c < -1.8e5

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6460.2

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites60.2%

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

    if -1.8e5 < c < 3.8499999999999998e-171

    1. Initial program 78.5%

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      3. lower-*.f64N/A

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

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      7. associate-*r*N/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      8. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      9. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t + y \cdot z\right) \cdot x \]
      10. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t + y \cdot z\right) \cdot x \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right) \cdot x \]
      12. lower-neg.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6455.2

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites55.2%

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

    if 3.8499999999999998e-171 < c < 1.0000000000000001e-33

    1. Initial program 80.4%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites80.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in y around inf

      \[\leadsto \left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j \]
      2. lower--.f64N/A

        \[\leadsto \left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j \]
      3. lower-/.f64N/A

        \[\leadsto \left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j \]
      4. lower-*.f6474.3

        \[\leadsto \left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j \]
    7. Applied rewrites74.3%

      \[\leadsto \left(y \cdot \left(\frac{x \cdot z}{j} - i\right)\right) \cdot j \]

    if 1.0000000000000001e-33 < c

    1. Initial program 55.1%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites58.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6466.3

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites66.3%

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

Alternative 3: 71.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right)\\ \mathbf{if}\;j \leq -9.4 \cdot 10^{+114} \lor \neg \left(j \leq 9.5 \cdot 10^{+34}\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, x, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (fma (- a) t (* z y))))
   (if (or (<= j -9.4e+114) (not (<= j 9.5e+34)))
     (fma t_1 x (* (fma (- i) y (* c t)) j))
     (fma t_1 x (* (- b) (fma (- a) i (* c z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = fma(-a, t, (z * y));
	double tmp;
	if ((j <= -9.4e+114) || !(j <= 9.5e+34)) {
		tmp = fma(t_1, x, (fma(-i, y, (c * t)) * j));
	} else {
		tmp = fma(t_1, x, (-b * fma(-a, i, (c * z))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = fma(Float64(-a), t, Float64(z * y))
	tmp = 0.0
	if ((j <= -9.4e+114) || !(j <= 9.5e+34))
		tmp = fma(t_1, x, Float64(fma(Float64(-i), y, Float64(c * t)) * j));
	else
		tmp = fma(t_1, x, Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[j, -9.4e+114], N[Not[LessEqual[j, 9.5e+34]], $MachinePrecision]], N[(t$95$1 * x + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x + N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right)\\
\mathbf{if}\;j \leq -9.4 \cdot 10^{+114} \lor \neg \left(j \leq 9.5 \cdot 10^{+34}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, x, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -9.4000000000000001e114 or 9.4999999999999999e34 < j

    1. Initial program 71.5%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites80.4%

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

    if -9.4000000000000001e114 < j < 9.4999999999999999e34

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \left(c \cdot z - a \cdot i\right)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      8. associate-*r*N/A

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

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      10. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - a \cdot i\right)\right) \]
    5. Applied rewrites75.5%

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

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

Alternative 4: 68.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.05 \cdot 10^{+163} \lor \neg \left(b \leq 8.5 \cdot 10^{+64}\right):\\ \;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= b -2.05e+163) (not (<= b 8.5e+64)))
   (* (fma i a (* (- c) z)) b)
   (fma (fma (- a) t (* z y)) x (* (fma (- i) y (* c t)) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((b <= -2.05e+163) || !(b <= 8.5e+64)) {
		tmp = fma(i, a, (-c * z)) * b;
	} else {
		tmp = fma(fma(-a, t, (z * y)), x, (fma(-i, y, (c * t)) * j));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((b <= -2.05e+163) || !(b <= 8.5e+64))
		tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b);
	else
		tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(fma(Float64(-i), y, Float64(c * t)) * j));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[b, -2.05e+163], N[Not[LessEqual[b, 8.5e+64]], $MachinePrecision]], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.05 \cdot 10^{+163} \lor \neg \left(b \leq 8.5 \cdot 10^{+64}\right):\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.05e163 or 8.4999999999999998e64 < b

    1. Initial program 68.6%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6465.6

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites65.6%

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

    if -2.05e163 < b < 8.4999999999999998e64

    1. Initial program 74.9%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites71.7%

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

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

Alternative 5: 51.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\ \mathbf{if}\;i \leq -1.26 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -4.2 \cdot 10^{-12}:\\ \;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\ \mathbf{elif}\;i \leq 2.7 \cdot 10^{-164}:\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{elif}\;i \leq 3 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- i) (fma j y (* (- a) b)))))
   (if (<= i -1.26e+67)
     t_1
     (if (<= i -4.2e-12)
       (* (fma (- i) y (* c t)) j)
       (if (<= i 2.7e-164)
         (* (fma (- a) t (* z y)) x)
         (if (<= i 3e+70) (* (fma y x (* (- b) c)) z) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = -i * fma(j, y, (-a * b));
	double tmp;
	if (i <= -1.26e+67) {
		tmp = t_1;
	} else if (i <= -4.2e-12) {
		tmp = fma(-i, y, (c * t)) * j;
	} else if (i <= 2.7e-164) {
		tmp = fma(-a, t, (z * y)) * x;
	} else if (i <= 3e+70) {
		tmp = fma(y, x, (-b * c)) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b)))
	tmp = 0.0
	if (i <= -1.26e+67)
		tmp = t_1;
	elseif (i <= -4.2e-12)
		tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j);
	elseif (i <= 2.7e-164)
		tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x);
	elseif (i <= 3e+70)
		tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.26e+67], t$95$1, If[LessEqual[i, -4.2e-12], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[i, 2.7e-164], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 3e+70], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\mathbf{if}\;i \leq -1.26 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -4.2 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\

\mathbf{elif}\;i \leq 2.7 \cdot 10^{-164}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\

\mathbf{elif}\;i \leq 3 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -1.26e67 or 2.99999999999999976e70 < i

    1. Initial program 63.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot b}\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \left(-1 \cdot a\right) \cdot b\right) \]
      7. associate-*r*N/A

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, \color{blue}{y}, -1 \cdot \left(a \cdot b\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-1 \cdot a\right) \cdot b\right) \]
      10. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      12. lower-neg.f6466.6

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right) \]
    5. Applied rewrites66.6%

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

    if -1.26e67 < i < -4.19999999999999988e-12

    1. Initial program 65.1%

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

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

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

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

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6457.2

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites57.2%

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

    if -4.19999999999999988e-12 < i < 2.7000000000000001e-164

    1. Initial program 84.3%

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      3. lower-*.f64N/A

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

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      7. associate-*r*N/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      8. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      9. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t + y \cdot z\right) \cdot x \]
      10. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t + y \cdot z\right) \cdot x \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right) \cdot x \]
      12. lower-neg.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6458.6

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites58.6%

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

    if 2.7000000000000001e-164 < i < 2.99999999999999976e70

    1. Initial program 75.3%

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

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

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

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

        \[\leadsto \left(x \cdot y + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      7. lower-neg.f6458.6

        \[\leadsto \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z \]
    5. Applied rewrites58.6%

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

Alternative 6: 45.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{if}\;y \leq -1 \cdot 10^{-29}:\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{-103}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{elif}\;y \leq 1.76 \cdot 10^{+47}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (fma i a (* (- c) z)) b)))
   (if (<= y -1e-29)
     (* (fma y x (* (- b) c)) z)
     (if (<= y -1.4e-186)
       t_1
       (if (<= y 1.08e-103)
         (* c (- (* j t) (* b z)))
         (if (<= y 1.76e+47) t_1 (* z (- (* x y) (* b c)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = fma(i, a, (-c * z)) * b;
	double tmp;
	if (y <= -1e-29) {
		tmp = fma(y, x, (-b * c)) * z;
	} else if (y <= -1.4e-186) {
		tmp = t_1;
	} else if (y <= 1.08e-103) {
		tmp = c * ((j * t) - (b * z));
	} else if (y <= 1.76e+47) {
		tmp = t_1;
	} else {
		tmp = z * ((x * y) - (b * c));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b)
	tmp = 0.0
	if (y <= -1e-29)
		tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z);
	elseif (y <= -1.4e-186)
		tmp = t_1;
	elseif (y <= 1.08e-103)
		tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z)));
	elseif (y <= 1.76e+47)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[y, -1e-29], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, -1.4e-186], t$95$1, If[LessEqual[y, 1.08e-103], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.76e+47], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.08 \cdot 10^{-103}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\

\mathbf{elif}\;y \leq 1.76 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.99999999999999943e-30

    1. Initial program 72.6%

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

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

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

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

        \[\leadsto \left(x \cdot y + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      7. lower-neg.f6453.2

        \[\leadsto \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z \]
    5. Applied rewrites53.2%

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

    if -9.99999999999999943e-30 < y < -1.39999999999999992e-186 or 1.0799999999999999e-103 < y < 1.76e47

    1. Initial program 88.4%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6455.6

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites55.6%

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

    if -1.39999999999999992e-186 < y < 1.0799999999999999e-103

    1. Initial program 76.8%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites67.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6458.1

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites58.1%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]

    if 1.76e47 < y

    1. Initial program 51.2%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites53.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto z \cdot \left(x \cdot y - \color{blue}{b \cdot c}\right) \]
      3. lower-*.f64N/A

        \[\leadsto z \cdot \left(x \cdot y - \color{blue}{b} \cdot c\right) \]
      4. lower-*.f6455.4

        \[\leadsto z \cdot \left(x \cdot y - b \cdot \color{blue}{c}\right) \]
    7. Applied rewrites55.4%

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 7: 45.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\ t_2 := z \cdot \left(x \cdot y - b \cdot c\right)\\ \mathbf{if}\;y \leq -1 \cdot 10^{-29}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{-103}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{elif}\;y \leq 1.14 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (fma i a (* (- c) z)) b)) (t_2 (* z (- (* x y) (* b c)))))
   (if (<= y -1e-29)
     t_2
     (if (<= y -1.4e-186)
       t_1
       (if (<= y 1.08e-103)
         (* c (- (* j t) (* b z)))
         (if (<= y 1.14e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = fma(i, a, (-c * z)) * b;
	double t_2 = z * ((x * y) - (b * c));
	double tmp;
	if (y <= -1e-29) {
		tmp = t_2;
	} else if (y <= -1.4e-186) {
		tmp = t_1;
	} else if (y <= 1.08e-103) {
		tmp = c * ((j * t) - (b * z));
	} else if (y <= 1.14e+49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b)
	t_2 = Float64(z * Float64(Float64(x * y) - Float64(b * c)))
	tmp = 0.0
	if (y <= -1e-29)
		tmp = t_2;
	elseif (y <= -1.4e-186)
		tmp = t_1;
	elseif (y <= 1.08e-103)
		tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z)));
	elseif (y <= 1.14e+49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-29], t$95$2, If[LessEqual[y, -1.4e-186], t$95$1, If[LessEqual[y, 1.08e-103], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.14e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
t_2 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.08 \cdot 10^{-103}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\

\mathbf{elif}\;y \leq 1.14 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.99999999999999943e-30 or 1.13999999999999994e49 < y

    1. Initial program 63.3%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto z \cdot \left(x \cdot y - \color{blue}{b \cdot c}\right) \]
      3. lower-*.f64N/A

        \[\leadsto z \cdot \left(x \cdot y - \color{blue}{b} \cdot c\right) \]
      4. lower-*.f6454.6

        \[\leadsto z \cdot \left(x \cdot y - b \cdot \color{blue}{c}\right) \]
    7. Applied rewrites54.6%

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]

    if -9.99999999999999943e-30 < y < -1.39999999999999992e-186 or 1.0799999999999999e-103 < y < 1.13999999999999994e49

    1. Initial program 88.6%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6454.7

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites54.7%

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

    if -1.39999999999999992e-186 < y < 1.0799999999999999e-103

    1. Initial program 76.8%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites67.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6458.1

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites58.1%

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

Alternative 8: 58.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\ \mathbf{if}\;i \leq -9.5 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 6.2 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t\right) \cdot j\right)\\ \mathbf{elif}\;i \leq 2.95 \cdot 10^{+70}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- i) (fma j y (* (- a) b)))))
   (if (<= i -9.5e+49)
     t_1
     (if (<= i 6.2e-30)
       (fma (fma (- a) t (* z y)) x (* (* c t) j))
       (if (<= i 2.95e+70) (* c (- (* j t) (* b z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = -i * fma(j, y, (-a * b));
	double tmp;
	if (i <= -9.5e+49) {
		tmp = t_1;
	} else if (i <= 6.2e-30) {
		tmp = fma(fma(-a, t, (z * y)), x, ((c * t) * j));
	} else if (i <= 2.95e+70) {
		tmp = c * ((j * t) - (b * z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b)))
	tmp = 0.0
	if (i <= -9.5e+49)
		tmp = t_1;
	elseif (i <= 6.2e-30)
		tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(c * t) * j));
	elseif (i <= 2.95e+70)
		tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -9.5e+49], t$95$1, If[LessEqual[i, 6.2e-30], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.95e+70], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\mathbf{if}\;i \leq -9.5 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq 6.2 \cdot 10^{-30}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t\right) \cdot j\right)\\

\mathbf{elif}\;i \leq 2.95 \cdot 10^{+70}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -9.49999999999999969e49 or 2.9500000000000001e70 < i

    1. Initial program 64.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot b}\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \left(-1 \cdot a\right) \cdot b\right) \]
      7. associate-*r*N/A

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, \color{blue}{y}, -1 \cdot \left(a \cdot b\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-1 \cdot a\right) \cdot b\right) \]
      10. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      12. lower-neg.f6465.1

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right) \]
    5. Applied rewrites65.1%

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

    if -9.49999999999999969e49 < i < 6.19999999999999982e-30

    1. Initial program 78.4%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites72.4%

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t\right) \cdot j\right) \]
    7. Step-by-step derivation
      1. lift-*.f6465.6

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t\right) \cdot j\right) \]
    8. Applied rewrites65.6%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t\right) \cdot j\right) \]

    if 6.19999999999999982e-30 < i < 2.9500000000000001e70

    1. Initial program 80.6%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites56.6%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6465.9

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites65.9%

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

Alternative 9: 28.6% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot i\right) \cdot b\\ \mathbf{if}\;i \leq -1.05 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\ \;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a i) b)))
   (if (<= i -1.05e+82)
     t_1
     (if (<= i -9e-13)
       (* (* (- i) j) y)
       (if (<= i 2.3e-36)
         (* x (* y z))
         (if (<= i 5.8e+68) (* (* (- c) z) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.05e+82) {
		tmp = t_1;
	} else if (i <= -9e-13) {
		tmp = (-i * j) * y;
	} else if (i <= 2.3e-36) {
		tmp = x * (y * z);
	} else if (i <= 5.8e+68) {
		tmp = (-c * z) * b;
	} else {
		tmp = t_1;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * i) * b
    if (i <= (-1.05d+82)) then
        tmp = t_1
    else if (i <= (-9d-13)) then
        tmp = (-i * j) * y
    else if (i <= 2.3d-36) then
        tmp = x * (y * z)
    else if (i <= 5.8d+68) then
        tmp = (-c * z) * b
    else
        tmp = t_1
    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 j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.05e+82) {
		tmp = t_1;
	} else if (i <= -9e-13) {
		tmp = (-i * j) * y;
	} else if (i <= 2.3e-36) {
		tmp = x * (y * z);
	} else if (i <= 5.8e+68) {
		tmp = (-c * z) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * i) * b
	tmp = 0
	if i <= -1.05e+82:
		tmp = t_1
	elif i <= -9e-13:
		tmp = (-i * j) * y
	elif i <= 2.3e-36:
		tmp = x * (y * z)
	elif i <= 5.8e+68:
		tmp = (-c * z) * b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * i) * b)
	tmp = 0.0
	if (i <= -1.05e+82)
		tmp = t_1;
	elseif (i <= -9e-13)
		tmp = Float64(Float64(Float64(-i) * j) * y);
	elseif (i <= 2.3e-36)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 5.8e+68)
		tmp = Float64(Float64(Float64(-c) * z) * b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * i) * b;
	tmp = 0.0;
	if (i <= -1.05e+82)
		tmp = t_1;
	elseif (i <= -9e-13)
		tmp = (-i * j) * y;
	elseif (i <= 2.3e-36)
		tmp = x * (y * z);
	elseif (i <= 5.8e+68)
		tmp = (-c * z) * b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -1.05e+82], t$95$1, If[LessEqual[i, -9e-13], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[i, 2.3e-36], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 5.8e+68], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;i \leq -1.05 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\

\mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -1.05e82 or 5.80000000000000023e68 < i

    1. Initial program 64.3%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6454.4

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

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

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6447.3

        \[\leadsto \left(a \cdot i\right) \cdot b \]
    8. Applied rewrites47.3%

      \[\leadsto \left(a \cdot i\right) \cdot b \]

    if -1.05e82 < i < -9e-13

    1. Initial program 61.1%

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6446.0

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites46.0%

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

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
      2. lower-*.f6437.5

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    8. Applied rewrites37.5%

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]

    if -9e-13 < i < 2.29999999999999996e-36

    1. Initial program 80.7%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites73.6%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.5

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

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

    if 2.29999999999999996e-36 < i < 5.80000000000000023e68

    1. Initial program 81.4%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6444.2

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites44.2%

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
      2. lower-*.f6439.7

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    8. Applied rewrites39.7%

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
  3. Recombined 4 regimes into one program.
  4. Final simplification40.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.05 \cdot 10^{+82}:\\ \;\;\;\;\left(a \cdot i\right) \cdot b\\ \mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\ \;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot i\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 28.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot i\right) \cdot b\\ \mathbf{if}\;i \leq -1.1 \cdot 10^{+84}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -3.8 \cdot 10^{-106}:\\ \;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a i) b)))
   (if (<= i -1.1e+84)
     t_1
     (if (<= i -3.8e-106)
       (* (* (- a) x) t)
       (if (<= i 2.3e-36)
         (* x (* y z))
         (if (<= i 5.8e+68) (* (* (- c) z) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.1e+84) {
		tmp = t_1;
	} else if (i <= -3.8e-106) {
		tmp = (-a * x) * t;
	} else if (i <= 2.3e-36) {
		tmp = x * (y * z);
	} else if (i <= 5.8e+68) {
		tmp = (-c * z) * b;
	} else {
		tmp = t_1;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * i) * b
    if (i <= (-1.1d+84)) then
        tmp = t_1
    else if (i <= (-3.8d-106)) then
        tmp = (-a * x) * t
    else if (i <= 2.3d-36) then
        tmp = x * (y * z)
    else if (i <= 5.8d+68) then
        tmp = (-c * z) * b
    else
        tmp = t_1
    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 j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.1e+84) {
		tmp = t_1;
	} else if (i <= -3.8e-106) {
		tmp = (-a * x) * t;
	} else if (i <= 2.3e-36) {
		tmp = x * (y * z);
	} else if (i <= 5.8e+68) {
		tmp = (-c * z) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * i) * b
	tmp = 0
	if i <= -1.1e+84:
		tmp = t_1
	elif i <= -3.8e-106:
		tmp = (-a * x) * t
	elif i <= 2.3e-36:
		tmp = x * (y * z)
	elif i <= 5.8e+68:
		tmp = (-c * z) * b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * i) * b)
	tmp = 0.0
	if (i <= -1.1e+84)
		tmp = t_1;
	elseif (i <= -3.8e-106)
		tmp = Float64(Float64(Float64(-a) * x) * t);
	elseif (i <= 2.3e-36)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 5.8e+68)
		tmp = Float64(Float64(Float64(-c) * z) * b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * i) * b;
	tmp = 0.0;
	if (i <= -1.1e+84)
		tmp = t_1;
	elseif (i <= -3.8e-106)
		tmp = (-a * x) * t;
	elseif (i <= 2.3e-36)
		tmp = x * (y * z);
	elseif (i <= 5.8e+68)
		tmp = (-c * z) * b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -1.1e+84], t$95$1, If[LessEqual[i, -3.8e-106], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[i, 2.3e-36], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 5.8e+68], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;i \leq -1.1 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -3.8 \cdot 10^{-106}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\

\mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -1.0999999999999999e84 or 5.80000000000000023e68 < i

    1. Initial program 65.0%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6453.9

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites53.9%

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

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6446.8

        \[\leadsto \left(a \cdot i\right) \cdot b \]
    8. Applied rewrites46.8%

      \[\leadsto \left(a \cdot i\right) \cdot b \]

    if -1.0999999999999999e84 < i < -3.7999999999999999e-106

    1. Initial program 68.9%

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot x + c \cdot j\right) \cdot t \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x + c \cdot j\right) \cdot t \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), x, c \cdot j\right) \cdot t \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x, c \cdot j\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
      8. lower-*.f6450.6

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
    5. Applied rewrites50.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    6. Taylor expanded in x around inf

      \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
      2. lower-*.f6431.4

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
    8. Applied rewrites31.4%

      \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]

    if -3.7999999999999999e-106 < i < 2.29999999999999996e-36

    1. Initial program 80.2%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites74.7%

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

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

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

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

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

    if 2.29999999999999996e-36 < i < 5.80000000000000023e68

    1. Initial program 81.4%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6444.2

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites44.2%

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
      2. lower-*.f6439.7

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    8. Applied rewrites39.7%

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
  3. Recombined 4 regimes into one program.
  4. Final simplification40.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{+84}:\\ \;\;\;\;\left(a \cdot i\right) \cdot b\\ \mathbf{elif}\;i \leq -3.8 \cdot 10^{-106}:\\ \;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot i\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 28.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot i\right) \cdot b\\ \mathbf{if}\;i \leq -1.3 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a i) b)))
   (if (<= i -1.3e+82)
     t_1
     (if (<= i -9e-13)
       (* (- i) (* j y))
       (if (<= i 2.3e-36)
         (* x (* y z))
         (if (<= i 5.8e+68) (* (* (- c) z) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.3e+82) {
		tmp = t_1;
	} else if (i <= -9e-13) {
		tmp = -i * (j * y);
	} else if (i <= 2.3e-36) {
		tmp = x * (y * z);
	} else if (i <= 5.8e+68) {
		tmp = (-c * z) * b;
	} else {
		tmp = t_1;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * i) * b
    if (i <= (-1.3d+82)) then
        tmp = t_1
    else if (i <= (-9d-13)) then
        tmp = -i * (j * y)
    else if (i <= 2.3d-36) then
        tmp = x * (y * z)
    else if (i <= 5.8d+68) then
        tmp = (-c * z) * b
    else
        tmp = t_1
    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 j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.3e+82) {
		tmp = t_1;
	} else if (i <= -9e-13) {
		tmp = -i * (j * y);
	} else if (i <= 2.3e-36) {
		tmp = x * (y * z);
	} else if (i <= 5.8e+68) {
		tmp = (-c * z) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * i) * b
	tmp = 0
	if i <= -1.3e+82:
		tmp = t_1
	elif i <= -9e-13:
		tmp = -i * (j * y)
	elif i <= 2.3e-36:
		tmp = x * (y * z)
	elif i <= 5.8e+68:
		tmp = (-c * z) * b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * i) * b)
	tmp = 0.0
	if (i <= -1.3e+82)
		tmp = t_1;
	elseif (i <= -9e-13)
		tmp = Float64(Float64(-i) * Float64(j * y));
	elseif (i <= 2.3e-36)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 5.8e+68)
		tmp = Float64(Float64(Float64(-c) * z) * b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * i) * b;
	tmp = 0.0;
	if (i <= -1.3e+82)
		tmp = t_1;
	elseif (i <= -9e-13)
		tmp = -i * (j * y);
	elseif (i <= 2.3e-36)
		tmp = x * (y * z);
	elseif (i <= 5.8e+68)
		tmp = (-c * z) * b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -1.3e+82], t$95$1, If[LessEqual[i, -9e-13], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.3e-36], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 5.8e+68], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;i \leq -1.3 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\

\mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -1.2999999999999999e82 or 5.80000000000000023e68 < i

    1. Initial program 64.3%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6454.4

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

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

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6447.3

        \[\leadsto \left(a \cdot i\right) \cdot b \]
    8. Applied rewrites47.3%

      \[\leadsto \left(a \cdot i\right) \cdot b \]

    if -1.2999999999999999e82 < i < -9e-13

    1. Initial program 61.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot b}\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \left(-1 \cdot a\right) \cdot b\right) \]
      7. associate-*r*N/A

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, \color{blue}{y}, -1 \cdot \left(a \cdot b\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-1 \cdot a\right) \cdot b\right) \]
      10. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      12. lower-neg.f6440.5

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right) \]
    5. Applied rewrites40.5%

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

      \[\leadsto \left(-i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
    7. Step-by-step derivation
      1. lower-*.f6433.4

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    8. Applied rewrites33.4%

      \[\leadsto \left(-i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]

    if -9e-13 < i < 2.29999999999999996e-36

    1. Initial program 80.7%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites73.6%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.5

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

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

    if 2.29999999999999996e-36 < i < 5.80000000000000023e68

    1. Initial program 81.4%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6444.2

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites44.2%

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
      2. lower-*.f6439.7

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    8. Applied rewrites39.7%

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
  3. Recombined 4 regimes into one program.
  4. Final simplification40.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.3 \cdot 10^{+82}:\\ \;\;\;\;\left(a \cdot i\right) \cdot b\\ \mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+68}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot i\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 51.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{if}\;c \leq -162000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 3.85 \cdot 10^{-171}:\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{elif}\;c \leq 10^{-33}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* c (- (* j t) (* b z)))))
   (if (<= c -162000.0)
     t_1
     (if (<= c 3.85e-171)
       (* (fma (- a) t (* z y)) x)
       (if (<= c 1e-33) (* (fma (- i) j (* z x)) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = c * ((j * t) - (b * z));
	double tmp;
	if (c <= -162000.0) {
		tmp = t_1;
	} else if (c <= 3.85e-171) {
		tmp = fma(-a, t, (z * y)) * x;
	} else if (c <= 1e-33) {
		tmp = fma(-i, j, (z * x)) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z)))
	tmp = 0.0
	if (c <= -162000.0)
		tmp = t_1;
	elseif (c <= 3.85e-171)
		tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x);
	elseif (c <= 1e-33)
		tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -162000.0], t$95$1, If[LessEqual[c, 3.85e-171], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[c, 1e-33], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{if}\;c \leq -162000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 3.85 \cdot 10^{-171}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\

\mathbf{elif}\;c \leq 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -162000 or 1.0000000000000001e-33 < c

    1. Initial program 67.3%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites64.6%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6462.4

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites62.4%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]

    if -162000 < c < 3.8499999999999998e-171

    1. Initial program 78.5%

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      3. lower-*.f64N/A

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

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      7. associate-*r*N/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      8. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      9. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t + y \cdot z\right) \cdot x \]
      10. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t + y \cdot z\right) \cdot x \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right) \cdot x \]
      12. lower-neg.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6455.2

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites55.2%

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

    if 3.8499999999999998e-171 < c < 1.0000000000000001e-33

    1. Initial program 80.4%

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6459.2

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites59.2%

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

Alternative 13: 41.4% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{if}\;c \leq -420000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -1.4 \cdot 10^{-107}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;c \leq 9.5 \cdot 10^{-40}:\\ \;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* c (- (* j t) (* b z)))))
   (if (<= c -420000.0)
     t_1
     (if (<= c -1.4e-107)
       (* x (* y z))
       (if (<= c 9.5e-40) (* (* (- a) x) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = c * ((j * t) - (b * z));
	double tmp;
	if (c <= -420000.0) {
		tmp = t_1;
	} else if (c <= -1.4e-107) {
		tmp = x * (y * z);
	} else if (c <= 9.5e-40) {
		tmp = (-a * x) * t;
	} else {
		tmp = t_1;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = c * ((j * t) - (b * z))
    if (c <= (-420000.0d0)) then
        tmp = t_1
    else if (c <= (-1.4d-107)) then
        tmp = x * (y * z)
    else if (c <= 9.5d-40) then
        tmp = (-a * x) * t
    else
        tmp = t_1
    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 j) {
	double t_1 = c * ((j * t) - (b * z));
	double tmp;
	if (c <= -420000.0) {
		tmp = t_1;
	} else if (c <= -1.4e-107) {
		tmp = x * (y * z);
	} else if (c <= 9.5e-40) {
		tmp = (-a * x) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = c * ((j * t) - (b * z))
	tmp = 0
	if c <= -420000.0:
		tmp = t_1
	elif c <= -1.4e-107:
		tmp = x * (y * z)
	elif c <= 9.5e-40:
		tmp = (-a * x) * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z)))
	tmp = 0.0
	if (c <= -420000.0)
		tmp = t_1;
	elseif (c <= -1.4e-107)
		tmp = Float64(x * Float64(y * z));
	elseif (c <= 9.5e-40)
		tmp = Float64(Float64(Float64(-a) * x) * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = c * ((j * t) - (b * z));
	tmp = 0.0;
	if (c <= -420000.0)
		tmp = t_1;
	elseif (c <= -1.4e-107)
		tmp = x * (y * z);
	elseif (c <= 9.5e-40)
		tmp = (-a * x) * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -420000.0], t$95$1, If[LessEqual[c, -1.4e-107], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.5e-40], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{if}\;c \leq -420000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq -1.4 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;c \leq 9.5 \cdot 10^{-40}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -4.2e5 or 9.5000000000000006e-40 < c

    1. Initial program 67.3%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites64.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6461.8

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites61.8%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]

    if -4.2e5 < c < -1.3999999999999999e-107

    1. Initial program 75.1%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites68.3%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.8

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

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

    if -1.3999999999999999e-107 < c < 9.5000000000000006e-40

    1. Initial program 80.1%

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot x + c \cdot j\right) \cdot t \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x + c \cdot j\right) \cdot t \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), x, c \cdot j\right) \cdot t \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x, c \cdot j\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
      8. lower-*.f6439.4

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
    5. Applied rewrites39.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    6. Taylor expanded in x around inf

      \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
      2. lower-*.f6436.1

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
    8. Applied rewrites36.1%

      \[\leadsto \left(-1 \cdot \left(a \cdot x\right)\right) \cdot t \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -420000:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{elif}\;c \leq -1.4 \cdot 10^{-107}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;c \leq 9.5 \cdot 10^{-40}:\\ \;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 28.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot i\right) \cdot b\\ \mathbf{if}\;i \leq -1.3 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;i \leq 10^{-64}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a i) b)))
   (if (<= i -1.3e+82)
     t_1
     (if (<= i -9e-13)
       (* (- i) (* j y))
       (if (<= i 1e-64)
         (* x (* y z))
         (if (<= i 3.4e+70) (* (* c t) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.3e+82) {
		tmp = t_1;
	} else if (i <= -9e-13) {
		tmp = -i * (j * y);
	} else if (i <= 1e-64) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = (c * t) * j;
	} else {
		tmp = t_1;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * i) * b
    if (i <= (-1.3d+82)) then
        tmp = t_1
    else if (i <= (-9d-13)) then
        tmp = -i * (j * y)
    else if (i <= 1d-64) then
        tmp = x * (y * z)
    else if (i <= 3.4d+70) then
        tmp = (c * t) * j
    else
        tmp = t_1
    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 j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -1.3e+82) {
		tmp = t_1;
	} else if (i <= -9e-13) {
		tmp = -i * (j * y);
	} else if (i <= 1e-64) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = (c * t) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * i) * b
	tmp = 0
	if i <= -1.3e+82:
		tmp = t_1
	elif i <= -9e-13:
		tmp = -i * (j * y)
	elif i <= 1e-64:
		tmp = x * (y * z)
	elif i <= 3.4e+70:
		tmp = (c * t) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * i) * b)
	tmp = 0.0
	if (i <= -1.3e+82)
		tmp = t_1;
	elseif (i <= -9e-13)
		tmp = Float64(Float64(-i) * Float64(j * y));
	elseif (i <= 1e-64)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 3.4e+70)
		tmp = Float64(Float64(c * t) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * i) * b;
	tmp = 0.0;
	if (i <= -1.3e+82)
		tmp = t_1;
	elseif (i <= -9e-13)
		tmp = -i * (j * y);
	elseif (i <= 1e-64)
		tmp = x * (y * z);
	elseif (i <= 3.4e+70)
		tmp = (c * t) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -1.3e+82], t$95$1, If[LessEqual[i, -9e-13], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1e-64], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.4e+70], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;i \leq -1.3 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -9 \cdot 10^{-13}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\

\mathbf{elif}\;i \leq 10^{-64}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -1.2999999999999999e82 or 3.4000000000000001e70 < i

    1. Initial program 63.9%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6455.0

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

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

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6447.8

        \[\leadsto \left(a \cdot i\right) \cdot b \]
    8. Applied rewrites47.8%

      \[\leadsto \left(a \cdot i\right) \cdot b \]

    if -1.2999999999999999e82 < i < -9e-13

    1. Initial program 61.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot b}\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y + \left(-1 \cdot a\right) \cdot b\right) \]
      7. associate-*r*N/A

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, \color{blue}{y}, -1 \cdot \left(a \cdot b\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-1 \cdot a\right) \cdot b\right) \]
      10. mul-1-negN/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      12. lower-neg.f6440.5

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right) \]
    5. Applied rewrites40.5%

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

      \[\leadsto \left(-i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
    7. Step-by-step derivation
      1. lower-*.f6433.4

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    8. Applied rewrites33.4%

      \[\leadsto \left(-i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]

    if -9e-13 < i < 9.99999999999999965e-65

    1. Initial program 80.7%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites73.3%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.3

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

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

    if 9.99999999999999965e-65 < i < 3.4000000000000001e70

    1. Initial program 81.8%

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

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

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

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

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6446.5

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites46.5%

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

      \[\leadsto \left(c \cdot t\right) \cdot j \]
    7. Step-by-step derivation
      1. lift-*.f6432.7

        \[\leadsto \left(c \cdot t\right) \cdot j \]
    8. Applied rewrites32.7%

      \[\leadsto \left(c \cdot t\right) \cdot j \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 15: 28.7% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot i\right) \cdot b\\ \mathbf{if}\;i \leq -4.8 \cdot 10^{+80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -4 \cdot 10^{-7}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \mathbf{elif}\;i \leq 10^{-64}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a i) b)))
   (if (<= i -4.8e+80)
     t_1
     (if (<= i -4e-7)
       (* c (* j t))
       (if (<= i 1e-64)
         (* x (* y z))
         (if (<= i 3.4e+70) (* (* c t) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -4.8e+80) {
		tmp = t_1;
	} else if (i <= -4e-7) {
		tmp = c * (j * t);
	} else if (i <= 1e-64) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = (c * t) * j;
	} else {
		tmp = t_1;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * i) * b
    if (i <= (-4.8d+80)) then
        tmp = t_1
    else if (i <= (-4d-7)) then
        tmp = c * (j * t)
    else if (i <= 1d-64) then
        tmp = x * (y * z)
    else if (i <= 3.4d+70) then
        tmp = (c * t) * j
    else
        tmp = t_1
    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 j) {
	double t_1 = (a * i) * b;
	double tmp;
	if (i <= -4.8e+80) {
		tmp = t_1;
	} else if (i <= -4e-7) {
		tmp = c * (j * t);
	} else if (i <= 1e-64) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = (c * t) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * i) * b
	tmp = 0
	if i <= -4.8e+80:
		tmp = t_1
	elif i <= -4e-7:
		tmp = c * (j * t)
	elif i <= 1e-64:
		tmp = x * (y * z)
	elif i <= 3.4e+70:
		tmp = (c * t) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * i) * b)
	tmp = 0.0
	if (i <= -4.8e+80)
		tmp = t_1;
	elseif (i <= -4e-7)
		tmp = Float64(c * Float64(j * t));
	elseif (i <= 1e-64)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 3.4e+70)
		tmp = Float64(Float64(c * t) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * i) * b;
	tmp = 0.0;
	if (i <= -4.8e+80)
		tmp = t_1;
	elseif (i <= -4e-7)
		tmp = c * (j * t);
	elseif (i <= 1e-64)
		tmp = x * (y * z);
	elseif (i <= 3.4e+70)
		tmp = (c * t) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -4.8e+80], t$95$1, If[LessEqual[i, -4e-7], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1e-64], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.4e+70], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;i \leq -4.8 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -4 \cdot 10^{-7}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\

\mathbf{elif}\;i \leq 10^{-64}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -4.79999999999999958e80 or 3.4000000000000001e70 < i

    1. Initial program 63.9%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6455.0

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

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

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6447.8

        \[\leadsto \left(a \cdot i\right) \cdot b \]
    8. Applied rewrites47.8%

      \[\leadsto \left(a \cdot i\right) \cdot b \]

    if -4.79999999999999958e80 < i < -3.9999999999999998e-7

    1. Initial program 59.4%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites69.1%

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

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
      2. lift-*.f6433.2

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    8. Applied rewrites33.2%

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]

    if -3.9999999999999998e-7 < i < 9.99999999999999965e-65

    1. Initial program 80.9%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites72.9%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.0

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

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

    if 9.99999999999999965e-65 < i < 3.4000000000000001e70

    1. Initial program 81.8%

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

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

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

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

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6446.5

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites46.5%

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

      \[\leadsto \left(c \cdot t\right) \cdot j \]
    7. Step-by-step derivation
      1. lift-*.f6432.7

        \[\leadsto \left(c \cdot t\right) \cdot j \]
    8. Applied rewrites32.7%

      \[\leadsto \left(c \cdot t\right) \cdot j \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 16: 28.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(j \cdot t\right)\\ t_2 := \left(a \cdot i\right) \cdot b\\ \mathbf{if}\;i \leq -4.8 \cdot 10^{+80}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;i \leq -4 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 2.05 \cdot 10^{-35}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* c (* j t))) (t_2 (* (* a i) b)))
   (if (<= i -4.8e+80)
     t_2
     (if (<= i -4e-7)
       t_1
       (if (<= i 2.05e-35) (* x (* y z)) (if (<= i 3.4e+70) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = c * (j * t);
	double t_2 = (a * i) * b;
	double tmp;
	if (i <= -4.8e+80) {
		tmp = t_2;
	} else if (i <= -4e-7) {
		tmp = t_1;
	} else if (i <= 2.05e-35) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = c * (j * t)
    t_2 = (a * i) * b
    if (i <= (-4.8d+80)) then
        tmp = t_2
    else if (i <= (-4d-7)) then
        tmp = t_1
    else if (i <= 2.05d-35) then
        tmp = x * (y * z)
    else if (i <= 3.4d+70) then
        tmp = t_1
    else
        tmp = t_2
    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 j) {
	double t_1 = c * (j * t);
	double t_2 = (a * i) * b;
	double tmp;
	if (i <= -4.8e+80) {
		tmp = t_2;
	} else if (i <= -4e-7) {
		tmp = t_1;
	} else if (i <= 2.05e-35) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = c * (j * t)
	t_2 = (a * i) * b
	tmp = 0
	if i <= -4.8e+80:
		tmp = t_2
	elif i <= -4e-7:
		tmp = t_1
	elif i <= 2.05e-35:
		tmp = x * (y * z)
	elif i <= 3.4e+70:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(c * Float64(j * t))
	t_2 = Float64(Float64(a * i) * b)
	tmp = 0.0
	if (i <= -4.8e+80)
		tmp = t_2;
	elseif (i <= -4e-7)
		tmp = t_1;
	elseif (i <= 2.05e-35)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 3.4e+70)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = c * (j * t);
	t_2 = (a * i) * b;
	tmp = 0.0;
	if (i <= -4.8e+80)
		tmp = t_2;
	elseif (i <= -4e-7)
		tmp = t_1;
	elseif (i <= 2.05e-35)
		tmp = x * (y * z);
	elseif (i <= 3.4e+70)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -4.8e+80], t$95$2, If[LessEqual[i, -4e-7], t$95$1, If[LessEqual[i, 2.05e-35], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.4e+70], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
t_2 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;i \leq -4.8 \cdot 10^{+80}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;i \leq -4 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -4.79999999999999958e80 or 3.4000000000000001e70 < i

    1. Initial program 63.9%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6455.0

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

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

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6447.8

        \[\leadsto \left(a \cdot i\right) \cdot b \]
    8. Applied rewrites47.8%

      \[\leadsto \left(a \cdot i\right) \cdot b \]

    if -4.79999999999999958e80 < i < -3.9999999999999998e-7 or 2.05000000000000013e-35 < i < 3.4000000000000001e70

    1. Initial program 70.9%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites62.6%

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

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
      2. lift-*.f6431.9

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    8. Applied rewrites31.9%

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]

    if -3.9999999999999998e-7 < i < 2.05000000000000013e-35

    1. Initial program 80.8%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites73.2%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.2

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

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

Alternative 17: 28.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(j \cdot t\right)\\ t_2 := a \cdot \left(b \cdot i\right)\\ \mathbf{if}\;i \leq -4.5 \cdot 10^{+81}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;i \leq -4 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 2.05 \cdot 10^{-35}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* c (* j t))) (t_2 (* a (* b i))))
   (if (<= i -4.5e+81)
     t_2
     (if (<= i -4e-7)
       t_1
       (if (<= i 2.05e-35) (* x (* y z)) (if (<= i 3.4e+70) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = c * (j * t);
	double t_2 = a * (b * i);
	double tmp;
	if (i <= -4.5e+81) {
		tmp = t_2;
	} else if (i <= -4e-7) {
		tmp = t_1;
	} else if (i <= 2.05e-35) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = c * (j * t)
    t_2 = a * (b * i)
    if (i <= (-4.5d+81)) then
        tmp = t_2
    else if (i <= (-4d-7)) then
        tmp = t_1
    else if (i <= 2.05d-35) then
        tmp = x * (y * z)
    else if (i <= 3.4d+70) then
        tmp = t_1
    else
        tmp = t_2
    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 j) {
	double t_1 = c * (j * t);
	double t_2 = a * (b * i);
	double tmp;
	if (i <= -4.5e+81) {
		tmp = t_2;
	} else if (i <= -4e-7) {
		tmp = t_1;
	} else if (i <= 2.05e-35) {
		tmp = x * (y * z);
	} else if (i <= 3.4e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = c * (j * t)
	t_2 = a * (b * i)
	tmp = 0
	if i <= -4.5e+81:
		tmp = t_2
	elif i <= -4e-7:
		tmp = t_1
	elif i <= 2.05e-35:
		tmp = x * (y * z)
	elif i <= 3.4e+70:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(c * Float64(j * t))
	t_2 = Float64(a * Float64(b * i))
	tmp = 0.0
	if (i <= -4.5e+81)
		tmp = t_2;
	elseif (i <= -4e-7)
		tmp = t_1;
	elseif (i <= 2.05e-35)
		tmp = Float64(x * Float64(y * z));
	elseif (i <= 3.4e+70)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = c * (j * t);
	t_2 = a * (b * i);
	tmp = 0.0;
	if (i <= -4.5e+81)
		tmp = t_2;
	elseif (i <= -4e-7)
		tmp = t_1;
	elseif (i <= 2.05e-35)
		tmp = x * (y * z);
	elseif (i <= 3.4e+70)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.5e+81], t$95$2, If[LessEqual[i, -4e-7], t$95$1, If[LessEqual[i, 2.05e-35], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.4e+70], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
t_2 := a \cdot \left(b \cdot i\right)\\
\mathbf{if}\;i \leq -4.5 \cdot 10^{+81}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;i \leq -4 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;i \leq 3.4 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -4.50000000000000017e81 or 3.4000000000000001e70 < i

    1. Initial program 63.9%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6455.0

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

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6444.7

        \[\leadsto a \cdot \left(b \cdot i\right) \]
    8. Applied rewrites44.7%

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

    if -4.50000000000000017e81 < i < -3.9999999999999998e-7 or 2.05000000000000013e-35 < i < 3.4000000000000001e70

    1. Initial program 70.9%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites62.6%

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

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
      2. lift-*.f6431.9

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    8. Applied rewrites31.9%

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]

    if -3.9999999999999998e-7 < i < 2.05000000000000013e-35

    1. Initial program 80.8%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites73.2%

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6436.2

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

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

Alternative 18: 50.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -162000 \lor \neg \left(c \leq 4.2 \cdot 10^{-36}\right):\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= c -162000.0) (not (<= c 4.2e-36)))
   (* c (- (* j t) (* b z)))
   (* (fma (- a) t (* z y)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((c <= -162000.0) || !(c <= 4.2e-36)) {
		tmp = c * ((j * t) - (b * z));
	} else {
		tmp = fma(-a, t, (z * y)) * x;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((c <= -162000.0) || !(c <= 4.2e-36))
		tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z)));
	else
		tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[c, -162000.0], N[Not[LessEqual[c, 4.2e-36]], $MachinePrecision]], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -162000 \lor \neg \left(c \leq 4.2 \cdot 10^{-36}\right):\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -162000 or 4.19999999999999982e-36 < c

    1. Initial program 67.5%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites64.9%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6461.9

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites61.9%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]

    if -162000 < c < 4.19999999999999982e-36

    1. Initial program 78.7%

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      3. lower-*.f64N/A

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

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      7. associate-*r*N/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      8. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      9. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t + y \cdot z\right) \cdot x \]
      10. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t + y \cdot z\right) \cdot x \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right) \cdot x \]
      12. lower-neg.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6452.7

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites52.7%

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

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

Alternative 19: 43.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-127} \lor \neg \left(y \leq 3.5 \cdot 10^{-9}\right):\\ \;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= y -1.45e-127) (not (<= y 3.5e-9)))
   (* z (- (* x y) (* b c)))
   (* c (- (* j t) (* b z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((y <= -1.45e-127) || !(y <= 3.5e-9)) {
		tmp = z * ((x * y) - (b * c));
	} else {
		tmp = c * ((j * t) - (b * z));
	}
	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, j)
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), intent (in) :: j
    real(8) :: tmp
    if ((y <= (-1.45d-127)) .or. (.not. (y <= 3.5d-9))) then
        tmp = z * ((x * y) - (b * c))
    else
        tmp = c * ((j * t) - (b * z))
    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 j) {
	double tmp;
	if ((y <= -1.45e-127) || !(y <= 3.5e-9)) {
		tmp = z * ((x * y) - (b * c));
	} else {
		tmp = c * ((j * t) - (b * z));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (y <= -1.45e-127) or not (y <= 3.5e-9):
		tmp = z * ((x * y) - (b * c))
	else:
		tmp = c * ((j * t) - (b * z))
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((y <= -1.45e-127) || !(y <= 3.5e-9))
		tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c)));
	else
		tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if ((y <= -1.45e-127) || ~((y <= 3.5e-9)))
		tmp = z * ((x * y) - (b * c));
	else
		tmp = c * ((j * t) - (b * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -1.45e-127], N[Not[LessEqual[y, 3.5e-9]], $MachinePrecision]], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-127} \lor \neg \left(y \leq 3.5 \cdot 10^{-9}\right):\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.45e-127 or 3.4999999999999999e-9 < y

    1. Initial program 69.4%

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

      \[\leadsto \color{blue}{j \cdot \left(\left(c \cdot t + \frac{x \cdot \left(y \cdot z - a \cdot t\right)}{j}\right) - \left(i \cdot y + \frac{b \cdot \left(c \cdot z - a \cdot i\right)}{j}\right)\right)} \]
    4. Applied rewrites66.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto z \cdot \left(x \cdot y - \color{blue}{b \cdot c}\right) \]
      3. lower-*.f64N/A

        \[\leadsto z \cdot \left(x \cdot y - \color{blue}{b} \cdot c\right) \]
      4. lower-*.f6450.1

        \[\leadsto z \cdot \left(x \cdot y - b \cdot \color{blue}{c}\right) \]
    7. Applied rewrites50.1%

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]

    if -1.45e-127 < y < 3.4999999999999999e-9

    1. Initial program 78.3%

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

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

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(-a, t, z \cdot y\right)}{j}, c \cdot t\right) - \mathsf{fma}\left(i, y, b \cdot \frac{\mathsf{fma}\left(-a, i, c \cdot z\right)}{j}\right)\right) \cdot j} \]
    5. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lift-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lift-*.f6452.3

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    7. Applied rewrites52.3%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-127} \lor \neg \left(y \leq 3.5 \cdot 10^{-9}\right):\\ \;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 28.9% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -4.5 \cdot 10^{+81} \lor \neg \left(i \leq 3.4 \cdot 10^{+70}\right):\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= i -4.5e+81) (not (<= i 3.4e+70))) (* a (* b i)) (* c (* j t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((i <= -4.5e+81) || !(i <= 3.4e+70)) {
		tmp = a * (b * i);
	} else {
		tmp = c * (j * t);
	}
	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, j)
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), intent (in) :: j
    real(8) :: tmp
    if ((i <= (-4.5d+81)) .or. (.not. (i <= 3.4d+70))) then
        tmp = a * (b * i)
    else
        tmp = c * (j * t)
    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 j) {
	double tmp;
	if ((i <= -4.5e+81) || !(i <= 3.4e+70)) {
		tmp = a * (b * i);
	} else {
		tmp = c * (j * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (i <= -4.5e+81) or not (i <= 3.4e+70):
		tmp = a * (b * i)
	else:
		tmp = c * (j * t)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((i <= -4.5e+81) || !(i <= 3.4e+70))
		tmp = Float64(a * Float64(b * i));
	else
		tmp = Float64(c * Float64(j * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if ((i <= -4.5e+81) || ~((i <= 3.4e+70)))
		tmp = a * (b * i);
	else
		tmp = c * (j * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -4.5e+81], N[Not[LessEqual[i, 3.4e+70]], $MachinePrecision]], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.5 \cdot 10^{+81} \lor \neg \left(i \leq 3.4 \cdot 10^{+70}\right):\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.50000000000000017e81 or 3.4000000000000001e70 < i

    1. Initial program 63.9%

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

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

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

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

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6455.0

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

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6444.7

        \[\leadsto a \cdot \left(b \cdot i\right) \]
    8. Applied rewrites44.7%

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

    if -4.50000000000000017e81 < i < 3.4000000000000001e70

    1. Initial program 78.2%

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

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \mathsf{fma}\left(y \cdot z + \left(-1 \cdot a\right) \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z + -1 \cdot \left(a \cdot t\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(a \cdot t\right) + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot a\right) \cdot t + y \cdot z, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      11. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right), x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      13. lower-neg.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    5. Applied rewrites70.3%

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

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
      2. lift-*.f6424.3

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    8. Applied rewrites24.3%

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -4.5 \cdot 10^{+81} \lor \neg \left(i \leq 3.4 \cdot 10^{+70}\right):\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 22.1% accurate, 5.5× speedup?

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

\\
a \cdot \left(b \cdot i\right)
\end{array}
Derivation
  1. Initial program 73.0%

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

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

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

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

      \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    4. *-commutativeN/A

      \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    5. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    6. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
    7. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    9. lower-neg.f6437.9

      \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
  5. Applied rewrites37.9%

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

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
    2. lower-*.f6420.7

      \[\leadsto a \cdot \left(b \cdot i\right) \]
  8. Applied rewrites20.7%

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  9. Add Preprocessing

Developer Target 1: 69.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\ t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\ \mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (+
          (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
          (/
           (* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
           (+ (* c t) (* i y)))))
        (t_2
         (-
          (* x (- (* z y) (* a t)))
          (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
   (if (< t -8.120978919195912e-33)
     t_2
     (if (< t -4.712553818218485e-169)
       t_1
       (if (< t -7.633533346031584e-308)
         t_2
         (if (< t 1.0535888557455487e-139) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
	double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
	double tmp;
	if (t < -8.120978919195912e-33) {
		tmp = t_2;
	} else if (t < -4.712553818218485e-169) {
		tmp = t_1;
	} else if (t < -7.633533346031584e-308) {
		tmp = t_2;
	} else if (t < 1.0535888557455487e-139) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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, j)
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), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
    t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
    if (t < (-8.120978919195912d-33)) then
        tmp = t_2
    else if (t < (-4.712553818218485d-169)) then
        tmp = t_1
    else if (t < (-7.633533346031584d-308)) then
        tmp = t_2
    else if (t < 1.0535888557455487d-139) then
        tmp = t_1
    else
        tmp = t_2
    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 j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
	double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
	double tmp;
	if (t < -8.120978919195912e-33) {
		tmp = t_2;
	} else if (t < -4.712553818218485e-169) {
		tmp = t_1;
	} else if (t < -7.633533346031584e-308) {
		tmp = t_2;
	} else if (t < 1.0535888557455487e-139) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y)))
	t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
	tmp = 0
	if t < -8.120978919195912e-33:
		tmp = t_2
	elif t < -4.712553818218485e-169:
		tmp = t_1
	elif t < -7.633533346031584e-308:
		tmp = t_2
	elif t < 1.0535888557455487e-139:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y))))
	t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j)))
	tmp = 0.0
	if (t < -8.120978919195912e-33)
		tmp = t_2;
	elseif (t < -4.712553818218485e-169)
		tmp = t_1;
	elseif (t < -7.633533346031584e-308)
		tmp = t_2;
	elseif (t < 1.0535888557455487e-139)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y)));
	t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
	tmp = 0.0;
	if (t < -8.120978919195912e-33)
		tmp = t_2;
	elseif (t < -4.712553818218485e-169)
		tmp = t_1;
	elseif (t < -7.633533346031584e-308)
		tmp = t_2;
	elseif (t < 1.0535888557455487e-139)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2025073 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))