Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 73.2% → 82.2%
Time: 7.3s
Alternatives: 21
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (+
  (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
  (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j):
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y))))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 73.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (+
  (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
  (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j):
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y))))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 82.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 73.2%

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

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

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 65.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;j \leq 4.5 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t\_3 \cdot x - \left(-a\right) \cdot \left(i \cdot b\right)\right)\\

\mathbf{elif}\;j \leq 10^{+129}:\\
\;\;\;\;\left(\left(\frac{\left(-t\right) \cdot x}{b} + i\right) \cdot a\right) \cdot b + t\_2\\

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


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

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000014e151 < j < 4.5e-73

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

    if 4.5e-73 < j < 1e129

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{\left(\mathsf{neg}\left(t\right)\right) \cdot x}{b} + i\right) \cdot a\right) \cdot b + j \cdot \left(c \cdot t - i \cdot y\right) \]
      10. lower-neg.f6455.3

        \[\leadsto \left(\left(\frac{\left(-t\right) \cdot x}{b} + i\right) \cdot a\right) \cdot b + j \cdot \left(c \cdot t - i \cdot y\right) \]
    7. Applied rewrites55.3%

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

    if 1e129 < j

    1. Initial program 73.2%

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-*.f6449.1

        \[\leadsto \left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
    4. Applied rewrites49.1%

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

Alternative 3: 65.1% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.49999999999999995e-149 or 2.5000000000000001e-220 < y

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999995e-149 < y < 2.5000000000000001e-220

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\left(\frac{z \cdot y}{t} - a\right) \cdot t\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      6. lower-*.f6470.1

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\left(z \cdot \frac{y}{t} - a\right) \cdot t\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      5. lower-/.f6467.5

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

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

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

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

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

Alternative 4: 64.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot y - a \cdot t\\ t_2 := \mathsf{fma}\left(t\_1, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\\ \mathbf{if}\;j \leq -8 \cdot 10^{+151}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;j \leq 3.6 \cdot 10^{-31}:\\ \;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t\_1 \cdot x - \left(-a\right) \cdot \left(i \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (- (* z y) (* a t))) (t_2 (fma t_1 x (* (- (* c t) (* i y)) j))))
   (if (<= j -8e+151)
     t_2
     (if (<= j 3.6e-31)
       (fma (- i) (* j y) (- (* t_1 x) (* (- a) (* i b))))
       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 = (z * y) - (a * t);
	double t_2 = fma(t_1, x, (((c * t) - (i * y)) * j));
	double tmp;
	if (j <= -8e+151) {
		tmp = t_2;
	} else if (j <= 3.6e-31) {
		tmp = fma(-i, (j * y), ((t_1 * x) - (-a * (i * b))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(z * y) - Float64(a * t))
	t_2 = fma(t_1, x, Float64(Float64(Float64(c * t) - Float64(i * y)) * j))
	tmp = 0.0
	if (j <= -8e+151)
		tmp = t_2;
	elseif (j <= 3.6e-31)
		tmp = fma(Float64(-i), Float64(j * y), Float64(Float64(t_1 * x) - Float64(Float64(-a) * Float64(i * b))));
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(t$95$1 * x + N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+151], t$95$2, If[LessEqual[j, 3.6e-31], N[((-i) * N[(j * y), $MachinePrecision] + N[(N[(t$95$1 * x), $MachinePrecision] - N[((-a) * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;j \leq 3.6 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t\_1 \cdot x - \left(-a\right) \cdot \left(i \cdot b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -8.00000000000000014e151 or 3.60000000000000004e-31 < j

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000014e151 < j < 3.60000000000000004e-31

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 63.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+157}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.4e157

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

    if -2.4e157 < b

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 56.7% accurate, 1.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.8000000000000006e219 or 1.05e11 < a

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -8.8000000000000006e219 < a < 1.05e11

    1. Initial program 73.2%

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-*.f6449.1

        \[\leadsto \left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
    4. Applied rewrites49.1%

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

Alternative 7: 52.0% accurate, 1.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -9.49999999999999975e127 or 2.39999999999999993e-20 < t

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.49999999999999975e127 < t < -1.95e-25

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -1.95e-25 < t < 5.0000000000000003e-291

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e-291 < t < 2.39999999999999993e-20

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

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

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

Alternative 8: 51.4% accurate, 1.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.49999999999999975e127 or 2.39999999999999993e-20 < t

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.49999999999999975e127 < t < -1.95e-25

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -1.95e-25 < t < 2.39999999999999993e-20

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 51.1% accurate, 2.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.0000000000000006e128 or 2.39999999999999993e-20 < t

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000006e128 < t < 2.39999999999999993e-20

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 50.6% accurate, 1.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.99999999999999973e118 or 2.19999999999999996e-98 < t

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999973e118 < t < -7.5000000000000003e37

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      6. lift-*.f6438.4

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

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

    if -7.5000000000000003e37 < t < 2.19999999999999996e-98

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

Alternative 11: 50.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot t - b \cdot z\right) \cdot c\\ \mathbf{if}\;c \leq -4.7 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 9 \cdot 10^{+41}:\\ \;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* j t) (* b z)) c)))
   (if (<= c -4.7e+114) t_1 (if (<= c 9e+41) (* (- (* z y) (* 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 = ((j * t) - (b * z)) * c;
	double tmp;
	if (c <= -4.7e+114) {
		tmp = t_1;
	} else if (c <= 9e+41) {
		tmp = ((z * y) - (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 = ((j * t) - (b * z)) * c
    if (c <= (-4.7d+114)) then
        tmp = t_1
    else if (c <= 9d+41) then
        tmp = ((z * y) - (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 = ((j * t) - (b * z)) * c;
	double tmp;
	if (c <= -4.7e+114) {
		tmp = t_1;
	} else if (c <= 9e+41) {
		tmp = ((z * y) - (a * t)) * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((j * t) - (b * z)) * c
	tmp = 0
	if c <= -4.7e+114:
		tmp = t_1
	elif c <= 9e+41:
		tmp = ((z * y) - (a * t)) * x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(j * t) - Float64(b * z)) * c)
	tmp = 0.0
	if (c <= -4.7e+114)
		tmp = t_1;
	elseif (c <= 9e+41)
		tmp = Float64(Float64(Float64(z * y) - Float64(a * 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 = ((j * t) - (b * z)) * c;
	tmp = 0.0;
	if (c <= -4.7e+114)
		tmp = t_1;
	elseif (c <= 9e+41)
		tmp = ((z * y) - (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[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -4.7e+114], t$95$1, If[LessEqual[c, 9e+41], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.7000000000000001e114 or 9.0000000000000002e41 < c

    1. Initial program 73.2%

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

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

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

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

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

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot c \]
      5. lower-*.f6440.4

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

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

    if -4.7000000000000001e114 < c < 9.0000000000000002e41

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      6. lift-*.f6438.4

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

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

Alternative 12: 42.9% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.50000000000000004e99

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      4. lift-neg.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      11. lower-*.f6421.8

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

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

    if -2.50000000000000004e99 < t < 9.19999999999999995e-166

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

    if 9.19999999999999995e-166 < t < 5.9999999999999998e234

    1. Initial program 73.2%

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

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

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

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

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

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot c \]
      5. lower-*.f6440.4

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

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

    if 5.9999999999999998e234 < t

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

Alternative 13: 41.5% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\

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

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


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

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      4. lift-neg.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      11. lower-*.f6421.8

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

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

    if -2.50000000000000004e99 < t < 9.50000000000000054e26

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

    if 9.50000000000000054e26 < t

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

Alternative 14: 30.2% accurate, 1.8× speedup?

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

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

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

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

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

\mathbf{elif}\;c \leq 8.2 \cdot 10^{-244}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

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

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


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

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      3. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-neg.f6423.0

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

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

    if -7.6000000000000001e114 < c < -4.1999999999999998e-159

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      4. lift-neg.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      11. lower-*.f6421.8

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

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

    if -4.1999999999999998e-159 < c < 8.2000000000000004e-244

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      5. lift-neg.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
      11. lift-*.f6435.5

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6422.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    10. Applied rewrites22.1%

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

    if 8.2000000000000004e-244 < c < 3.09999999999999977e34

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

    if 3.09999999999999977e34 < c

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot c\right) \cdot t \]
      2. lift-*.f6422.4

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

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

Alternative 15: 30.0% accurate, 1.8× speedup?

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

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

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

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

\mathbf{elif}\;b \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;b \leq 4.5 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -9.99999999999999944e118

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      2. lift-*.f6422.2

        \[\leadsto \left(i \cdot a\right) \cdot b \]
    7. Applied rewrites22.2%

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

    if -9.99999999999999944e118 < b < -7.79999999999999937e29 or 1.3999999999999999e-282 < b < 4.4999999999999998e239

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6422.6

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

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

    if -7.79999999999999937e29 < b < 1.3999999999999999e-282

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999998e239 < b

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      5. lift-neg.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
      11. lift-*.f6435.5

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6422.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    10. Applied rewrites22.1%

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

Alternative 16: 29.8% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;b \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;b \leq 4.5 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -9.99999999999999944e118 or 4.4999999999999998e239 < b

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      5. lift-neg.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
      11. lift-*.f6435.5

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6422.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    10. Applied rewrites22.1%

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

    if -9.99999999999999944e118 < b < -7.79999999999999937e29 or 1.3999999999999999e-282 < b < 4.4999999999999998e239

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6422.6

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

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

    if -7.79999999999999937e29 < b < 1.3999999999999999e-282

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 29.8% accurate, 2.2× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, 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 (j <= (-5.5d+98)) then
        tmp = (j * c) * t
    else if (j <= 1.18d-180) then
        tmp = (-a * t) * x
    else if (j <= 1.78d+103) then
        tmp = (i * a) * b
    else
        tmp = (j * t) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (j <= -5.5e+98) {
		tmp = (j * c) * t;
	} else if (j <= 1.18e-180) {
		tmp = (-a * t) * x;
	} else if (j <= 1.78e+103) {
		tmp = (i * a) * b;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if j <= -5.5e+98:
		tmp = (j * c) * t
	elif j <= 1.18e-180:
		tmp = (-a * t) * x
	elif j <= 1.78e+103:
		tmp = (i * a) * b
	else:
		tmp = (j * t) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (j <= -5.5e+98)
		tmp = Float64(Float64(j * c) * t);
	elseif (j <= 1.18e-180)
		tmp = Float64(Float64(Float64(-a) * t) * x);
	elseif (j <= 1.78e+103)
		tmp = Float64(Float64(i * a) * b);
	else
		tmp = Float64(Float64(j * t) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (j <= -5.5e+98)
		tmp = (j * c) * t;
	elseif (j <= 1.18e-180)
		tmp = (-a * t) * x;
	elseif (j <= 1.78e+103)
		tmp = (i * a) * b;
	else
		tmp = (j * t) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -5.5e+98], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, 1.18e-180], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.78e+103], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;j \leq -5.5 \cdot 10^{+98}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\

\mathbf{elif}\;j \leq 1.18 \cdot 10^{-180}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\

\mathbf{elif}\;j \leq 1.78 \cdot 10^{+103}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\

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


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

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot c\right) \cdot t \]
      2. lift-*.f6422.4

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

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

    if -5.49999999999999946e98 < j < 1.18000000000000002e-180

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      4. lift-neg.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      11. lower-*.f6421.8

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

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

    if 1.18000000000000002e-180 < j < 1.78e103

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.3

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

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      2. lift-*.f6422.2

        \[\leadsto \left(i \cdot a\right) \cdot b \]
    7. Applied rewrites22.2%

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

    if 1.78e103 < j

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6422.6

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

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

Alternative 18: 29.4% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;c \leq 8.2 \cdot 10^{-244}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{elif}\;c \leq 3.1 \cdot 10^{+34}:\\
\;\;\;\;\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 c < -9.99999999999999929e-40 or 3.09999999999999977e34 < c

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot c\right) \cdot t \]
      2. lift-*.f6422.4

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

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

    if -9.99999999999999929e-40 < c < 8.2000000000000004e-244

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      5. lift-neg.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
      11. lift-*.f6435.5

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6422.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    10. Applied rewrites22.1%

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

    if 8.2000000000000004e-244 < c < 3.09999999999999977e34

    1. Initial program 73.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), x, c \cdot j\right) \cdot t \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x, c \cdot j\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
      8. lower-*.f6439.2

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x 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. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      3. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      4. lift-neg.f64N/A

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6422.0

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
    7. Applied rewrites22.0%

      \[\leadsto \left(-a\right) \cdot \color{blue}{\left(t \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 28.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot t\right) \cdot c\\ \mathbf{if}\;j \leq -1.05 \cdot 10^{+73}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;j \leq 1.78 \cdot 10^{+103}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* j t) c)))
   (if (<= j -1.05e+73) t_1 (if (<= j 1.78e+103) (* (* i b) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (j * t) * c;
	double tmp;
	if (j <= -1.05e+73) {
		tmp = t_1;
	} else if (j <= 1.78e+103) {
		tmp = (i * b) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (j * t) * c
    if (j <= (-1.05d+73)) then
        tmp = t_1
    else if (j <= 1.78d+103) then
        tmp = (i * b) * a
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (j * t) * c;
	double tmp;
	if (j <= -1.05e+73) {
		tmp = t_1;
	} else if (j <= 1.78e+103) {
		tmp = (i * b) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (j * t) * c
	tmp = 0
	if j <= -1.05e+73:
		tmp = t_1
	elif j <= 1.78e+103:
		tmp = (i * b) * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(j * t) * c)
	tmp = 0.0
	if (j <= -1.05e+73)
		tmp = t_1;
	elseif (j <= 1.78e+103)
		tmp = Float64(Float64(i * b) * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (j * t) * c;
	tmp = 0.0;
	if (j <= -1.05e+73)
		tmp = t_1;
	elseif (j <= 1.78e+103)
		tmp = (i * b) * a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[j, -1.05e+73], t$95$1, If[LessEqual[j, 1.78e+103], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;j \leq -1.05 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;j \leq 1.78 \cdot 10^{+103}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -1.0500000000000001e73 or 1.78e103 < j

    1. Initial program 73.2%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot x + c \cdot j\right) \cdot t \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x + c \cdot j\right) \cdot t \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), x, c \cdot j\right) \cdot t \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x, c \cdot j\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
      8. lower-*.f6439.2

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6422.6

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    7. Applied rewrites22.6%

      \[\leadsto \left(j \cdot t\right) \cdot \color{blue}{c} \]

    if -1.0500000000000001e73 < j < 1.78e103

    1. Initial program 73.2%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      5. lower--.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{a \cdot b}\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{a} \cdot b\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
    4. Applied rewrites38.5%

      \[\leadsto \color{blue}{\left(-i\right) \cdot \left(j \cdot y - b \cdot a\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto j \cdot \color{blue}{\left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      5. lift-neg.f64N/A

        \[\leadsto \left(\left(-i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(b \cdot i\right) \cdot a}{j}\right) \cdot j \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(b \cdot i\right) \cdot a}{j}\right) \cdot j \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
      11. lift-*.f6435.5

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
    7. Applied rewrites35.5%

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6422.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    10. Applied rewrites22.1%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 27.8% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := j \cdot \left(c \cdot t\right)\\ \mathbf{if}\;j \leq -6.7 \cdot 10^{+72}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;j \leq 2 \cdot 10^{+103}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* j (* c t))))
   (if (<= j -6.7e+72) t_1 (if (<= j 2e+103) (* (* i b) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = j * (c * t);
	double tmp;
	if (j <= -6.7e+72) {
		tmp = t_1;
	} else if (j <= 2e+103) {
		tmp = (i * b) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = j * (c * t)
    if (j <= (-6.7d+72)) then
        tmp = t_1
    else if (j <= 2d+103) then
        tmp = (i * b) * a
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = j * (c * t);
	double tmp;
	if (j <= -6.7e+72) {
		tmp = t_1;
	} else if (j <= 2e+103) {
		tmp = (i * b) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = j * (c * t)
	tmp = 0
	if j <= -6.7e+72:
		tmp = t_1
	elif j <= 2e+103:
		tmp = (i * b) * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(j * Float64(c * t))
	tmp = 0.0
	if (j <= -6.7e+72)
		tmp = t_1;
	elseif (j <= 2e+103)
		tmp = Float64(Float64(i * b) * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = j * (c * t);
	tmp = 0.0;
	if (j <= -6.7e+72)
		tmp = t_1;
	elseif (j <= 2e+103)
		tmp = (i * b) * a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -6.7e+72], t$95$1, If[LessEqual[j, 2e+103], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t\right)\\
\mathbf{if}\;j \leq -6.7 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;j \leq 2 \cdot 10^{+103}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -6.6999999999999998e72 or 2e103 < j

    1. Initial program 73.2%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + c \cdot j\right) \cdot \color{blue}{t} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot x + c \cdot j\right) \cdot t \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x + c \cdot j\right) \cdot t \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), x, c \cdot j\right) \cdot t \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x, c \cdot j\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
      8. lower-*.f6439.2

        \[\leadsto \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6422.6

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    7. Applied rewrites22.6%

      \[\leadsto \left(j \cdot t\right) \cdot \color{blue}{c} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lift-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. associate-*l*N/A

        \[\leadsto j \cdot \left(t \cdot \color{blue}{c}\right) \]
      4. *-commutativeN/A

        \[\leadsto j \cdot \left(c \cdot t\right) \]
      5. lower-*.f64N/A

        \[\leadsto j \cdot \left(c \cdot \color{blue}{t}\right) \]
      6. lift-*.f6422.6

        \[\leadsto j \cdot \left(c \cdot t\right) \]
    9. Applied rewrites22.6%

      \[\leadsto j \cdot \left(c \cdot \color{blue}{t}\right) \]

    if -6.6999999999999998e72 < j < 2e103

    1. Initial program 73.2%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
      5. lower--.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{a \cdot b}\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{a} \cdot b\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
      8. lower-*.f6438.5

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
    4. Applied rewrites38.5%

      \[\leadsto \color{blue}{\left(-i\right) \cdot \left(j \cdot y - b \cdot a\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto j \cdot \color{blue}{\left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      5. lift-neg.f64N/A

        \[\leadsto \left(\left(-i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(b \cdot i\right) \cdot a}{j}\right) \cdot j \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(b \cdot i\right) \cdot a}{j}\right) \cdot j \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
      11. lift-*.f6435.5

        \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
    7. Applied rewrites35.5%

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6422.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    10. Applied rewrites22.1%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 22.1% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(i \cdot b\right) \cdot a \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* i b) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (i * b) * a;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, 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 = (i * b) * 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 (i * b) * a;
}
def code(x, y, z, t, a, b, c, i, j):
	return (i * b) * a
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(i * b) * a)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (i * b) * a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}

\\
\left(i \cdot b\right) \cdot a
\end{array}
Derivation
  1. Initial program 73.2%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
  2. Taylor expanded in i around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(j \cdot y - a \cdot b\right)\right)} \]
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot i\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
    2. mul-1-negN/A

      \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
    3. lower-*.f64N/A

      \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(j \cdot y - a \cdot b\right)} \]
    4. lower-neg.f64N/A

      \[\leadsto \left(-i\right) \cdot \left(\color{blue}{j \cdot y} - a \cdot b\right) \]
    5. lower--.f64N/A

      \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{a \cdot b}\right) \]
    6. lower-*.f64N/A

      \[\leadsto \left(-i\right) \cdot \left(j \cdot y - \color{blue}{a} \cdot b\right) \]
    7. *-commutativeN/A

      \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
    8. lower-*.f6438.5

      \[\leadsto \left(-i\right) \cdot \left(j \cdot y - b \cdot \color{blue}{a}\right) \]
  4. Applied rewrites38.5%

    \[\leadsto \color{blue}{\left(-i\right) \cdot \left(j \cdot y - b \cdot a\right)} \]
  5. Taylor expanded in j around inf

    \[\leadsto j \cdot \color{blue}{\left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right)} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    2. lower-*.f64N/A

      \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    3. associate-*r*N/A

      \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    4. mul-1-negN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    5. lift-neg.f64N/A

      \[\leadsto \left(\left(-i\right) \cdot y + \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    6. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    7. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{a \cdot \left(b \cdot i\right)}{j}\right) \cdot j \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(b \cdot i\right) \cdot a}{j}\right) \cdot j \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(b \cdot i\right) \cdot a}{j}\right) \cdot j \]
    10. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
    11. lift-*.f6435.5

      \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot j \]
  7. Applied rewrites35.5%

    \[\leadsto \mathsf{fma}\left(-i, y, \frac{\left(i \cdot b\right) \cdot a}{j}\right) \cdot \color{blue}{j} \]
  8. Taylor expanded in y around 0

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  9. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(b \cdot i\right) \cdot a \]
    2. *-commutativeN/A

      \[\leadsto \left(i \cdot b\right) \cdot a \]
    3. lift-*.f64N/A

      \[\leadsto \left(i \cdot b\right) \cdot a \]
    4. lift-*.f6422.1

      \[\leadsto \left(i \cdot b\right) \cdot a \]
  10. Applied rewrites22.1%

    \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2025139 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))