Data.Colour.Matrix:determinant from colour-2.3.3, A

Percentage Accurate: 73.0% → 80.0%
Time: 11.5s
Alternatives: 19
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (+
  (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
  (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * 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 ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j):
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 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: 73.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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (+
  (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
  (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * 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 ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j):
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 80.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-81}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, t, \frac{\mathsf{fma}\left(t\_1, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)}{b}\right) - c \cdot z\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.5999999999999998e207

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

    if -2.5999999999999998e207 < z < 3.09999999999999988e-81

    1. Initial program 73.0%

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

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

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

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

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

    if 3.09999999999999988e-81 < z

    1. Initial program 73.0%

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

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

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

Alternative 2: 72.7% 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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(\frac{y \cdot z}{t} - a\right)\right) \cdot x\right)\\ \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) (* t i))))
          (* j (- (* c a) (* y i))))))
   (if (<= t_1 INFINITY)
     t_1
     (fma (- (* c a) (* i y)) j (* (* t (- (/ (* y z) t) a)) x)))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(((c * a) - (i * y)), j, ((t * (((y * z) / t) - a)) * x));
	}
	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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(t * Float64(Float64(Float64(y * z) / t) - a)) * x));
	end
	return 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\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 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0

    1. Initial program 73.0%

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

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

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(\frac{y \cdot z}{t} - a\right)\right) \cdot x\right) \]
      4. lower-*.f6459.5

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

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

