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

Percentage Accurate: 73.1% → 82.5%
Time: 26.4s
Alternatives: 18
Speedup: 0.5×

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 18 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.1% 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: 82.5% 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}:\\ \;\;\;\;\left(\mathsf{fma}\left(y, x, \frac{\mathsf{fma}\left(c \cdot a - i \cdot y, j, \mathsf{fma}\left(-x, a, i \cdot b\right) \cdot t\right)}{z}\right) - c \cdot b\right) \cdot z\\ \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 y x (/ (fma (- (* c a) (* i y)) j (* (fma (- x) a (* i b)) t)) z))
       (* c b))
      z))))
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(y, x, (fma(((c * a) - (i * y)), j, (fma(-x, a, (i * b)) * t)) / z)) - (c * b)) * z;
	}
	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 = Float64(Float64(fma(y, x, Float64(fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(fma(Float64(-x), a, Float64(i * b)) * t)) / z)) - Float64(c * b)) * z);
	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[(y * x + N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[((-x) * a + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $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}:\\
\;\;\;\;\left(\mathsf{fma}\left(y, x, \frac{\mathsf{fma}\left(c \cdot a - i \cdot y, j, \mathsf{fma}\left(-x, a, i \cdot b\right) \cdot t\right)}{z}\right) - c \cdot b\right) \cdot z\\


\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 91.2%

      \[\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 0.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(\left(-1 \cdot \frac{a \cdot \left(t \cdot x\right)}{z} + \left(x \cdot y + \frac{j \cdot \left(a \cdot c - i \cdot y\right)}{z}\right)\right) - \left(-1 \cdot \frac{b \cdot \left(i \cdot t\right)}{z} + b \cdot c\right)\right)} \]
    3. Applied rewrites45.7%

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

Alternative 2: 82.2% 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(t, \frac{b \cdot i - a \cdot x}{j}, a \cdot c - y \cdot i\right) \cdot j\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (+
          (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
          (* j (- (* c a) (* y i))))))
   (if (<= t_1 INFINITY)
     t_1
     (* (fma t (/ (- (* b i) (* a x)) j) (- (* a c) (* y i))) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(t, (((b * i) - (a * x)) / j), ((a * c) - (y * i))) * j;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(fma(t, Float64(Float64(Float64(b * i) - Float64(a * x)) / j), Float64(Float64(a * c) - Float64(y * i))) * j);
	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[(t * N[(N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] / j), $MachinePrecision] + N[(N[(a * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - 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(t, \frac{b \cdot i - a \cdot x}{j}, a \cdot c - y \cdot i\right) \cdot j\\


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

    1. Initial program 91.2%

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

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites43.5%

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      5. lower-*.f6424.9

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    6. Applied rewrites24.9%

      \[\leadsto \left(-i\right) \cdot \color{blue}{\left(j \cdot y\right)} \]
    7. Taylor expanded in j around inf

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

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

        \[\leadsto \left(\left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + a \cdot c\right) - i \cdot y\right) \cdot j \]
      3. *-lft-identityN/A

        \[\leadsto \left(\left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + a \cdot c\right) - 1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      4. metadata-evalN/A

        \[\leadsto \left(\left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + a \cdot c\right) - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(i \cdot y\right)\right) \cdot j \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + a \cdot c\right) - \left(\mathsf{neg}\left(-1 \cdot \left(i \cdot y\right)\right)\right)\right) \cdot j \]
      6. associate--l+N/A

        \[\leadsto \left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + \left(a \cdot c - \left(\mathsf{neg}\left(-1 \cdot \left(i \cdot y\right)\right)\right)\right)\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + \left(c \cdot a - \left(\mathsf{neg}\left(-1 \cdot \left(i \cdot y\right)\right)\right)\right)\right) \cdot j \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + \left(c \cdot a - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(i \cdot y\right)\right)\right) \cdot j \]
      9. metadata-evalN/A

        \[\leadsto \left(\frac{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)}{j} + \left(c \cdot a - 1 \cdot \left(i \cdot y\right)\right)\right) \cdot j \]
      10. *-lft-identityN/A

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

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

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

Alternative 3: 66.3% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 75.5%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites65.4%

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

    if 1.17999999999999997e85 < z

    1. Initial program 62.5%

      \[\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(\left(-1 \cdot \frac{a \cdot \left(t \cdot x\right)}{z} + \left(x \cdot y + \frac{j \cdot \left(a \cdot c - i \cdot y\right)}{z}\right)\right) - \left(-1 \cdot \frac{b \cdot \left(i \cdot t\right)}{z} + b \cdot c\right)\right)} \]
    3. Applied rewrites79.4%

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

      \[\leadsto \left(\mathsf{fma}\left(y, x, \frac{a \cdot \left(c \cdot j\right)}{z}\right) - c \cdot b\right) \cdot z \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(\mathsf{fma}\left(y, x, \frac{\left(j \cdot c\right) \cdot a}{z}\right) - c \cdot b\right) \cdot z \]
      4. lower-*.f6470.1

        \[\leadsto \left(\mathsf{fma}\left(y, x, \frac{\left(j \cdot c\right) \cdot a}{z}\right) - c \cdot b\right) \cdot z \]
    6. Applied rewrites70.1%

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

Alternative 4: 63.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.5 \cdot 10^{+234}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -4.49999999999999982e234

    1. Initial program 59.3%

      \[\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}{i \cdot \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(b \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + 1 \cdot \left(b \cdot t\right)\right) \cdot i \]
      5. *-lft-identityN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(j \cdot y\right)\right) + b \cdot t\right) \cdot i \]
      7. distribute-lft-neg-outN/A

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

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

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
      10. lower-*.f6476.3

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
    4. Applied rewrites76.3%

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

    if -4.49999999999999982e234 < i < -3.89999999999999984e-262

    1. Initial program 75.2%

      \[\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 0

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

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

    if -3.89999999999999984e-262 < i < 7.2e15

    1. Initial program 79.8%

      \[\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) + x \cdot \left(y \cdot z - a \cdot t\right)\right) - b \cdot \left(c \cdot z\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + \left(a \cdot \left(c \cdot j\right) - b \cdot \left(c \cdot z\right)\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + \left(\left(c \cdot a\right) \cdot j - b \cdot \left(c \cdot z\right)\right) \]
      7. associate-*l*N/A

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + \left(c \cdot \left(a \cdot j\right) - c \cdot \left(b \cdot \color{blue}{z}\right)\right) \]
      11. distribute-lft-out--N/A

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

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

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

    if 7.2e15 < i

    1. Initial program 64.9%

      \[\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}{x \cdot \left(y \cdot z\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. lower-*.f6447.6

        \[\leadsto \left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites47.6%

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

Alternative 5: 62.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+37}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.12e37

    1. Initial program 64.2%

      \[\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}{x \cdot \left(y \cdot z\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. lower-*.f6459.0

        \[\leadsto \left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites59.0%

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

    if -1.12e37 < y < 1.30000000000000003e150

    1. Initial program 78.7%

      \[\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 0

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

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

    if 1.30000000000000003e150 < y

    1. Initial program 59.8%

      \[\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(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      5. *-commutativeN/A

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

        \[\leadsto \left(z \cdot y - t \cdot a\right) \cdot x \]
      7. *-commutativeN/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      8. lower-*.f6448.2

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    4. Applied rewrites48.2%

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

Alternative 6: 61.8% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right)\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{-73}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.49999999999999996e39

    1. Initial program 65.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) \]
    2. Taylor expanded in z around 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites72.7%

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      5. lower-*.f6416.7

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    6. Applied rewrites16.7%

      \[\leadsto \left(-i\right) \cdot \color{blue}{\left(j \cdot y\right)} \]
    7. Taylor expanded in y around 0

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot i + \left(\mathsf{neg}\left(a\right)\right) \cdot x, t, a \cdot \left(c \cdot j\right)\right) \]
      7. fp-cancel-sub-signN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - a \cdot x, t, a \cdot \left(c \cdot j\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - 1 \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      10. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot i - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot x\right)\right)\right), t, a \cdot \left(c \cdot j\right)\right) \]
      13. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - 1 \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      15. *-lft-identityN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right) \]
      19. lower-*.f6469.3

        \[\leadsto \mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right) \]
    9. Applied rewrites69.3%

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

    if -4.49999999999999996e39 < t < 1.34999999999999997e-73

    1. Initial program 79.9%

      \[\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}{x \cdot \left(y \cdot z\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. lower-*.f6458.7

        \[\leadsto \left(y \cdot x\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites58.7%

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

    if 1.34999999999999997e-73 < t

    1. Initial program 68.2%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites69.5%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, t \cdot \left(\left(\mathsf{neg}\left(x \cdot a\right)\right) + i \cdot b\right)\right) \]
      8. distribute-lft-neg-outN/A

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, \left(\left(\mathsf{neg}\left(x\right)\right) \cdot a + i \cdot b\right) \cdot t\right) \]
      10. lift-neg.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(-x, a, i \cdot b\right) \cdot t\right) \]
      13. lift-*.f6464.8

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

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

