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

Percentage Accurate: 73.4% → 82.3%
Time: 7.1s
Alternatives: 23
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 23 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.4% 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.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\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) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)\\

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


\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.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 b around 0

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\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 a around inf

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

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

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

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

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

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

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

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

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

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

Alternative 2: 69.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;j \leq -9 \cdot 10^{-255}:\\
\;\;\;\;t\_1 \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if j < -3.9999999999999998e105

    1. Initial program 71.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(x \cdot y - b \cdot c\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

    if -3.9999999999999998e105 < j < -8.99999999999999959e-255

    1. Initial program 74.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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6465.7

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites65.7%

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

    if -8.99999999999999959e-255 < j < 1.3499999999999999e77

    1. Initial program 72.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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6468.5

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3499999999999999e77 < j

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 69.1% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;j \leq 4.6 \cdot 10^{-74}:\\
\;\;\;\;t\_1 \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -3.9999999999999998e105

    1. Initial program 71.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(x \cdot y - b \cdot c\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

    if -3.9999999999999998e105 < j < 4.59999999999999961e-74

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6469.5

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites69.5%

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

    if 4.59999999999999961e-74 < j

    1. Initial program 74.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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;j \leq 4.6 \cdot 10^{-74}:\\
\;\;\;\;t\_1 \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -7.5000000000000002e105

    1. Initial program 71.4%

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

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

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

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

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

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

        \[\leadsto \left(-\left(c \cdot b\right) \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites67.8%

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

    if -7.5000000000000002e105 < j < 4.59999999999999961e-74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6469.4

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites69.4%

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

    if 4.59999999999999961e-74 < j

    1. Initial program 74.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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.9% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 71.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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000002e41 < b < 3.2000000000000001e72

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e72 < b

    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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 68.5% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 71.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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000002e41 < b < 3.2000000000000001e72

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e72 < b

    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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.8% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;a \leq -1.35 \cdot 10^{-60}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(-a\right) \cdot \left(t \cdot x\right)\right)\\

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(z \cdot y\right) \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.7500000000000001e191 or 1.0500000000000001e51 < a

    1. Initial program 62.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 a around inf

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

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

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

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

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

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

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

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

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

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

    if -2.7500000000000001e191 < a < -1.35e-60

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, -1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

    if -1.35e-60 < a < 1.0500000000000001e51

    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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.8% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.0000000000000006e175 or 1.0500000000000001e51 < a

    1. Initial program 62.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 a around inf

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

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

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

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

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

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

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

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

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

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

    if -7.0000000000000006e175 < a < 1.0500000000000001e51

    1. Initial program 78.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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 53.4% accurate, 1.5× speedup?

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

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

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

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

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


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

    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 a around inf

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

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

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

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

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

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

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

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

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

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

    if -8.7999999999999997e175 < a < -3.2999999999999999e-156

    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 b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2999999999999999e-156 < a < 6.2e12

    1. Initial program 80.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(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-*.f6446.4

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

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

Alternative 10: 53.3% accurate, 1.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.0000000000000006e175 or 6.2e12 < 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. associate-*r*N/A

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

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

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

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

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

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

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

    if -7.0000000000000006e175 < a < -3.3999999999999999e-156

    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 b around inf

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6438.5

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

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

    if -3.3999999999999999e-156 < a < 6.2e12

    1. Initial program 80.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(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-*.f6446.4

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

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

Alternative 11: 52.9% 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(i \cdot t - c \cdot z\right) \cdot b\\ \mathbf{if}\;b \leq -9.2 \cdot 10^{+48}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;b \leq -8.8 \cdot 10^{-156}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{-275}:\\ \;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\ \mathbf{elif}\;b \leq 0.14:\\ \;\;\;\;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 (* (- (* i t) (* c z)) b)))
   (if (<= b -9.2e+48)
     t_2
     (if (<= b -8.8e-156)
       t_1
       (if (<= b 3.8e-275)
         (* (- (* z y) (* a t)) x)
         (if (<= b 0.14) 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 = ((i * t) - (c * z)) * b;
	double tmp;
	if (b <= -9.2e+48) {
		tmp = t_2;
	} else if (b <= -8.8e-156) {
		tmp = t_1;
	} else if (b <= 3.8e-275) {
		tmp = ((z * y) - (a * t)) * x;
	} else if (b <= 0.14) {
		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 = ((i * t) - (c * z)) * b
    if (b <= (-9.2d+48)) then
        tmp = t_2
    else if (b <= (-8.8d-156)) then
        tmp = t_1
    else if (b <= 3.8d-275) then
        tmp = ((z * y) - (a * t)) * x
    else if (b <= 0.14d0) 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 = ((i * t) - (c * z)) * b;
	double tmp;
	if (b <= -9.2e+48) {
		tmp = t_2;
	} else if (b <= -8.8e-156) {
		tmp = t_1;
	} else if (b <= 3.8e-275) {
		tmp = ((z * y) - (a * t)) * x;
	} else if (b <= 0.14) {
		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 = ((i * t) - (c * z)) * b
	tmp = 0
	if b <= -9.2e+48:
		tmp = t_2
	elif b <= -8.8e-156:
		tmp = t_1
	elif b <= 3.8e-275:
		tmp = ((z * y) - (a * t)) * x
	elif b <= 0.14:
		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(i * t) - Float64(c * z)) * b)
	tmp = 0.0
	if (b <= -9.2e+48)
		tmp = t_2;
	elseif (b <= -8.8e-156)
		tmp = t_1;
	elseif (b <= 3.8e-275)
		tmp = Float64(Float64(Float64(z * y) - Float64(a * t)) * x);
	elseif (b <= 0.14)
		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 = ((i * t) - (c * z)) * b;
	tmp = 0.0;
	if (b <= -9.2e+48)
		tmp = t_2;
	elseif (b <= -8.8e-156)
		tmp = t_1;
	elseif (b <= 3.8e-275)
		tmp = ((z * y) - (a * t)) * x;
	elseif (b <= 0.14)
		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[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -9.2e+48], t$95$2, If[LessEqual[b, -8.8e-156], t$95$1, If[LessEqual[b, 3.8e-275], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 0.14], 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(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b \leq -8.8 \cdot 10^{-156}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 3.8 \cdot 10^{-275}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\

\mathbf{elif}\;b \leq 0.14:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -9.2000000000000001e48 or 0.14000000000000001 < b

    1. Initial program 72.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6461.2

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

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

    if -9.2000000000000001e48 < b < -8.7999999999999996e-156 or 3.79999999999999972e-275 < b < 0.14000000000000001

    1. Initial program 75.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-*.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} \]

    if -8.7999999999999996e-156 < b < 3.79999999999999972e-275

    1. Initial program 71.0%

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

      \[\leadsto \color{blue}{x \cdot \left(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-*.f6446.2

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    4. Applied rewrites46.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 12: 52.5% accurate, 1.7× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((c * a) - (i * y)) * j
    if (j <= (-8.2d+105)) then
        tmp = t_1
    else if (j <= 1.04d-265) then
        tmp = ((i * t) - (c * z)) * b
    else if (j <= 1.15d-50) then
        tmp = ((y * x) - (c * b)) * z
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((c * a) - (i * y)) * j;
	double tmp;
	if (j <= -8.2e+105) {
		tmp = t_1;
	} else if (j <= 1.04e-265) {
		tmp = ((i * t) - (c * z)) * b;
	} else if (j <= 1.15e-50) {
		tmp = ((y * x) - (c * b)) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((c * a) - (i * y)) * j
	tmp = 0
	if j <= -8.2e+105:
		tmp = t_1
	elif j <= 1.04e-265:
		tmp = ((i * t) - (c * z)) * b
	elif j <= 1.15e-50:
		tmp = ((y * x) - (c * b)) * z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j)
	tmp = 0.0
	if (j <= -8.2e+105)
		tmp = t_1;
	elseif (j <= 1.04e-265)
		tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b);
	elseif (j <= 1.15e-50)
		tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((c * a) - (i * y)) * j;
	tmp = 0.0;
	if (j <= -8.2e+105)
		tmp = t_1;
	elseif (j <= 1.04e-265)
		tmp = ((i * t) - (c * z)) * b;
	elseif (j <= 1.15e-50)
		tmp = ((y * x) - (c * b)) * z;
	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[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -8.2e+105], t$95$1, If[LessEqual[j, 1.04e-265], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 1.15e-50], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;j \leq 1.15 \cdot 10^{-50}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -8.2000000000000005e105 or 1.1500000000000001e-50 < j

    1. Initial program 73.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 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-*.f6460.6

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

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

    if -8.2000000000000005e105 < j < 1.04e-265

    1. Initial program 73.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6445.2

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

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

    if 1.04e-265 < j < 1.1500000000000001e-50

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 50.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\ \mathbf{if}\;b \leq -9.2 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 0.14:\\ \;\;\;\;\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 t) (* c z)) b)))
   (if (<= b -9.2e+48) t_1 (if (<= b 0.14) (* (- (* 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 * t) - (c * z)) * b;
	double tmp;
	if (b <= -9.2e+48) {
		tmp = t_1;
	} else if (b <= 0.14) {
		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 * t) - (c * z)) * b
    if (b <= (-9.2d+48)) then
        tmp = t_1
    else if (b <= 0.14d0) 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 * t) - (c * z)) * b;
	double tmp;
	if (b <= -9.2e+48) {
		tmp = t_1;
	} else if (b <= 0.14) {
		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 * t) - (c * z)) * b
	tmp = 0
	if b <= -9.2e+48:
		tmp = t_1
	elif b <= 0.14:
		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 * t) - Float64(c * z)) * b)
	tmp = 0.0
	if (b <= -9.2e+48)
		tmp = t_1;
	elseif (b <= 0.14)
		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 * t) - (c * z)) * b;
	tmp = 0.0;
	if (b <= -9.2e+48)
		tmp = t_1;
	elseif (b <= 0.14)
		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 * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -9.2e+48], t$95$1, If[LessEqual[b, 0.14], 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 t - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 0.14:\\
\;\;\;\;\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 b < -9.2000000000000001e48 or 0.14000000000000001 < b

    1. Initial program 72.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6461.2

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

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

    if -9.2000000000000001e48 < b < 0.14000000000000001

    1. Initial program 73.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-*.f6446.3

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

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

Alternative 14: 42.2% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-b\right) \cdot \left(c \cdot z\right)\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+171}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+16}:\\ \;\;\;\;\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 (* (- b) (* c z))))
   (if (<= z -1.3e+171)
     t_1
     (if (<= z 1.55e+16) (* (- (* 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 = -b * (c * z);
	double tmp;
	if (z <= -1.3e+171) {
		tmp = t_1;
	} else if (z <= 1.55e+16) {
		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 = -b * (c * z)
    if (z <= (-1.3d+171)) then
        tmp = t_1
    else if (z <= 1.55d+16) 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 = -b * (c * z);
	double tmp;
	if (z <= -1.3e+171) {
		tmp = t_1;
	} else if (z <= 1.55e+16) {
		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 = -b * (c * z)
	tmp = 0
	if z <= -1.3e+171:
		tmp = t_1
	elif z <= 1.55e+16:
		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(-b) * Float64(c * z))
	tmp = 0.0
	if (z <= -1.3e+171)
		tmp = t_1;
	elseif (z <= 1.55e+16)
		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 = -b * (c * z);
	tmp = 0.0;
	if (z <= -1.3e+171)
		tmp = t_1;
	elseif (z <= 1.55e+16)
		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[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+171], t$95$1, If[LessEqual[z, 1.55e+16], 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(-b\right) \cdot \left(c \cdot z\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+16}:\\
\;\;\;\;\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 z < -1.3e171 or 1.55e16 < z

    1. Initial program 63.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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.1

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
      5. lift-*.f6439.1

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

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

    if -1.3e171 < z < 1.55e16

    1. Initial program 78.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 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-*.f6443.9

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

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

Alternative 15: 30.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(-i\right) \cdot y\right) \cdot j\\ t_2 := \left(-b\right) \cdot \left(c \cdot z\right)\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{-192}:\\ \;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-11}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+37}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* (- i) y) j)) (t_2 (* (- b) (* c z))))
   (if (<= z -7.4e+31)
     t_2
     (if (<= z -7e-106)
       t_1
       (if (<= z 9.6e-192)
         (* (- t) (* a x))
         (if (<= z 6e-11) t_1 (if (<= z 1.2e+37) (* (* (- a) t) x) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (-i * y) * j;
	double t_2 = -b * (c * z);
	double tmp;
	if (z <= -7.4e+31) {
		tmp = t_2;
	} else if (z <= -7e-106) {
		tmp = t_1;
	} else if (z <= 9.6e-192) {
		tmp = -t * (a * x);
	} else if (z <= 6e-11) {
		tmp = t_1;
	} else if (z <= 1.2e+37) {
		tmp = (-a * t) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-i * y) * j
    t_2 = -b * (c * z)
    if (z <= (-7.4d+31)) then
        tmp = t_2
    else if (z <= (-7d-106)) then
        tmp = t_1
    else if (z <= 9.6d-192) then
        tmp = -t * (a * x)
    else if (z <= 6d-11) then
        tmp = t_1
    else if (z <= 1.2d+37) then
        tmp = (-a * t) * x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (-i * y) * j;
	double t_2 = -b * (c * z);
	double tmp;
	if (z <= -7.4e+31) {
		tmp = t_2;
	} else if (z <= -7e-106) {
		tmp = t_1;
	} else if (z <= 9.6e-192) {
		tmp = -t * (a * x);
	} else if (z <= 6e-11) {
		tmp = t_1;
	} else if (z <= 1.2e+37) {
		tmp = (-a * t) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (-i * y) * j
	t_2 = -b * (c * z)
	tmp = 0
	if z <= -7.4e+31:
		tmp = t_2
	elif z <= -7e-106:
		tmp = t_1
	elif z <= 9.6e-192:
		tmp = -t * (a * x)
	elif z <= 6e-11:
		tmp = t_1
	elif z <= 1.2e+37:
		tmp = (-a * t) * x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(-i) * y) * j)
	t_2 = Float64(Float64(-b) * Float64(c * z))
	tmp = 0.0
	if (z <= -7.4e+31)
		tmp = t_2;
	elseif (z <= -7e-106)
		tmp = t_1;
	elseif (z <= 9.6e-192)
		tmp = Float64(Float64(-t) * Float64(a * x));
	elseif (z <= 6e-11)
		tmp = t_1;
	elseif (z <= 1.2e+37)
		tmp = Float64(Float64(Float64(-a) * t) * x);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (-i * y) * j;
	t_2 = -b * (c * z);
	tmp = 0.0;
	if (z <= -7.4e+31)
		tmp = t_2;
	elseif (z <= -7e-106)
		tmp = t_1;
	elseif (z <= 9.6e-192)
		tmp = -t * (a * x);
	elseif (z <= 6e-11)
		tmp = t_1;
	elseif (z <= 1.2e+37)
		tmp = (-a * t) * x;
	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[((-i) * y), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+31], t$95$2, If[LessEqual[z, -7e-106], t$95$1, If[LessEqual[z, 9.6e-192], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-11], t$95$1, If[LessEqual[z, 1.2e+37], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.6 \cdot 10^{-192}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+37}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.3999999999999996e31 or 1.2e37 < z

    1. Initial program 64.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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.2

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
      5. lift-*.f6437.5

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

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

    if -7.3999999999999996e31 < z < -7e-106 or 9.5999999999999997e-192 < z < 6e-11

    1. Initial program 80.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-*.f6443.9

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. lower-neg.f6424.8

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

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

    if -7e-106 < z < 9.5999999999999997e-192

    1. Initial program 80.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 t around -inf

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(a \cdot x - i \cdot \color{blue}{b}\right) \]
      8. lower-*.f6447.7

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

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

      \[\leadsto \left(-t\right) \cdot \left(a \cdot \color{blue}{x}\right) \]
    6. Step-by-step derivation
      1. lift-*.f6426.4

        \[\leadsto \left(-t\right) \cdot \left(a \cdot x\right) \]
    7. Applied rewrites26.4%

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

    if 6e-11 < z < 1.2e37

    1. Initial program 80.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-*.f6434.1

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

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

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

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      2. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      3. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      4. lower-neg.f6424.3

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
    7. Applied rewrites24.3%

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

Alternative 16: 30.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(-i\right) \cdot y\right) \cdot j\\ t_2 := \left(-b\right) \cdot \left(c \cdot z\right)\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{-192}:\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-11}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+37}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* (- i) y) j)) (t_2 (* (- b) (* c z))))
   (if (<= z -7.4e+31)
     t_2
     (if (<= z -7e-106)
       t_1
       (if (<= z 9.6e-192)
         (* (- a) (* t x))
         (if (<= z 6e-11) t_1 (if (<= z 1.2e+37) (* (* (- a) t) x) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (-i * y) * j;
	double t_2 = -b * (c * z);
	double tmp;
	if (z <= -7.4e+31) {
		tmp = t_2;
	} else if (z <= -7e-106) {
		tmp = t_1;
	} else if (z <= 9.6e-192) {
		tmp = -a * (t * x);
	} else if (z <= 6e-11) {
		tmp = t_1;
	} else if (z <= 1.2e+37) {
		tmp = (-a * t) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-i * y) * j
    t_2 = -b * (c * z)
    if (z <= (-7.4d+31)) then
        tmp = t_2
    else if (z <= (-7d-106)) then
        tmp = t_1
    else if (z <= 9.6d-192) then
        tmp = -a * (t * x)
    else if (z <= 6d-11) then
        tmp = t_1
    else if (z <= 1.2d+37) then
        tmp = (-a * t) * x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (-i * y) * j;
	double t_2 = -b * (c * z);
	double tmp;
	if (z <= -7.4e+31) {
		tmp = t_2;
	} else if (z <= -7e-106) {
		tmp = t_1;
	} else if (z <= 9.6e-192) {
		tmp = -a * (t * x);
	} else if (z <= 6e-11) {
		tmp = t_1;
	} else if (z <= 1.2e+37) {
		tmp = (-a * t) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (-i * y) * j
	t_2 = -b * (c * z)
	tmp = 0
	if z <= -7.4e+31:
		tmp = t_2
	elif z <= -7e-106:
		tmp = t_1
	elif z <= 9.6e-192:
		tmp = -a * (t * x)
	elif z <= 6e-11:
		tmp = t_1
	elif z <= 1.2e+37:
		tmp = (-a * t) * x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(-i) * y) * j)
	t_2 = Float64(Float64(-b) * Float64(c * z))
	tmp = 0.0
	if (z <= -7.4e+31)
		tmp = t_2;
	elseif (z <= -7e-106)
		tmp = t_1;
	elseif (z <= 9.6e-192)
		tmp = Float64(Float64(-a) * Float64(t * x));
	elseif (z <= 6e-11)
		tmp = t_1;
	elseif (z <= 1.2e+37)
		tmp = Float64(Float64(Float64(-a) * t) * x);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (-i * y) * j;
	t_2 = -b * (c * z);
	tmp = 0.0;
	if (z <= -7.4e+31)
		tmp = t_2;
	elseif (z <= -7e-106)
		tmp = t_1;
	elseif (z <= 9.6e-192)
		tmp = -a * (t * x);
	elseif (z <= 6e-11)
		tmp = t_1;
	elseif (z <= 1.2e+37)
		tmp = (-a * t) * x;
	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[((-i) * y), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+31], t$95$2, If[LessEqual[z, -7e-106], t$95$1, If[LessEqual[z, 9.6e-192], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-11], t$95$1, If[LessEqual[z, 1.2e+37], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.6 \cdot 10^{-192}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+37}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.3999999999999996e31 or 1.2e37 < z

    1. Initial program 64.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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.2

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
      5. lift-*.f6437.5

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

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

    if -7.3999999999999996e31 < z < -7e-106 or 9.5999999999999997e-192 < z < 6e-11

    1. Initial program 80.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-*.f6443.9

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. lower-neg.f6424.8

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

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

    if -7e-106 < z < 9.5999999999999997e-192

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6450.8

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6426.4

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
    7. Applied rewrites26.4%

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

    if 6e-11 < z < 1.2e37

    1. Initial program 80.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-*.f6434.1

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

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

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

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      2. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      3. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      4. lower-neg.f6424.3

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
    7. Applied rewrites24.3%

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

Alternative 17: 30.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(-i\right) \cdot y\right) \cdot j\\ t_2 := \left(-b\right) \cdot \left(c \cdot z\right)\\ t_3 := \left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+31}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{-192}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-11}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+38}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* (- i) y) j))
        (t_2 (* (- b) (* c z)))
        (t_3 (* (- a) (* t x))))
   (if (<= z -7.4e+31)
     t_2
     (if (<= z -7e-106)
       t_1
       (if (<= z 9.6e-192)
         t_3
         (if (<= z 6e-11) t_1 (if (<= z 3.5e+38) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (-i * y) * j;
	double t_2 = -b * (c * z);
	double t_3 = -a * (t * x);
	double tmp;
	if (z <= -7.4e+31) {
		tmp = t_2;
	} else if (z <= -7e-106) {
		tmp = t_1;
	} else if (z <= 9.6e-192) {
		tmp = t_3;
	} else if (z <= 6e-11) {
		tmp = t_1;
	} else if (z <= 3.5e+38) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = (-i * y) * j
    t_2 = -b * (c * z)
    t_3 = -a * (t * x)
    if (z <= (-7.4d+31)) then
        tmp = t_2
    else if (z <= (-7d-106)) then
        tmp = t_1
    else if (z <= 9.6d-192) then
        tmp = t_3
    else if (z <= 6d-11) then
        tmp = t_1
    else if (z <= 3.5d+38) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (-i * y) * j;
	double t_2 = -b * (c * z);
	double t_3 = -a * (t * x);
	double tmp;
	if (z <= -7.4e+31) {
		tmp = t_2;
	} else if (z <= -7e-106) {
		tmp = t_1;
	} else if (z <= 9.6e-192) {
		tmp = t_3;
	} else if (z <= 6e-11) {
		tmp = t_1;
	} else if (z <= 3.5e+38) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (-i * y) * j
	t_2 = -b * (c * z)
	t_3 = -a * (t * x)
	tmp = 0
	if z <= -7.4e+31:
		tmp = t_2
	elif z <= -7e-106:
		tmp = t_1
	elif z <= 9.6e-192:
		tmp = t_3
	elif z <= 6e-11:
		tmp = t_1
	elif z <= 3.5e+38:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(-i) * y) * j)
	t_2 = Float64(Float64(-b) * Float64(c * z))
	t_3 = Float64(Float64(-a) * Float64(t * x))
	tmp = 0.0
	if (z <= -7.4e+31)
		tmp = t_2;
	elseif (z <= -7e-106)
		tmp = t_1;
	elseif (z <= 9.6e-192)
		tmp = t_3;
	elseif (z <= 6e-11)
		tmp = t_1;
	elseif (z <= 3.5e+38)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (-i * y) * j;
	t_2 = -b * (c * z);
	t_3 = -a * (t * x);
	tmp = 0.0;
	if (z <= -7.4e+31)
		tmp = t_2;
	elseif (z <= -7e-106)
		tmp = t_1;
	elseif (z <= 9.6e-192)
		tmp = t_3;
	elseif (z <= 6e-11)
		tmp = t_1;
	elseif (z <= 3.5e+38)
		tmp = t_3;
	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[((-i) * y), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+31], t$95$2, If[LessEqual[z, -7e-106], t$95$1, If[LessEqual[z, 9.6e-192], t$95$3, If[LessEqual[z, 6e-11], t$95$1, If[LessEqual[z, 3.5e+38], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.6 \cdot 10^{-192}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.3999999999999996e31 or 3.50000000000000002e38 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.2

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
      5. lift-*.f6437.5

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

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

    if -7.3999999999999996e31 < z < -7e-106 or 9.5999999999999997e-192 < z < 6e-11

    1. Initial program 80.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-*.f6443.9

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. lower-neg.f6424.8

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

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

    if -7e-106 < z < 9.5999999999999997e-192 or 6e-11 < z < 3.50000000000000002e38

    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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6452.6

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites52.6%

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

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. lower-neg.f64N/A

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

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
    7. Applied rewrites26.2%

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

Alternative 18: 30.3% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-b\right) \cdot \left(c \cdot z\right)\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+52}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-69}:\\ \;\;\;\;\left(b \cdot t\right) \cdot i\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+38}:\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- b) (* c z))))
   (if (<= z -7.5e+52)
     t_1
     (if (<= z -8.2e-69)
       (* (* b t) i)
       (if (<= z 3.5e+38) (* (- a) (* t 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 = -b * (c * z);
	double tmp;
	if (z <= -7.5e+52) {
		tmp = t_1;
	} else if (z <= -8.2e-69) {
		tmp = (b * t) * i;
	} else if (z <= 3.5e+38) {
		tmp = -a * (t * 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 = -b * (c * z)
    if (z <= (-7.5d+52)) then
        tmp = t_1
    else if (z <= (-8.2d-69)) then
        tmp = (b * t) * i
    else if (z <= 3.5d+38) then
        tmp = -a * (t * 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 = -b * (c * z);
	double tmp;
	if (z <= -7.5e+52) {
		tmp = t_1;
	} else if (z <= -8.2e-69) {
		tmp = (b * t) * i;
	} else if (z <= 3.5e+38) {
		tmp = -a * (t * x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = -b * (c * z)
	tmp = 0
	if z <= -7.5e+52:
		tmp = t_1
	elif z <= -8.2e-69:
		tmp = (b * t) * i
	elif z <= 3.5e+38:
		tmp = -a * (t * x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(-b) * Float64(c * z))
	tmp = 0.0
	if (z <= -7.5e+52)
		tmp = t_1;
	elseif (z <= -8.2e-69)
		tmp = Float64(Float64(b * t) * i);
	elseif (z <= 3.5e+38)
		tmp = Float64(Float64(-a) * Float64(t * x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = -b * (c * z);
	tmp = 0.0;
	if (z <= -7.5e+52)
		tmp = t_1;
	elseif (z <= -8.2e-69)
		tmp = (b * t) * i;
	elseif (z <= 3.5e+38)
		tmp = -a * (t * 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[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+52], t$95$1, If[LessEqual[z, -8.2e-69], N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[z, 3.5e+38], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8.2 \cdot 10^{-69}:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\

\mathbf{elif}\;z \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.49999999999999995e52 or 3.50000000000000002e38 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.3

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
      5. lift-*.f6438.1

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

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

    if -7.49999999999999995e52 < z < -8.1999999999999998e-69

    1. Initial program 78.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 b around 0

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      4. 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 \]
      5. fp-cancel-sign-sub-invN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i \]
    7. Applied rewrites37.9%

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

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

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

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

    if -8.1999999999999998e-69 < z < 3.50000000000000002e38

    1. Initial program 80.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 j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6453.8

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6425.5

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
    7. Applied rewrites25.5%

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

Alternative 19: 30.3% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{if}\;a \leq -8.5:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+21}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.5 or 1.9e21 < a

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6452.8

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6432.8

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

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

    if -8.5 < a < -3.2999999999999999e-156

    1. Initial program 79.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 b around 0

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      4. 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 \]
      5. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

    if -3.2999999999999999e-156 < a < 1.9e21

    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 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-*.f6431.9

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f6425.8

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

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

Alternative 20: 29.5% accurate, 2.2× speedup?

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

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

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

\mathbf{elif}\;a \leq 7500000000000:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.6e14

    1. Initial program 66.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 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-*.f6449.2

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

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

      \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
    6. 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-*.f6436.6

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

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

    if -6.6e14 < a < -3.2999999999999999e-156

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\right) \]
    4. Applied rewrites81.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      4. 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 \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot i \]
      6. +-commutativeN/A

        \[\leadsto \left(b \cdot t + -1 \cdot \left(j \cdot y\right)\right) \cdot i \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, t, -1 \cdot \left(j \cdot y\right)\right) \cdot i \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, t, \mathsf{neg}\left(j \cdot y\right)\right) \cdot i \]
      9. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i \]
      10. lower-*.f6443.1

        \[\leadsto \mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i \]
    7. Applied rewrites43.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(b \cdot t\right) \cdot i \]
    9. Step-by-step derivation
      1. lower-*.f6423.0

        \[\leadsto \left(b \cdot t\right) \cdot i \]
    10. Applied rewrites23.0%

      \[\leadsto \left(b \cdot t\right) \cdot i \]

    if -3.2999999999999999e-156 < a < 7.5e12

    1. Initial program 80.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 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-*.f6431.9

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    4. Applied rewrites31.9%

      \[\leadsto \color{blue}{\left(z \cdot y - a \cdot t\right) \cdot x} \]
    5. Taylor expanded in y around inf

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f6425.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites25.9%

      \[\leadsto \left(z \cdot y\right) \cdot x \]

    if 7.5e12 < 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 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.3

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites46.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-*.f6435.2

        \[\leadsto \left(c \cdot a\right) \cdot j \]
    7. Applied rewrites35.2%

      \[\leadsto \left(c \cdot a\right) \cdot j \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 21: 29.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(c \cdot a\right) \cdot j\\ \mathbf{if}\;c \leq -3 \cdot 10^{+171}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 12000:\\ \;\;\;\;\left(b \cdot t\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* c a) j)))
   (if (<= c -3e+171) t_1 (if (<= c 12000.0) (* (* b t) i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (c * a) * j;
	double tmp;
	if (c <= -3e+171) {
		tmp = t_1;
	} else if (c <= 12000.0) {
		tmp = (b * t) * i;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (c * a) * j
    if (c <= (-3d+171)) then
        tmp = t_1
    else if (c <= 12000.0d0) then
        tmp = (b * t) * i
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (c * a) * j;
	double tmp;
	if (c <= -3e+171) {
		tmp = t_1;
	} else if (c <= 12000.0) {
		tmp = (b * t) * i;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (c * a) * j
	tmp = 0
	if c <= -3e+171:
		tmp = t_1
	elif c <= 12000.0:
		tmp = (b * t) * i
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(c * a) * j)
	tmp = 0.0
	if (c <= -3e+171)
		tmp = t_1;
	elseif (c <= 12000.0)
		tmp = Float64(Float64(b * t) * i);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (c * a) * j;
	tmp = 0.0;
	if (c <= -3e+171)
		tmp = t_1;
	elseif (c <= 12000.0)
		tmp = (b * t) * i;
	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[(c * a), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[c, -3e+171], t$95$1, If[LessEqual[c, 12000.0], N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(c \cdot a\right) \cdot j\\
\mathbf{if}\;c \leq -3 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 12000:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.0000000000000001e171 or 12000 < c

    1. Initial program 64.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-*.f6446.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites46.9%

      \[\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-*.f6437.9

        \[\leadsto \left(c \cdot a\right) \cdot j \]
    7. Applied rewrites37.9%

      \[\leadsto \left(c \cdot a\right) \cdot j \]

    if -3.0000000000000001e171 < c < 12000

    1. Initial program 78.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 b around 0

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right) + \left(j \cdot \left(a \cdot c - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b + \left(\color{blue}{j \cdot \left(a \cdot c - i \cdot y\right)} + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, \color{blue}{b}, j \cdot \left(a \cdot c - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, j \cdot \left(a \cdot c - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, j \cdot \left(a \cdot c - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, j \cdot \left(a \cdot c - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, \left(a \cdot c - i \cdot y\right) \cdot j + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, \left(c \cdot a - i \cdot y\right) \cdot j + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, \left(c \cdot a - y \cdot i\right) \cdot j + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\right) \]
    4. Applied rewrites81.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      4. 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 \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot i \]
      6. +-commutativeN/A

        \[\leadsto \left(b \cdot t + -1 \cdot \left(j \cdot y\right)\right) \cdot i \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, t, -1 \cdot \left(j \cdot y\right)\right) \cdot i \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, t, \mathsf{neg}\left(j \cdot y\right)\right) \cdot i \]
      9. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i \]
      10. lower-*.f6445.2

        \[\leadsto \mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i \]
    7. Applied rewrites45.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(b \cdot t\right) \cdot i \]
    9. Step-by-step derivation
      1. lower-*.f6424.6

        \[\leadsto \left(b \cdot t\right) \cdot i \]
    10. Applied rewrites24.6%

      \[\leadsto \left(b \cdot t\right) \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 22: 28.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot c\right) \cdot a\\ \mathbf{if}\;j \leq -3200000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;j \leq 9 \cdot 10^{-72}:\\ \;\;\;\;\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 (* (* j c) a)))
   (if (<= j -3200000000000.0) t_1 (if (<= j 9e-72) (* (* 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 = (j * c) * a;
	double tmp;
	if (j <= -3200000000000.0) {
		tmp = t_1;
	} else if (j <= 9e-72) {
		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 = (j * c) * a
    if (j <= (-3200000000000.0d0)) then
        tmp = t_1
    else if (j <= 9d-72) 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 = (j * c) * a;
	double tmp;
	if (j <= -3200000000000.0) {
		tmp = t_1;
	} else if (j <= 9e-72) {
		tmp = (i * t) * b;
	} 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 j <= -3200000000000.0:
		tmp = t_1
	elif j <= 9e-72:
		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(j * c) * a)
	tmp = 0.0
	if (j <= -3200000000000.0)
		tmp = t_1;
	elseif (j <= 9e-72)
		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 = (j * c) * a;
	tmp = 0.0;
	if (j <= -3200000000000.0)
		tmp = t_1;
	elseif (j <= 9e-72)
		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[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[j, -3200000000000.0], t$95$1, If[LessEqual[j, 9e-72], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;j \leq -3200000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;j \leq 9 \cdot 10^{-72}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -3.2e12 or 9e-72 < j

    1. Initial program 73.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 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-*.f6457.7

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites57.7%

      \[\leadsto \color{blue}{\left(c \cdot a - i \cdot y\right) \cdot j} \]
    5. Taylor expanded in y around 0

      \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
    6. 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.9

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    7. Applied rewrites32.9%

      \[\leadsto \left(j \cdot c\right) \cdot \color{blue}{a} \]

    if -3.2e12 < j < 9e-72

    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 j around 0

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \left(c \cdot z - i \cdot t\right)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x - \color{blue}{b} \cdot \left(c \cdot z - i \cdot t\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x - \color{blue}{b} \cdot \left(c \cdot z - i \cdot t\right) \]
      5. lift--.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(z \cdot y - t \cdot a\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - t \cdot a\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot \color{blue}{b} \]
      11. *-commutativeN/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - t \cdot i\right) \cdot b \]
      12. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - t \cdot i\right) \cdot \color{blue}{b} \]
      13. lift--.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - t \cdot i\right) \cdot b \]
      14. *-commutativeN/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      15. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6471.5

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites71.5%

      \[\leadsto \color{blue}{\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b} \]
    5. Taylor expanded in i around inf

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6425.2

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Applied rewrites25.2%

      \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 23: 22.7% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(j \cdot c\right) \cdot a \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* j c) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (j * c) * a;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, 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 = (j * c) * a
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 (j * c) * a;
}
def code(x, y, z, t, a, b, c, i, j):
	return (j * c) * a
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(j * c) * a)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (j * c) * a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}

\\
\left(j \cdot c\right) \cdot a
\end{array}
Derivation
  1. Initial program 73.4%

    \[\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-*.f6440.4

      \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
  4. Applied rewrites40.4%

    \[\leadsto \color{blue}{\left(c \cdot a - i \cdot y\right) \cdot j} \]
  5. Taylor expanded in y around 0

    \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
  6. 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-*.f6422.7

      \[\leadsto \left(j \cdot c\right) \cdot a \]
  7. Applied rewrites22.7%

    \[\leadsto \left(j \cdot c\right) \cdot \color{blue}{a} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2025120 
(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)))))