Alternative 3: 70.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(z, y, -b \cdot \frac{c \cdot z - i \cdot t}{x}\right) - a \cdot t\right) \cdot x + j \cdot \left(a \cdot c\right)\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{+234}:\\ \;\;\;\;\left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \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
         (+
          (* (- (fma z y (- (* b (/ (- (* c z) (* i t)) x)))) (* a t)) x)
          (* j (* a c)))))
   (if (<= x -4.4e+234)
     (* (* x (/ (* t (- (/ (* y z) t) a)) b)) b)
     (if (<= x -8.5e-137)
       t_1
       (if (<= x 7.2e-167)
         (fma (* j c) a (- (* i (- (* b t) (* j y))) (* (* c 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 = ((fma(z, y, -(b * (((c * z) - (i * t)) / x))) - (a * t)) * x) + (j * (a * c));
	double tmp;
	if (x <= -4.4e+234) {
		tmp = (x * ((t * (((y * z) / t) - a)) / b)) * b;
	} else if (x <= -8.5e-137) {
		tmp = t_1;
	} else if (x <= 7.2e-167) {
		tmp = fma((j * c), a, ((i * ((b * t) - (j * y))) - ((c * b) * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(fma(z, y, Float64(-Float64(b * Float64(Float64(Float64(c * z) - Float64(i * t)) / x)))) - Float64(a * t)) * x) + Float64(j * Float64(a * c)))
	tmp = 0.0
	if (x <= -4.4e+234)
		tmp = Float64(Float64(x * Float64(Float64(t * Float64(Float64(Float64(y * z) / t) - a)) / b)) * b);
	elseif (x <= -8.5e-137)
		tmp = t_1;
	elseif (x <= 7.2e-167)
		tmp = fma(Float64(j * c), a, Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) - Float64(Float64(c * 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[(N[(N[(N[(z * y + (-N[(b * N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+234], N[(N[(x * N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, -8.5e-137], t$95$1, If[LessEqual[x, 7.2e-167], N[(N[(j * c), $MachinePrecision] * a + N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(z, y, -b \cdot \frac{c \cdot z - i \cdot t}{x}\right) - a \cdot t\right) \cdot x + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+234}:\\
\;\;\;\;\left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.40000000000000015e234

    1. Initial program 73.0%

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\frac{y \cdot z}{b} - \frac{a \cdot t}{b}\right)\right) \cdot b \]
      2. sub-divN/A

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

        \[\leadsto \left(x \cdot \frac{y \cdot z - a \cdot t}{b}\right) \cdot b \]
      4. lower--.f64N/A

        \[\leadsto \left(x \cdot \frac{y \cdot z - a \cdot t}{b}\right) \cdot b \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \frac{y \cdot z - a \cdot t}{b}\right) \cdot b \]
      6. lift-*.f6437.5

        \[\leadsto \left(x \cdot \frac{y \cdot z - a \cdot t}{b}\right) \cdot b \]
    7. Applied rewrites37.5%

      \[\leadsto \left(x \cdot \frac{y \cdot z - a \cdot t}{b}\right) \cdot b \]
    8. Taylor expanded in t around inf

      \[\leadsto \left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b \]
      4. lift-*.f6438.3

        \[\leadsto \left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b \]
    10. Applied rewrites38.3%

      \[\leadsto \left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b \]

    if -4.40000000000000015e234 < x < -8.5000000000000001e-137 or 7.2000000000000002e-167 < x

    1. Initial program 73.0%

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(z, y, -b \cdot \frac{c \cdot z - i \cdot t}{x}\right) - a \cdot t\right) \cdot x + j \cdot \color{blue}{\left(a \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f6462.8

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

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

    if -8.5000000000000001e-137 < x < 7.2000000000000002e-167

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \cdot z\right) \]
      4. lift-*.f6456.4

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

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

Alternative 4: 69.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\ \mathbf{if}\;x \leq -1.95 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \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 (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))))
   (if (<= x -1.95e+93)
     t_1
     (if (<= x 1.9e-34)
       (fma (* j c) a (- (* i (- (* b t) (* j y))) (* (* c 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 = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
	double tmp;
	if (x <= -1.95e+93) {
		tmp = t_1;
	} else if (x <= 1.9e-34) {
		tmp = fma((j * c), a, ((i * ((b * t) - (j * y))) - ((c * b) * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x))
	tmp = 0.0
	if (x <= -1.95e+93)
		tmp = t_1;
	elseif (x <= 1.9e-34)
		tmp = fma(Float64(j * c), a, Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) - Float64(Float64(c * 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[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+93], t$95$1, If[LessEqual[x, 1.9e-34], N[(N[(j * c), $MachinePrecision] * a + N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9500000000000001e93 or 1.9000000000000001e-34 < x

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9500000000000001e93 < x < 1.9000000000000001e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \cdot z\right) \]
      4. lift-*.f6456.4

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

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

Alternative 5: 63.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+207}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+64}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -1.3e+207)
   (* (fma (- i) j (* z x)) y)
   (if (<= z 1.2e+64)
     (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))
     (* (- (* y x) (* c 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 (z <= -1.3e+207) {
		tmp = fma(-i, j, (z * x)) * y;
	} else if (z <= 1.2e+64) {
		tmp = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
	} else {
		tmp = ((y * x) - (c * b)) * z;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -1.3e+207)
		tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y);
	elseif (z <= 1.2e+64)
		tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x));
	else
		tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.3e+207], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1.2e+64], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+207}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2999999999999999e207

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

    if -1.2999999999999999e207 < z < 1.2e64

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e64 < z

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. 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. lower--.f64N/A

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.2%

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

Alternative 6: 60.3% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2e7 or 6.5000000000000001e39 < z

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. 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. lower--.f64N/A

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.2%

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

    if -4.2e7 < z < 6.5000000000000001e39

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, a \cdot \left(t \cdot x\right), j \cdot \left(a \cdot c - i \cdot y\right)\right) \]
      7. lift-*.f6450.7

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

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

Alternative 7: 55.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.95 \cdot 10^{-16}:\\ \;\;\;\;\mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\ \mathbf{elif}\;a \leq -2.2 \cdot 10^{-198}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-105}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\ \mathbf{elif}\;a \leq 6.6 \cdot 10^{-11}:\\ \;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot c, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= a -1.95e-16)
   (fma a (* c j) (* x (- (* y z) (* a t))))
   (if (<= a -2.2e-198)
     (* (fma (- i) j (* z x)) y)
     (if (<= a 2.4e-105)
       (* (- i) (- (* j y) (* b t)))
       (if (<= a 6.6e-11)
         (* (- (* y x) (* c b)) z)
         (fma (* a c) j (* (- (* z y) (* a t)) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -1.95e-16) {
		tmp = fma(a, (c * j), (x * ((y * z) - (a * t))));
	} else if (a <= -2.2e-198) {
		tmp = fma(-i, j, (z * x)) * y;
	} else if (a <= 2.4e-105) {
		tmp = -i * ((j * y) - (b * t));
	} else if (a <= 6.6e-11) {
		tmp = ((y * x) - (c * b)) * z;
	} else {
		tmp = fma((a * c), j, (((z * y) - (a * t)) * x));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (a <= -1.95e-16)
		tmp = fma(a, Float64(c * j), Float64(x * Float64(Float64(y * z) - Float64(a * t))));
	elseif (a <= -2.2e-198)
		tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y);
	elseif (a <= 2.4e-105)
		tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * t)));
	elseif (a <= 6.6e-11)
		tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z);
	else
		tmp = fma(Float64(a * c), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -1.95e-16], N[(a * N[(c * j), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.2e-198], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 2.4e-105], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-11], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(a * c), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\

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

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-105}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\

\mathbf{elif}\;a \leq 6.6 \cdot 10^{-11}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.94999999999999989e-16

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. lift-*.f6453.0

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

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

    if -1.94999999999999989e-16 < a < -2.2e-198

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

    if -2.2e-198 < a < 2.40000000000000015e-105

    1. Initial program 73.0%

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{b} \cdot t\right) \]
      7. lower-*.f6438.2

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{t}\right) \]
    4. Applied rewrites38.2%

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

    if 2.40000000000000015e-105 < a < 6.6000000000000005e-11

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. 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. lower--.f64N/A

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.2%

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

    if 6.6000000000000005e-11 < a

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 54.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\ \mathbf{if}\;a \leq -1.95 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -2.2 \cdot 10^{-198}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-105}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-9}:\\ \;\;\;\;\left(y \cdot x - c \cdot b\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 (fma a (* c j) (* x (- (* y z) (* a t))))))
   (if (<= a -1.95e-16)
     t_1
     (if (<= a -2.2e-198)
       (* (fma (- i) j (* z x)) y)
       (if (<= a 2.4e-105)
         (* (- i) (- (* j y) (* b t)))
         (if (<= a 1.8e-9) (* (- (* y x) (* c 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 = fma(a, (c * j), (x * ((y * z) - (a * t))));
	double tmp;
	if (a <= -1.95e-16) {
		tmp = t_1;
	} else if (a <= -2.2e-198) {
		tmp = fma(-i, j, (z * x)) * y;
	} else if (a <= 2.4e-105) {
		tmp = -i * ((j * y) - (b * t));
	} else if (a <= 1.8e-9) {
		tmp = ((y * x) - (c * b)) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = fma(a, Float64(c * j), Float64(x * Float64(Float64(y * z) - Float64(a * t))))
	tmp = 0.0
	if (a <= -1.95e-16)
		tmp = t_1;
	elseif (a <= -2.2e-198)
		tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y);
	elseif (a <= 2.4e-105)
		tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * t)));
	elseif (a <= 1.8e-9)
		tmp = Float64(Float64(Float64(y * x) - Float64(c * 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[(a * N[(c * j), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.95e-16], t$95$1, If[LessEqual[a, -2.2e-198], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 2.4e-105], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-9], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;a \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-105}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\

\mathbf{elif}\;a \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.94999999999999989e-16 or 1.8e-9 < a

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. lift-*.f6453.0

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

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

    if -1.94999999999999989e-16 < a < -2.2e-198

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

    if -2.2e-198 < a < 2.40000000000000015e-105

    1. Initial program 73.0%

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{b} \cdot t\right) \]
      7. lower-*.f6438.2

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{t}\right) \]
    4. Applied rewrites38.2%

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

    if 2.40000000000000015e-105 < a < 1.8e-9

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. 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. lower--.f64N/A

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.2%

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

Alternative 9: 53.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-243}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.05e46 or 9.49999999999999985e-34 < x

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    7. Applied rewrites40.3%

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

    if -1.05e46 < x < -1.05e-177

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. sub-negate-revN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right) \cdot b \]
      6. sub-negate-revN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      7. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      8. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      9. lift-*.f6437.8

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites37.8%

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

    if -1.05e-177 < x < 5.50000000000000004e-243

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
      4. lift-*.f6439.7

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
    7. Applied rewrites39.7%

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

    if 5.50000000000000004e-243 < x < 9.49999999999999985e-34

    1. Initial program 73.0%

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

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

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

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

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot c \]
      4. *-commutativeN/A

        \[\leadsto \left(j \cdot a - b \cdot z\right) \cdot c \]
      5. lower-*.f64N/A

        \[\leadsto \left(j \cdot a - b \cdot z\right) \cdot c \]
      6. lower-*.f6439.2

        \[\leadsto \left(j \cdot a - b \cdot z\right) \cdot c \]
    4. Applied rewrites39.2%

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

Alternative 10: 52.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\ t_2 := x \cdot \left(y \cdot z - a \cdot t\right)\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-142}:\\ \;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\ \mathbf{elif}\;x \leq 700:\\ \;\;\;\;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 (* (- (* i t) (* c z)) b)) (t_2 (* x (- (* y z) (* a t)))))
   (if (<= x -1.05e+46)
     t_2
     (if (<= x -1.05e-177)
       t_1
       (if (<= x 1.5e-142)
         (* j (- (* a c) (* i y)))
         (if (<= x 700.0) 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 = ((i * t) - (c * z)) * b;
	double t_2 = x * ((y * z) - (a * t));
	double tmp;
	if (x <= -1.05e+46) {
		tmp = t_2;
	} else if (x <= -1.05e-177) {
		tmp = t_1;
	} else if (x <= 1.5e-142) {
		tmp = j * ((a * c) - (i * y));
	} else if (x <= 700.0) {
		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 = ((i * t) - (c * z)) * b
    t_2 = x * ((y * z) - (a * t))
    if (x <= (-1.05d+46)) then
        tmp = t_2
    else if (x <= (-1.05d-177)) then
        tmp = t_1
    else if (x <= 1.5d-142) then
        tmp = j * ((a * c) - (i * y))
    else if (x <= 700.0d0) 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 = ((i * t) - (c * z)) * b;
	double t_2 = x * ((y * z) - (a * t));
	double tmp;
	if (x <= -1.05e+46) {
		tmp = t_2;
	} else if (x <= -1.05e-177) {
		tmp = t_1;
	} else if (x <= 1.5e-142) {
		tmp = j * ((a * c) - (i * y));
	} else if (x <= 700.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((i * t) - (c * z)) * b
	t_2 = x * ((y * z) - (a * t))
	tmp = 0
	if x <= -1.05e+46:
		tmp = t_2
	elif x <= -1.05e-177:
		tmp = t_1
	elif x <= 1.5e-142:
		tmp = j * ((a * c) - (i * y))
	elif x <= 700.0:
		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(i * t) - Float64(c * z)) * b)
	t_2 = Float64(x * Float64(Float64(y * z) - Float64(a * t)))
	tmp = 0.0
	if (x <= -1.05e+46)
		tmp = t_2;
	elseif (x <= -1.05e-177)
		tmp = t_1;
	elseif (x <= 1.5e-142)
		tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y)));
	elseif (x <= 700.0)
		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 = ((i * t) - (c * z)) * b;
	t_2 = x * ((y * z) - (a * t));
	tmp = 0.0;
	if (x <= -1.05e+46)
		tmp = t_2;
	elseif (x <= -1.05e-177)
		tmp = t_1;
	elseif (x <= 1.5e-142)
		tmp = j * ((a * c) - (i * y));
	elseif (x <= 700.0)
		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[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+46], t$95$2, If[LessEqual[x, -1.05e-177], t$95$1, If[LessEqual[x, 1.5e-142], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 700.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\
t_2 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-142}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\

\mathbf{elif}\;x \leq 700:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.05e46 or 700 < x

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    7. Applied rewrites40.3%

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

    if -1.05e46 < x < -1.05e-177 or 1.5000000000000001e-142 < x < 700

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. sub-negate-revN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right) \cdot b \]
      6. sub-negate-revN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      7. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      8. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      9. lift-*.f6437.8

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites37.8%

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

    if -1.05e-177 < x < 1.5000000000000001e-142

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
      4. lift-*.f6439.7

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
    7. Applied rewrites39.7%

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

Alternative 11: 52.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 3.9 \cdot 10^{+34}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e46 or 3.90000000000000019e34 < x

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    7. Applied rewrites40.3%

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

    if -1.15e46 < x < 3.90000000000000019e34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
      4. lift-*.f6439.7

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
    7. Applied rewrites39.7%

      \[\leadsto j \cdot \color{blue}{\left(a \cdot c - i \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 42.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+101}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;x \leq 3.15 \cdot 10^{+134}:\\ \;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= x -1.35e+101)
   (* x (* y z))
   (if (<= x 3.15e+134) (* j (- (* a c) (* i y))) (* (* -1.0 (* t x)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (x <= -1.35e+101) {
		tmp = x * (y * z);
	} else if (x <= 3.15e+134) {
		tmp = j * ((a * c) - (i * y));
	} else {
		tmp = (-1.0 * (t * x)) * a;
	}
	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 (x <= (-1.35d+101)) then
        tmp = x * (y * z)
    else if (x <= 3.15d+134) then
        tmp = j * ((a * c) - (i * y))
    else
        tmp = ((-1.0d0) * (t * x)) * a
    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 (x <= -1.35e+101) {
		tmp = x * (y * z);
	} else if (x <= 3.15e+134) {
		tmp = j * ((a * c) - (i * y));
	} else {
		tmp = (-1.0 * (t * x)) * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if x <= -1.35e+101:
		tmp = x * (y * z)
	elif x <= 3.15e+134:
		tmp = j * ((a * c) - (i * y))
	else:
		tmp = (-1.0 * (t * x)) * a
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (x <= -1.35e+101)
		tmp = Float64(x * Float64(y * z));
	elseif (x <= 3.15e+134)
		tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y)));
	else
		tmp = Float64(Float64(-1.0 * Float64(t * x)) * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (x <= -1.35e+101)
		tmp = x * (y * z);
	elseif (x <= 3.15e+134)
		tmp = j * ((a * c) - (i * y));
	else
		tmp = (-1.0 * (t * x)) * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.35e+101], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.15e+134], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+101}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;x \leq 3.15 \cdot 10^{+134}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.35000000000000003e101

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -1.35000000000000003e101 < x < 3.1500000000000001e134

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
      4. lift-*.f6439.7

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) \]
    7. Applied rewrites39.7%

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

    if 3.1500000000000001e134 < x

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right)\right) \cdot a \]
    7. Applied rewrites21.9%

      \[\leadsto \left(-1 \cdot \left(t \cdot x\right)\right) \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 31.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;\left(-1 \cdot \left(b \cdot c\right)\right) \cdot z\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.05e46 or 1.19999999999999996e-34 < x

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -1.05e46 < x < -1.05e-177

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. 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. lower--.f64N/A

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
    5. Taylor expanded in x around 0

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

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

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

      \[\leadsto \left(-1 \cdot \left(b \cdot c\right)\right) \cdot z \]

    if -1.05e-177 < x < 1.14999999999999992e-242

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Applied rewrites22.3%

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

    if 1.14999999999999992e-242 < x < 1.19999999999999996e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-*.f6423.2

        \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Applied rewrites23.2%

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

Alternative 14: 31.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;\left(-1 \cdot \left(c \cdot z\right)\right) \cdot b\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.05e46 or 1.19999999999999996e-34 < x

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -1.05e46 < x < -1.05e-177

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. sub-negate-revN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right) \cdot b \]
      6. sub-negate-revN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      7. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      8. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      9. lift-*.f6437.8

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites37.8%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around inf

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
      2. lift-*.f6421.9

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]

    if -1.05e-177 < x < 1.14999999999999992e-242

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Applied rewrites22.3%

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

    if 1.14999999999999992e-242 < x < 1.19999999999999996e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-*.f6423.2

        \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Applied rewrites23.2%

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