Alternative 7: 57.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right)\\

\mathbf{elif}\;t \leq 1.12 \cdot 10^{-33}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9000000000000003e-17

    1. Initial program 66.8%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites70.4%

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    6. Applied rewrites17.1%

      \[\leadsto \left(-i\right) \cdot \color{blue}{\left(j \cdot y\right)} \]
    7. Taylor expanded in y around 0

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot i + \left(\mathsf{neg}\left(a\right)\right) \cdot x, t, a \cdot \left(c \cdot j\right)\right) \]
      7. fp-cancel-sub-signN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - a \cdot x, t, a \cdot \left(c \cdot j\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - 1 \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      10. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot i - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot x\right)\right)\right), t, a \cdot \left(c \cdot j\right)\right) \]
      13. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b \cdot i - 1 \cdot \left(a \cdot x\right), t, a \cdot \left(c \cdot j\right)\right) \]
      15. *-lft-identityN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right) \]
      19. lower-*.f6465.9

        \[\leadsto \mathsf{fma}\left(b \cdot i - a \cdot x, t, \left(c \cdot j\right) \cdot a\right) \]
    9. Applied rewrites65.9%

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

    if -2.9000000000000003e-17 < t < 1.11999999999999999e-33

    1. Initial program 80.3%

      \[\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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6446.6

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites46.6%

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

    if 1.11999999999999999e-33 < t

    1. Initial program 66.8%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites71.4%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, t \cdot \left(\left(\mathsf{neg}\left(x \cdot a\right)\right) + i \cdot b\right)\right) \]
      8. distribute-lft-neg-outN/A

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, \left(\left(\mathsf{neg}\left(x\right)\right) \cdot a + i \cdot b\right) \cdot t\right) \]
      10. lift-neg.f64N/A

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

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

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

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

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