Alternative 15: 30.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -4.1 \cdot 10^{-112}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -9.5000000000000003e29 or 1.19999999999999996e-34 < x

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -9.5000000000000003e29 < x < -4.09999999999999996e-112

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. sub-negate-revN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right) \cdot b \]
      6. sub-negate-revN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      7. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      8. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      9. lift-*.f6437.8

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites37.8%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6421.3

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Applied rewrites21.3%

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

    if -4.09999999999999996e-112 < x < 1.14999999999999992e-242

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Applied rewrites22.3%

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

    if 1.14999999999999992e-242 < x < 1.19999999999999996e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-*.f6423.2

        \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Applied rewrites23.2%

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

Alternative 16: 30.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-142}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-242}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -9.5000000000000003e29 or 1.19999999999999996e-34 < x

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -9.5000000000000003e29 < x < -1.05e-142

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. sub-negate-revN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right) \cdot b \]
      6. sub-negate-revN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      7. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      8. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      9. lift-*.f6437.8

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites37.8%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6421.3

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Applied rewrites21.3%

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

    if -1.05e-142 < x < 1.35e-242

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \color{blue}{y}\right)\right) \]
      3. lift-*.f6422.3

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot y\right)\right) \]
    7. Applied rewrites22.3%

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

    if 1.35e-242 < x < 1.19999999999999996e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-*.f6423.2

        \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Applied rewrites23.2%

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