Alternative 8: 57.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j \cdot c, a, \left(i \cdot b - a \cdot x\right) \cdot t\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.12 \cdot 10^{-33}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.9000000000000003e-17 or 1.11999999999999999e-33 < t

    1. Initial program 66.8%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites70.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, t \cdot \left(\left(\mathsf{neg}\left(x \cdot a\right)\right) + i \cdot b\right)\right) \]
      8. distribute-lft-neg-outN/A

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, \left(\left(\mathsf{neg}\left(x\right)\right) \cdot a + i \cdot b\right) \cdot t\right) \]
      10. lift-neg.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(-x, a, i \cdot b\right) \cdot t\right) \]
      13. lift-*.f6466.9

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

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

    if -2.9000000000000003e-17 < t < 1.11999999999999999e-33

    1. Initial program 80.3%

      \[\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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6446.6

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites46.6%

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

Alternative 9: 52.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot c - t \cdot x\right) \cdot a\\ \mathbf{if}\;a \leq -3.8 \cdot 10^{+129}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-258}:\\ \;\;\;\;\left(b \cdot t - y \cdot j\right) \cdot i\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-48}:\\ \;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\ \mathbf{elif}\;a \leq 62:\\ \;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* j c) (* t x)) a)))
   (if (<= a -3.8e+129)
     t_1
     (if (<= a 3.7e-258)
       (* (- (* b t) (* y j)) i)
       (if (<= a 1.25e-48)
         (* (- (* i t) (* c z)) b)
         (if (<= a 62.0) (* (- (* c a) (* i y)) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((j * c) - (t * x)) * a;
	double tmp;
	if (a <= -3.8e+129) {
		tmp = t_1;
	} else if (a <= 3.7e-258) {
		tmp = ((b * t) - (y * j)) * i;
	} else if (a <= 1.25e-48) {
		tmp = ((i * t) - (c * z)) * b;
	} else if (a <= 62.0) {
		tmp = ((c * a) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((j * c) - (t * x)) * a
    if (a <= (-3.8d+129)) then
        tmp = t_1
    else if (a <= 3.7d-258) then
        tmp = ((b * t) - (y * j)) * i
    else if (a <= 1.25d-48) then
        tmp = ((i * t) - (c * z)) * b
    else if (a <= 62.0d0) then
        tmp = ((c * a) - (i * y)) * j
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((j * c) - (t * x)) * a;
	double tmp;
	if (a <= -3.8e+129) {
		tmp = t_1;
	} else if (a <= 3.7e-258) {
		tmp = ((b * t) - (y * j)) * i;
	} else if (a <= 1.25e-48) {
		tmp = ((i * t) - (c * z)) * b;
	} else if (a <= 62.0) {
		tmp = ((c * a) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((j * c) - (t * x)) * a
	tmp = 0
	if a <= -3.8e+129:
		tmp = t_1
	elif a <= 3.7e-258:
		tmp = ((b * t) - (y * j)) * i
	elif a <= 1.25e-48:
		tmp = ((i * t) - (c * z)) * b
	elif a <= 62.0:
		tmp = ((c * a) - (i * y)) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(j * c) - Float64(t * x)) * a)
	tmp = 0.0
	if (a <= -3.8e+129)
		tmp = t_1;
	elseif (a <= 3.7e-258)
		tmp = Float64(Float64(Float64(b * t) - Float64(y * j)) * i);
	elseif (a <= 1.25e-48)
		tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b);
	elseif (a <= 62.0)
		tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((j * c) - (t * x)) * a;
	tmp = 0.0;
	if (a <= -3.8e+129)
		tmp = t_1;
	elseif (a <= 3.7e-258)
		tmp = ((b * t) - (y * j)) * i;
	elseif (a <= 1.25e-48)
		tmp = ((i * t) - (c * z)) * b;
	elseif (a <= 62.0)
		tmp = ((c * a) - (i * y)) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -3.8e+129], t$95$1, If[LessEqual[a, 3.7e-258], N[(N[(N[(b * t), $MachinePrecision] - N[(y * j), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[a, 1.25e-48], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 62.0], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(j \cdot c - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.25 \cdot 10^{-48}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\

\mathbf{elif}\;a \leq 62:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.80000000000000005e129 or 62 < a

    1. Initial program 64.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) \]
    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. +-commutativeN/A

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

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

        \[\leadsto \left(c \cdot j + \left(\mathsf{neg}\left(t\right)\right) \cdot x\right) \cdot a \]
      6. fp-cancel-sub-signN/A

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

        \[\leadsto \left(c \cdot j - t \cdot x\right) \cdot a \]
      8. *-commutativeN/A

        \[\leadsto \left(j \cdot c - t \cdot x\right) \cdot a \]
      9. lower-*.f64N/A

        \[\leadsto \left(j \cdot c - t \cdot x\right) \cdot a \]
      10. lower-*.f6462.5

        \[\leadsto \left(j \cdot c - t \cdot x\right) \cdot a \]
    4. Applied rewrites62.5%

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

    if -3.80000000000000005e129 < a < 3.7e-258

    1. Initial program 77.6%

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot t\right) \cdot i \]
      4. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot i \]
      5. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot \color{blue}{i} \]
      6. +-commutativeN/A

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

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

        \[\leadsto \left(b \cdot t + \left(\mathsf{neg}\left(j\right)\right) \cdot y\right) \cdot i \]
      9. fp-cancel-sub-signN/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
      10. lower--.f64N/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
      11. lower-*.f64N/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
      12. *-commutativeN/A

        \[\leadsto \left(b \cdot t - y \cdot j\right) \cdot i \]
      13. lower-*.f6443.2

        \[\leadsto \left(b \cdot t - y \cdot j\right) \cdot i \]
    5. Applied rewrites43.2%

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

    if 3.7e-258 < a < 1.25e-48

    1. Initial program 81.8%

      \[\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. Applied rewrites46.0%

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

    if 1.25e-48 < a < 62

    1. Initial program 79.8%

      \[\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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6431.3

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites31.3%

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

Alternative 10: 50.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\ t_2 := \left(j \cdot c - t \cdot x\right) \cdot a\\ \mathbf{if}\;a \leq -6.2 \cdot 10^{+139}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -2.2 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-48}:\\ \;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\ \mathbf{elif}\;a \leq 62:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* c a) (* i y)) j)) (t_2 (* (- (* j c) (* t x)) a)))
   (if (<= a -6.2e+139)
     t_2
     (if (<= a -2.2e-142)
       t_1
       (if (<= a 1.25e-48)
         (* (- (* i t) (* c z)) b)
         (if (<= a 62.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 = ((c * a) - (i * y)) * j;
	double t_2 = ((j * c) - (t * x)) * a;
	double tmp;
	if (a <= -6.2e+139) {
		tmp = t_2;
	} else if (a <= -2.2e-142) {
		tmp = t_1;
	} else if (a <= 1.25e-48) {
		tmp = ((i * t) - (c * z)) * b;
	} else if (a <= 62.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 = ((c * a) - (i * y)) * j
    t_2 = ((j * c) - (t * x)) * a
    if (a <= (-6.2d+139)) then
        tmp = t_2
    else if (a <= (-2.2d-142)) then
        tmp = t_1
    else if (a <= 1.25d-48) then
        tmp = ((i * t) - (c * z)) * b
    else if (a <= 62.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 = ((c * a) - (i * y)) * j;
	double t_2 = ((j * c) - (t * x)) * a;
	double tmp;
	if (a <= -6.2e+139) {
		tmp = t_2;
	} else if (a <= -2.2e-142) {
		tmp = t_1;
	} else if (a <= 1.25e-48) {
		tmp = ((i * t) - (c * z)) * b;
	} else if (a <= 62.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((c * a) - (i * y)) * j
	t_2 = ((j * c) - (t * x)) * a
	tmp = 0
	if a <= -6.2e+139:
		tmp = t_2
	elif a <= -2.2e-142:
		tmp = t_1
	elif a <= 1.25e-48:
		tmp = ((i * t) - (c * z)) * b
	elif a <= 62.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(c * a) - Float64(i * y)) * j)
	t_2 = Float64(Float64(Float64(j * c) - Float64(t * x)) * a)
	tmp = 0.0
	if (a <= -6.2e+139)
		tmp = t_2;
	elseif (a <= -2.2e-142)
		tmp = t_1;
	elseif (a <= 1.25e-48)
		tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b);
	elseif (a <= 62.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 = ((c * a) - (i * y)) * j;
	t_2 = ((j * c) - (t * x)) * a;
	tmp = 0.0;
	if (a <= -6.2e+139)
		tmp = t_2;
	elseif (a <= -2.2e-142)
		tmp = t_1;
	elseif (a <= 1.25e-48)
		tmp = ((i * t) - (c * z)) * b;
	elseif (a <= 62.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[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -6.2e+139], t$95$2, If[LessEqual[a, -2.2e-142], t$95$1, If[LessEqual[a, 1.25e-48], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 62.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.2 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{-48}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\

\mathbf{elif}\;a \leq 62:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.2e139 or 62 < a

    1. Initial program 63.9%

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

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

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

        \[\leadsto \left(c \cdot j + \left(\mathsf{neg}\left(t\right)\right) \cdot x\right) \cdot a \]
      6. fp-cancel-sub-signN/A

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

        \[\leadsto \left(c \cdot j - t \cdot x\right) \cdot a \]
      8. *-commutativeN/A

        \[\leadsto \left(j \cdot c - t \cdot x\right) \cdot a \]
      9. lower-*.f64N/A

        \[\leadsto \left(j \cdot c - t \cdot x\right) \cdot a \]
      10. lower-*.f6462.5

        \[\leadsto \left(j \cdot c - t \cdot x\right) \cdot a \]
    4. Applied rewrites62.5%

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

    if -6.2e139 < a < -2.20000000000000016e-142 or 1.25e-48 < a < 62

    1. Initial program 76.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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6438.0

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites38.0%

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

    if -2.20000000000000016e-142 < a < 1.25e-48

    1. Initial program 80.9%

      \[\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. Applied rewrites46.5%

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

Alternative 11: 50.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(i \cdot b - a \cdot x\right) \cdot t\\ \mathbf{if}\;t \leq -8.2 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-33}:\\ \;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* i b) (* a x)) t)))
   (if (<= t -8.2e+41) t_1 (if (<= t 8.2e-33) (* (- (* c a) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((i * b) - (a * x)) * t;
	double tmp;
	if (t <= -8.2e+41) {
		tmp = t_1;
	} else if (t <= 8.2e-33) {
		tmp = ((c * a) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((i * b) - (a * x)) * t
    if (t <= (-8.2d+41)) then
        tmp = t_1
    else if (t <= 8.2d-33) then
        tmp = ((c * a) - (i * y)) * j
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((i * b) - (a * x)) * t;
	double tmp;
	if (t <= -8.2e+41) {
		tmp = t_1;
	} else if (t <= 8.2e-33) {
		tmp = ((c * a) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((i * b) - (a * x)) * t
	tmp = 0
	if t <= -8.2e+41:
		tmp = t_1
	elif t <= 8.2e-33:
		tmp = ((c * a) - (i * y)) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(i * b) - Float64(a * x)) * t)
	tmp = 0.0
	if (t <= -8.2e+41)
		tmp = t_1;
	elseif (t <= 8.2e-33)
		tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((i * b) - (a * x)) * t;
	tmp = 0.0;
	if (t <= -8.2e+41)
		tmp = t_1;
	elseif (t <= 8.2e-33)
		tmp = ((c * a) - (i * y)) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * b), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -8.2e+41], t$95$1, If[LessEqual[t, 8.2e-33], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 8.2 \cdot 10^{-33}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.2000000000000007e41 or 8.2e-33 < t

    1. Initial program 66.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) \]
    2. Taylor expanded in t around inf

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
      2. distribute-lft-out--N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot t \]
      3. associate-*l*N/A

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

        \[\leadsto -1 \cdot \left(t \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto -1 \cdot \left(\left(a \cdot x - b \cdot i\right) \cdot \color{blue}{t}\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    4. Applied rewrites60.8%

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

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

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

        \[\leadsto \left(\left(-x\right) \cdot a + b \cdot i\right) \cdot t \]
      4. +-commutativeN/A

        \[\leadsto \left(b \cdot i + \left(-x\right) \cdot a\right) \cdot t \]
      5. lift-neg.f64N/A

        \[\leadsto \left(b \cdot i + \left(\mathsf{neg}\left(x\right)\right) \cdot a\right) \cdot t \]
      6. fp-cancel-sub-signN/A

        \[\leadsto \left(b \cdot i - x \cdot a\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto \left(b \cdot i - a \cdot x\right) \cdot t \]
      8. remove-double-negN/A

        \[\leadsto \left(b \cdot i - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot x\right)\right)\right)\right)\right) \cdot t \]
      9. mul-1-negN/A

        \[\leadsto \left(b \cdot i - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot x\right)\right)\right)\right) \cdot t \]
      10. lower--.f64N/A

        \[\leadsto \left(b \cdot i - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot x\right)\right)\right)\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(i \cdot b - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot x\right)\right)\right)\right) \cdot t \]
      12. lift-*.f64N/A

        \[\leadsto \left(i \cdot b - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot x\right)\right)\right)\right) \cdot t \]
      13. mul-1-negN/A

        \[\leadsto \left(i \cdot b - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot x\right)\right)\right)\right)\right) \cdot t \]
      14. remove-double-negN/A

        \[\leadsto \left(i \cdot b - a \cdot x\right) \cdot t \]
      15. lower-*.f6460.5

        \[\leadsto \left(i \cdot b - a \cdot x\right) \cdot t \]
    6. Applied rewrites60.5%

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

    if -8.2000000000000007e41 < t < 8.2e-33

    1. Initial program 79.8%

      \[\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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6445.5

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites45.5%

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

Alternative 12: 41.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+148}:\\
\;\;\;\;\left(\left(-c\right) \cdot b\right) \cdot z\\

\mathbf{elif}\;b \leq 5.8 \cdot 10^{+127}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.6000000000000001e148

    1. Initial program 69.8%

      \[\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-*.f6448.1

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

      \[\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. mul-1-negN/A

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

        \[\leadsto \left(\mathsf{neg}\left(c \cdot b\right)\right) \cdot z \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot b\right) \cdot z \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot b\right) \cdot z \]
      5. lower-neg.f6440.2

        \[\leadsto \left(\left(-c\right) \cdot b\right) \cdot z \]
    7. Applied rewrites40.2%

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

    if -4.6000000000000001e148 < b < 5.8000000000000004e127

    1. Initial program 74.3%

      \[\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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6442.5

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites42.5%

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

    if 5.8000000000000004e127 < b

    1. Initial program 70.3%

      \[\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. Applied rewrites71.9%

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

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

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

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      3. remove-double-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(-1 \cdot \left(i \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(-1 \cdot \left(i \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(c \cdot z\right)\right)\right) \cdot b \]
      6. distribute-neg-inN/A

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
    5. Applied rewrites70.0%

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    8. Applied rewrites38.8%

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

Alternative 13: 29.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot j\right) \cdot c\\ \mathbf{if}\;a \leq -7.5 \cdot 10^{+76}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a j) c)))
   (if (<= a -7.5e+76) t_1 (if (<= a 9e-51) (* (* i t) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * j) * c;
	double tmp;
	if (a <= -7.5e+76) {
		tmp = t_1;
	} else if (a <= 9e-51) {
		tmp = (i * t) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * j) * c
    if (a <= (-7.5d+76)) then
        tmp = t_1
    else if (a <= 9d-51) then
        tmp = (i * t) * b
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * j) * c;
	double tmp;
	if (a <= -7.5e+76) {
		tmp = t_1;
	} else if (a <= 9e-51) {
		tmp = (i * t) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * j) * c
	tmp = 0
	if a <= -7.5e+76:
		tmp = t_1
	elif a <= 9e-51:
		tmp = (i * t) * b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * j) * c)
	tmp = 0.0
	if (a <= -7.5e+76)
		tmp = t_1;
	elseif (a <= 9e-51)
		tmp = Float64(Float64(i * t) * b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * j) * c;
	tmp = 0.0;
	if (a <= -7.5e+76)
		tmp = t_1;
	elseif (a <= 9e-51)
		tmp = (i * t) * b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * j), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[a, -7.5e+76], t$95$1, If[LessEqual[a, 9e-51], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot j\right) \cdot c\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.4999999999999995e76 or 8.99999999999999948e-51 < a

    1. Initial program 65.9%

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

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

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

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

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

      \[\leadsto \left(a \cdot j\right) \cdot c \]

    if -7.4999999999999995e76 < a < 8.99999999999999948e-51

    1. Initial program 79.7%

      \[\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. Applied rewrites76.1%

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

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

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

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      3. remove-double-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(-1 \cdot \left(i \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(-1 \cdot \left(i \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(c \cdot z\right)\right)\right) \cdot b \]
      6. distribute-neg-inN/A

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(c \cdot z - i \cdot t\right)\right) \cdot \color{blue}{b} \]
    5. Applied rewrites44.3%

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

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

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

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