Alternative 17: 30.6% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -2.55 \cdot 10^{-102}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.5000000000000003e29 or 1.19999999999999996e-34 < x

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -9.5000000000000003e29 < x < -2.55e-102

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. sub-negate-revN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right) \cdot b \]
      6. sub-negate-revN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      7. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      8. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      9. lift-*.f6437.8

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites37.8%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6421.3

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Applied rewrites21.3%

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

    if -2.55e-102 < x < 1.19999999999999996e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-*.f6423.2

        \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Applied rewrites23.2%

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

Alternative 18: 30.5% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.6000000000000001e-21 or 1.19999999999999996e-34 < x

    1. Initial program 73.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. 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. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
      5. mul-1-negN/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-*.f6440.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites40.9%

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

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

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

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

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

    if -1.6000000000000001e-21 < x < 1.19999999999999996e-34

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-*.f6423.2

        \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Applied rewrites23.2%

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

Alternative 19: 23.8% accurate, 5.9× speedup?

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

\\
x \cdot \left(y \cdot z\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  2. Taylor expanded in y around inf

    \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
  3. 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. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 \cdot i, j, x \cdot z\right) \cdot y \]
    5. mul-1-negN/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-*.f6440.9

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
  4. Applied rewrites40.9%

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

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

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

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

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

Reproduce

?
herbie shell --seed 2025134 
(FPCore (x y z t a b c i j)
  :name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
  :precision binary64
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))