Alternative 14: 29.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot j\right) \cdot c\\ \mathbf{if}\;a \leq -3.8 \cdot 10^{+47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\ \;\;\;\;\left(i \cdot b\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* a j) c)))
   (if (<= a -3.8e+47) t_1 (if (<= a 9e-51) (* (* i b) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * j) * c;
	double tmp;
	if (a <= -3.8e+47) {
		tmp = t_1;
	} else if (a <= 9e-51) {
		tmp = (i * b) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * j) * c
    if (a <= (-3.8d+47)) then
        tmp = t_1
    else if (a <= 9d-51) then
        tmp = (i * b) * t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (a * j) * c;
	double tmp;
	if (a <= -3.8e+47) {
		tmp = t_1;
	} else if (a <= 9e-51) {
		tmp = (i * b) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (a * j) * c
	tmp = 0
	if a <= -3.8e+47:
		tmp = t_1
	elif a <= 9e-51:
		tmp = (i * b) * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(a * j) * c)
	tmp = 0.0
	if (a <= -3.8e+47)
		tmp = t_1;
	elseif (a <= 9e-51)
		tmp = Float64(Float64(i * b) * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (a * j) * c;
	tmp = 0.0;
	if (a <= -3.8e+47)
		tmp = t_1;
	elseif (a <= 9e-51)
		tmp = (i * b) * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * j), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[a, -3.8e+47], t$95$1, If[LessEqual[a, 9e-51], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot j\right) \cdot c\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.8000000000000003e47 or 8.99999999999999948e-51 < a

    1. Initial program 66.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) \]
    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-*.f6445.4

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

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

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

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

      \[\leadsto \left(a \cdot j\right) \cdot c \]

    if -3.8000000000000003e47 < a < 8.99999999999999948e-51

    1. Initial program 80.2%

      \[\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 t around inf

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
      2. distribute-lft-out--N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot t \]
      3. associate-*l*N/A

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

        \[\leadsto -1 \cdot \left(t \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto -1 \cdot \left(\left(a \cdot x - b \cdot i\right) \cdot \color{blue}{t}\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    4. Applied rewrites32.8%

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

      \[\leadsto \left(b \cdot i\right) \cdot t \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      2. lift-*.f6425.6

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

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

Alternative 15: 29.1% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+117}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\

\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.94999999999999995e117

    1. Initial program 60.5%

      \[\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 j around inf

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

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

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      7. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6448.3

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites48.3%

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

      \[\leadsto \left(a \cdot c\right) \cdot j \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot a\right) \cdot j \]
      2. lift-*.f6441.8

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

      \[\leadsto \left(c \cdot a\right) \cdot j \]

    if -1.94999999999999995e117 < a < 8.99999999999999948e-51

    1. Initial program 79.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) \]
    2. Taylor expanded in t around inf

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
      2. distribute-lft-out--N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot t \]
      3. associate-*l*N/A

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

        \[\leadsto -1 \cdot \left(t \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto -1 \cdot \left(\left(a \cdot x - b \cdot i\right) \cdot \color{blue}{t}\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    4. Applied rewrites34.0%

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

      \[\leadsto \left(b \cdot i\right) \cdot t \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      2. lift-*.f6425.1

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

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

    if 8.99999999999999948e-51 < a

    1. Initial program 68.2%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites66.4%

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

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

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

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

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      4. lower-*.f6429.7

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

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

Alternative 16: 29.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot c\right) \cdot a\\ \mathbf{if}\;a \leq -7.2 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\ \;\;\;\;\left(i \cdot b\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* j c) a)))
   (if (<= a -7.2e+116) t_1 (if (<= a 9e-51) (* (* i b) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (j * c) * a;
	double tmp;
	if (a <= -7.2e+116) {
		tmp = t_1;
	} else if (a <= 9e-51) {
		tmp = (i * b) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (j * c) * a
    if (a <= (-7.2d+116)) then
        tmp = t_1
    else if (a <= 9d-51) then
        tmp = (i * b) * t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (j * c) * a;
	double tmp;
	if (a <= -7.2e+116) {
		tmp = t_1;
	} else if (a <= 9e-51) {
		tmp = (i * b) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (j * c) * a
	tmp = 0
	if a <= -7.2e+116:
		tmp = t_1
	elif a <= 9e-51:
		tmp = (i * b) * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(j * c) * a)
	tmp = 0.0
	if (a <= -7.2e+116)
		tmp = t_1;
	elseif (a <= 9e-51)
		tmp = Float64(Float64(i * b) * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (j * c) * a;
	tmp = 0.0;
	if (a <= -7.2e+116)
		tmp = t_1;
	elseif (a <= 9e-51)
		tmp = (i * b) * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -7.2e+116], t$95$1, If[LessEqual[a, 9e-51], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.19999999999999941e116 or 8.99999999999999948e-51 < a

    1. Initial program 65.6%

      \[\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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites66.1%

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

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

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

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

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      4. lower-*.f6433.5

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    6. Applied rewrites33.5%

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

    if -7.19999999999999941e116 < a < 8.99999999999999948e-51

    1. Initial program 79.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) \]
    2. Taylor expanded in t around inf

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
      2. distribute-lft-out--N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot t \]
      3. associate-*l*N/A

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

        \[\leadsto -1 \cdot \left(t \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto -1 \cdot \left(\left(a \cdot x - b \cdot i\right) \cdot \color{blue}{t}\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    4. Applied rewrites34.0%

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

      \[\leadsto \left(b \cdot i\right) \cdot t \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      2. lift-*.f6425.1

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

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

Alternative 17: 28.9% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;a \leq -5.8 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 8.6 \cdot 10^{-50}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.8e50 or 8.59999999999999995e-50 < a

    1. Initial program 66.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 0

      \[\leadsto \color{blue}{\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)} \]
    3. Applied rewrites66.5%

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

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

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

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

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      4. lower-*.f6432.7

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

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

    if -5.8e50 < a < 8.59999999999999995e-50

    1. Initial program 80.2%

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6425.4

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

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

Alternative 18: 22.1% accurate, 5.9× speedup?

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

\\
\left(z \cdot y\right) \cdot x
\end{array}
Derivation
  1. Initial program 73.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) \]
  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.3

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

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

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

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

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

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    4. lower-*.f6422.1

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

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

Reproduce

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