Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 73.7% → 82.0%
Time: 6.9s
Alternatives: 19
Speedup: 0.5×

Specification

?
\[\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) \]
(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]
\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)

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 73.7% accurate, 1.0× speedup?

\[\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) \]
(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]
\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)

Alternative 1: 82.0% accurate, 0.5× speedup?

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

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


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

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

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

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

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

Alternative 2: 71.9% accurate, 1.1× speedup?

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

\mathbf{elif}\;b \leq -1.85 \cdot 10^{+21}:\\
\;\;\;\;t\_3\\

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

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


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

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -3.79999999999999988e212 < b < -1.85e21 or 3.34999999999999986e47 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.85e21 < b < 3.34999999999999986e47

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 71.4% accurate, 1.1× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.85e21 or 3.34999999999999986e47 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Applied rewrites76.1%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j \cdot t, c, \mathsf{fma}\left(j \cdot \left(-y\right), i, b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right)\right)\right) \]
      4. lower-*.f6461.1%

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

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

    if -1.85e21 < b < 3.34999999999999986e47

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 4: 62.1% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \leq -5.1 \cdot 10^{+45}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;b \leq 5 \cdot 10^{-178}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + t\_1\\

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

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -3.79999999999999988e212

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -3.79999999999999988e212 < b < -5.0999999999999997e45 or 3.9e18 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0999999999999997e45 < b < -1.54999999999999994e-60

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \color{blue}{\left(c \cdot z\right)}\right)\right) \]
      3. lower-*.f6449.7%

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \left(c \cdot \color{blue}{z}\right)\right)\right) \]
    6. Applied rewrites49.7%

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

    if -1.54999999999999994e-60 < b < 4.99999999999999976e-178

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

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

    if 4.99999999999999976e-178 < b < 3.9e18

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

Alternative 5: 57.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;b \leq 5 \cdot 10^{-178}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + t\_1\\

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

\mathbf{elif}\;b \leq 1.5 \cdot 10^{+134}:\\
\;\;\;\;t\_3 + t\_1\\

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.54999999999999997e32 or 1.49999999999999998e134 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.54999999999999997e32 < b < -1.54999999999999994e-60

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \color{blue}{\left(c \cdot z\right)}\right)\right) \]
      3. lower-*.f6449.7%

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \left(c \cdot \color{blue}{z}\right)\right)\right) \]
    6. Applied rewrites49.7%

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

    if -1.54999999999999994e-60 < b < 4.99999999999999976e-178

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

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

    if 4.99999999999999976e-178 < b < 3.9e18

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if 3.9e18 < b < 1.49999999999999998e134

    1. Initial program 73.7%

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

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

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

        \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(c \cdot z\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      3. lower-*.f6449.9%

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

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

Alternative 6: 56.9% accurate, 1.2× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\ \mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -1.55 \cdot 10^{-60}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \left(c \cdot z\right)\right)\right)\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-178}:\\ \;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{elif}\;b \leq 1750000000:\\ \;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+88}:\\ \;\;\;\;j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* b (- (* a i) (* c z)))))
   (if (<= b -1.55e+32)
     t_1
     (if (<= b -1.55e-60)
       (fma (- (* z y) (* a t)) x (* -1.0 (* b (* c z))))
       (if (<= b 5e-178)
         (+ (* x (* y z)) (* j (- (* c t) (* i y))))
         (if (<= b 1750000000.0)
           (* x (- (* y z) (* a t)))
           (if (<= b 4.2e+88) (* j (fma -1.0 (* i y) (* 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 = b * ((a * i) - (c * z));
	double tmp;
	if (b <= -1.55e+32) {
		tmp = t_1;
	} else if (b <= -1.55e-60) {
		tmp = fma(((z * y) - (a * t)), x, (-1.0 * (b * (c * z))));
	} else if (b <= 5e-178) {
		tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
	} else if (b <= 1750000000.0) {
		tmp = x * ((y * z) - (a * t));
	} else if (b <= 4.2e+88) {
		tmp = j * fma(-1.0, (i * y), (c * t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z)))
	tmp = 0.0
	if (b <= -1.55e+32)
		tmp = t_1;
	elseif (b <= -1.55e-60)
		tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(-1.0 * Float64(b * Float64(c * z))));
	elseif (b <= 5e-178)
		tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y))));
	elseif (b <= 1750000000.0)
		tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t)));
	elseif (b <= 4.2e+88)
		tmp = Float64(j * fma(-1.0, Float64(i * y), 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[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.55e+32], t$95$1, If[LessEqual[b, -1.55e-60], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 * N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-178], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1750000000.0], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+88], N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.54999999999999997e32 or 4.2e88 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.54999999999999997e32 < b < -1.54999999999999994e-60

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \color{blue}{\left(c \cdot z\right)}\right)\right) \]
      3. lower-*.f6449.7%

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, -1 \cdot \left(b \cdot \left(c \cdot \color{blue}{z}\right)\right)\right) \]
    6. Applied rewrites49.7%

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

    if -1.54999999999999994e-60 < b < 4.99999999999999976e-178

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

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

    if 4.99999999999999976e-178 < b < 1.75e9

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if 1.75e9 < b < 4.2e88

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Applied rewrites76.1%

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

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

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

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

        \[\leadsto j \cdot \mathsf{fma}\left(-1, i \cdot \color{blue}{y}, c \cdot t\right) \]
      4. lower-*.f6439.2%

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

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

Alternative 7: 56.7% accurate, 1.1× speedup?

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

\mathbf{elif}\;b \leq -3.2 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.85e21 or 4.2e88 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.85e21 < b < -3.20000000000000012e-88 or 2.84999999999999985e-210 < b < 1.75e9

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if -3.20000000000000012e-88 < b < -5.1999999999999998e-167

    1. Initial program 73.7%

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} + j \cdot \left(c \cdot t - i \cdot y\right) \]
      2. lower-*.f6450.0%

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

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

    if -5.1999999999999998e-167 < b < 2.84999999999999985e-210

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(-1, i \cdot \color{blue}{j}, x \cdot z\right) \]
      4. lower-*.f6439.2%

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, i \cdot j, x \cdot z\right) \cdot \color{blue}{y} \]
      3. lower-*.f6439.2%

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

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

        \[\leadsto \left(x \cdot z + -1 \cdot \left(i \cdot j\right)\right) \cdot y \]
      6. add-flipN/A

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

        \[\leadsto \left(x \cdot z - \left(\mathsf{neg}\left(-1 \cdot \left(i \cdot j\right)\right)\right)\right) \cdot y \]
      8. distribute-lft-neg-outN/A

        \[\leadsto \left(x \cdot z - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(i \cdot j\right)\right) \cdot y \]
      9. metadata-evalN/A

        \[\leadsto \left(x \cdot z - 1 \cdot \left(i \cdot j\right)\right) \cdot y \]
      10. *-lft-identity39.2%

        \[\leadsto \left(x \cdot z - i \cdot j\right) \cdot y \]
      11. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot z - j \cdot i\right) \cdot y \]
      13. lower-*.f6439.2%

        \[\leadsto \left(x \cdot z - j \cdot i\right) \cdot y \]
    6. Applied rewrites39.2%

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

    if 1.75e9 < b < 4.2e88

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Applied rewrites76.1%

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

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

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

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

        \[\leadsto j \cdot \mathsf{fma}\left(-1, i \cdot \color{blue}{y}, c \cdot t\right) \]
      4. lower-*.f6439.2%

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

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

Alternative 8: 53.6% accurate, 1.2× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\ \mathbf{if}\;b \leq -1.8 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -3.4 \cdot 10^{-37}:\\ \;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-178}:\\ \;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{elif}\;b \leq 1750000000:\\ \;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+88}:\\ \;\;\;\;j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* b (- (* a i) (* c z)))))
   (if (<= b -1.8e+21)
     t_1
     (if (<= b -3.4e-37)
       (* (- (* j c) (* x a)) t)
       (if (<= b 5e-178)
         (+ (* x (* y z)) (* j (- (* c t) (* i y))))
         (if (<= b 1750000000.0)
           (* x (- (* y z) (* a t)))
           (if (<= b 4.2e+88) (* j (fma -1.0 (* i y) (* 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 = b * ((a * i) - (c * z));
	double tmp;
	if (b <= -1.8e+21) {
		tmp = t_1;
	} else if (b <= -3.4e-37) {
		tmp = ((j * c) - (x * a)) * t;
	} else if (b <= 5e-178) {
		tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
	} else if (b <= 1750000000.0) {
		tmp = x * ((y * z) - (a * t));
	} else if (b <= 4.2e+88) {
		tmp = j * fma(-1.0, (i * y), (c * t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z)))
	tmp = 0.0
	if (b <= -1.8e+21)
		tmp = t_1;
	elseif (b <= -3.4e-37)
		tmp = Float64(Float64(Float64(j * c) - Float64(x * a)) * t);
	elseif (b <= 5e-178)
		tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y))));
	elseif (b <= 1750000000.0)
		tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t)));
	elseif (b <= 4.2e+88)
		tmp = Float64(j * fma(-1.0, Float64(i * y), 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[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.8e+21], t$95$1, If[LessEqual[b, -3.4e-37], N[(N[(N[(j * c), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 5e-178], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1750000000.0], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+88], N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -3.4 \cdot 10^{-37}:\\
\;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\

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

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

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

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.8e21 or 4.2e88 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.8e21 < b < -3.40000000000000018e-37

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, a \cdot x, c \cdot j\right) \cdot \color{blue}{t} \]
      3. lower-*.f6438.5%

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

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

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

        \[\leadsto \left(c \cdot j + \left(\mathsf{neg}\left(a \cdot x\right)\right)\right) \cdot t \]
      7. sub-flip-reverseN/A

        \[\leadsto \left(c \cdot j - a \cdot x\right) \cdot t \]
      8. lower--.f6438.5%

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

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

        \[\leadsto \left(j \cdot c - a \cdot x\right) \cdot t \]
      11. lower-*.f6438.5%

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

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

        \[\leadsto \left(j \cdot c - x \cdot a\right) \cdot t \]
      14. lower-*.f6438.5%

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

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

    if -3.40000000000000018e-37 < b < 4.99999999999999976e-178

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

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

    if 4.99999999999999976e-178 < b < 1.75e9

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if 1.75e9 < b < 4.2e88

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Applied rewrites76.1%

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

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

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

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

        \[\leadsto j \cdot \mathsf{fma}\left(-1, i \cdot \color{blue}{y}, c \cdot t\right) \]
      4. lower-*.f6439.2%

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

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

Alternative 9: 53.1% accurate, 1.5× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\ \mathbf{if}\;b \leq -1.85 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -8.5 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-88}:\\ \;\;\;\;\left(x \cdot z - j \cdot i\right) \cdot y\\ \mathbf{elif}\;b \leq 3.35 \cdot 10^{+47}:\\ \;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* b (- (* a i) (* c z)))))
   (if (<= b -1.85e+21)
     t_1
     (if (<= b -8.5e-180)
       (* x (- (* y z) (* a t)))
       (if (<= b 5e-88)
         (* (- (* x z) (* j i)) y)
         (if (<= b 3.35e+47) (* (- (* j c) (* x a)) 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 = b * ((a * i) - (c * z));
	double tmp;
	if (b <= -1.85e+21) {
		tmp = t_1;
	} else if (b <= -8.5e-180) {
		tmp = x * ((y * z) - (a * t));
	} else if (b <= 5e-88) {
		tmp = ((x * z) - (j * i)) * y;
	} else if (b <= 3.35e+47) {
		tmp = ((j * c) - (x * a)) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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

\mathbf{elif}\;b \leq 3.35 \cdot 10^{+47}:\\
\;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.85e21 or 3.34999999999999986e47 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.85e21 < b < -8.4999999999999993e-180

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if -8.4999999999999993e-180 < b < 5.00000000000000009e-88

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(-1, i \cdot \color{blue}{j}, x \cdot z\right) \]
      4. lower-*.f6439.2%

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, i \cdot j, x \cdot z\right) \cdot \color{blue}{y} \]
      3. lower-*.f6439.2%

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

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

        \[\leadsto \left(x \cdot z + -1 \cdot \left(i \cdot j\right)\right) \cdot y \]
      6. add-flipN/A

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

        \[\leadsto \left(x \cdot z - \left(\mathsf{neg}\left(-1 \cdot \left(i \cdot j\right)\right)\right)\right) \cdot y \]
      8. distribute-lft-neg-outN/A

        \[\leadsto \left(x \cdot z - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(i \cdot j\right)\right) \cdot y \]
      9. metadata-evalN/A

        \[\leadsto \left(x \cdot z - 1 \cdot \left(i \cdot j\right)\right) \cdot y \]
      10. *-lft-identity39.2%

        \[\leadsto \left(x \cdot z - i \cdot j\right) \cdot y \]
      11. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot z - j \cdot i\right) \cdot y \]
      13. lower-*.f6439.2%

        \[\leadsto \left(x \cdot z - j \cdot i\right) \cdot y \]
    6. Applied rewrites39.2%

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

    if 5.00000000000000009e-88 < b < 3.34999999999999986e47

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, a \cdot x, c \cdot j\right) \cdot \color{blue}{t} \]
      3. lower-*.f6438.5%

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

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

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

        \[\leadsto \left(c \cdot j + \left(\mathsf{neg}\left(a \cdot x\right)\right)\right) \cdot t \]
      7. sub-flip-reverseN/A

        \[\leadsto \left(c \cdot j - a \cdot x\right) \cdot t \]
      8. lower--.f6438.5%

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

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

        \[\leadsto \left(j \cdot c - a \cdot x\right) \cdot t \]
      11. lower-*.f6438.5%

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

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

        \[\leadsto \left(j \cdot c - x \cdot a\right) \cdot t \]
      14. lower-*.f6438.5%

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

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

Alternative 10: 52.9% accurate, 1.6× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.85e21 or 4.2e88 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.85e21 < b < 1.75e9

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if 1.75e9 < b < 4.2e88

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Applied rewrites76.1%

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

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

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

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

        \[\leadsto j \cdot \mathsf{fma}\left(-1, i \cdot \color{blue}{y}, c \cdot t\right) \]
      4. lower-*.f6439.2%

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

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

Alternative 11: 52.5% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\ \mathbf{if}\;b \leq -1.85 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.18 \cdot 10^{-85}:\\ \;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\ \mathbf{elif}\;b \leq 3.35 \cdot 10^{+47}:\\ \;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* b (- (* a i) (* c z)))))
   (if (<= b -1.85e+21)
     t_1
     (if (<= b 1.18e-85)
       (* x (- (* y z) (* a t)))
       (if (<= b 3.35e+47) (* (- (* j c) (* x a)) 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 = b * ((a * i) - (c * z));
	double tmp;
	if (b <= -1.85e+21) {
		tmp = t_1;
	} else if (b <= 1.18e-85) {
		tmp = x * ((y * z) - (a * t));
	} else if (b <= 3.35e+47) {
		tmp = ((j * c) - (x * a)) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

\mathbf{elif}\;b \leq 3.35 \cdot 10^{+47}:\\
\;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.85e21 or 3.34999999999999986e47 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.85e21 < b < 1.18e-85

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

    if 1.18e-85 < b < 3.34999999999999986e47

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, a \cdot x, c \cdot j\right) \cdot \color{blue}{t} \]
      3. lower-*.f6438.5%

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

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

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

        \[\leadsto \left(c \cdot j + \left(\mathsf{neg}\left(a \cdot x\right)\right)\right) \cdot t \]
      7. sub-flip-reverseN/A

        \[\leadsto \left(c \cdot j - a \cdot x\right) \cdot t \]
      8. lower--.f6438.5%

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

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

        \[\leadsto \left(j \cdot c - a \cdot x\right) \cdot t \]
      11. lower-*.f6438.5%

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

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

        \[\leadsto \left(j \cdot c - x \cdot a\right) \cdot t \]
      14. lower-*.f6438.5%

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

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

Alternative 12: 52.2% accurate, 2.0× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.85e21 or 3.34999999999999986e47 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -1.85e21 < b < 3.34999999999999986e47

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

Alternative 13: 42.7% accurate, 1.5× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * ((a * i) - (c * z))
    if (b <= (-3.2d+20)) then
        tmp = t_1
    else if (b <= (-5.8d-38)) then
        tmp = (-1.0d0) * (a * (t * x))
    else if (b <= 2.9d-148) then
        tmp = x * (y * z)
    else if (b <= 1.12d+21) then
        tmp = t * ((-1.0d0) * (a * x))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = b * ((a * i) - (c * z));
	double tmp;
	if (b <= -3.2e+20) {
		tmp = t_1;
	} else if (b <= -5.8e-38) {
		tmp = -1.0 * (a * (t * x));
	} else if (b <= 2.9e-148) {
		tmp = x * (y * z);
	} else if (b <= 1.12e+21) {
		tmp = t * (-1.0 * (a * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = b * ((a * i) - (c * z))
	tmp = 0
	if b <= -3.2e+20:
		tmp = t_1
	elif b <= -5.8e-38:
		tmp = -1.0 * (a * (t * x))
	elif b <= 2.9e-148:
		tmp = x * (y * z)
	elif b <= 1.12e+21:
		tmp = t * (-1.0 * (a * x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z)))
	tmp = 0.0
	if (b <= -3.2e+20)
		tmp = t_1;
	elseif (b <= -5.8e-38)
		tmp = Float64(-1.0 * Float64(a * Float64(t * x)));
	elseif (b <= 2.9e-148)
		tmp = Float64(x * Float64(y * z));
	elseif (b <= 1.12e+21)
		tmp = Float64(t * Float64(-1.0 * Float64(a * x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = b * ((a * i) - (c * z));
	tmp = 0.0;
	if (b <= -3.2e+20)
		tmp = t_1;
	elseif (b <= -5.8e-38)
		tmp = -1.0 * (a * (t * x));
	elseif (b <= 2.9e-148)
		tmp = x * (y * z);
	elseif (b <= 1.12e+21)
		tmp = t * (-1.0 * (a * x));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e+20], t$95$1, If[LessEqual[b, -5.8e-38], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e-148], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.12e+21], N[(t * N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -5.8 \cdot 10^{-38}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\

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

\mathbf{elif}\;b \leq 1.12 \cdot 10^{+21}:\\
\;\;\;\;t \cdot \left(-1 \cdot \left(a \cdot x\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -3.2e20 or 1.12e21 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

    if -3.2e20 < b < -5.79999999999999988e-38

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f6421.6%

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

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

    if -5.79999999999999988e-38 < b < 2.8999999999999998e-148

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

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

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

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

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

    if 2.8999999999999998e-148 < b < 1.12e21

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto t \cdot \left(-1 \cdot \left(a \cdot \color{blue}{x}\right)\right) \]
      2. lower-*.f6421.8%

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

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

Alternative 14: 30.6% accurate, 1.9× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-148}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{+21}:\\ \;\;\;\;t \cdot \left(-1 \cdot \left(a \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot a\right) \cdot b\\ \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= b -1.55e+32)
   (* a (* b i))
   (if (<= b 2.9e-148)
     (* x (* y z))
     (if (<= b 1.12e+21) (* t (* -1.0 (* a x))) (* (* i a) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -1.55e+32) {
		tmp = a * (b * i);
	} else if (b <= 2.9e-148) {
		tmp = x * (y * z);
	} else if (b <= 1.12e+21) {
		tmp = t * (-1.0 * (a * x));
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (b <= (-1.55d+32)) then
        tmp = a * (b * i)
    else if (b <= 2.9d-148) then
        tmp = x * (y * z)
    else if (b <= 1.12d+21) then
        tmp = t * ((-1.0d0) * (a * x))
    else
        tmp = (i * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -1.55e+32) {
		tmp = a * (b * i);
	} else if (b <= 2.9e-148) {
		tmp = x * (y * z);
	} else if (b <= 1.12e+21) {
		tmp = t * (-1.0 * (a * x));
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if b <= -1.55e+32:
		tmp = a * (b * i)
	elif b <= 2.9e-148:
		tmp = x * (y * z)
	elif b <= 1.12e+21:
		tmp = t * (-1.0 * (a * x))
	else:
		tmp = (i * a) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -1.55e+32)
		tmp = Float64(a * Float64(b * i));
	elseif (b <= 2.9e-148)
		tmp = Float64(x * Float64(y * z));
	elseif (b <= 1.12e+21)
		tmp = Float64(t * Float64(-1.0 * Float64(a * x)));
	else
		tmp = Float64(Float64(i * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (b <= -1.55e+32)
		tmp = a * (b * i);
	elseif (b <= 2.9e-148)
		tmp = x * (y * z);
	elseif (b <= 1.12e+21)
		tmp = t * (-1.0 * (a * x));
	else
		tmp = (i * a) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.55e+32], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e-148], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.12e+21], N[(t * N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

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

\mathbf{elif}\;b \leq 1.12 \cdot 10^{+21}:\\
\;\;\;\;t \cdot \left(-1 \cdot \left(a \cdot x\right)\right)\\

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


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

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

    if -1.54999999999999997e32 < b < 2.8999999999999998e-148

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

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

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

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

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

    if 2.8999999999999998e-148 < b < 1.12e21

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto t \cdot \left(-1 \cdot \left(a \cdot \color{blue}{x}\right)\right) \]
      2. lower-*.f6421.8%

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

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

    if 1.12e21 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

        \[\leadsto a \cdot \left(i \cdot b\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      7. lower-*.f6422.5%

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

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

Alternative 15: 30.5% accurate, 1.9× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{elif}\;b \leq 1.52 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{+21}:\\ \;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot a\right) \cdot b\\ \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= b -1.55e+32)
   (* a (* b i))
   (if (<= b 1.52e-87)
     (* x (* y z))
     (if (<= b 1.12e+21) (* -1.0 (* a (* t x))) (* (* i a) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -1.55e+32) {
		tmp = a * (b * i);
	} else if (b <= 1.52e-87) {
		tmp = x * (y * z);
	} else if (b <= 1.12e+21) {
		tmp = -1.0 * (a * (t * x));
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (b <= (-1.55d+32)) then
        tmp = a * (b * i)
    else if (b <= 1.52d-87) then
        tmp = x * (y * z)
    else if (b <= 1.12d+21) then
        tmp = (-1.0d0) * (a * (t * x))
    else
        tmp = (i * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -1.55e+32) {
		tmp = a * (b * i);
	} else if (b <= 1.52e-87) {
		tmp = x * (y * z);
	} else if (b <= 1.12e+21) {
		tmp = -1.0 * (a * (t * x));
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if b <= -1.55e+32:
		tmp = a * (b * i)
	elif b <= 1.52e-87:
		tmp = x * (y * z)
	elif b <= 1.12e+21:
		tmp = -1.0 * (a * (t * x))
	else:
		tmp = (i * a) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -1.55e+32)
		tmp = Float64(a * Float64(b * i));
	elseif (b <= 1.52e-87)
		tmp = Float64(x * Float64(y * z));
	elseif (b <= 1.12e+21)
		tmp = Float64(-1.0 * Float64(a * Float64(t * x)));
	else
		tmp = Float64(Float64(i * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (b <= -1.55e+32)
		tmp = a * (b * i);
	elseif (b <= 1.52e-87)
		tmp = x * (y * z);
	elseif (b <= 1.12e+21)
		tmp = -1.0 * (a * (t * x));
	else
		tmp = (i * a) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.55e+32], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.52e-87], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.12e+21], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

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

\mathbf{elif}\;b \leq 1.12 \cdot 10^{+21}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\

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


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

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

    if -1.54999999999999997e32 < b < 1.52000000000000004e-87

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

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

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

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

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

    if 1.52000000000000004e-87 < b < 1.12e21

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f6421.6%

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

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

    if 1.12e21 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

        \[\leadsto a \cdot \left(i \cdot b\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      7. lower-*.f6422.5%

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

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

Alternative 16: 30.5% accurate, 2.2× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (b <= (-1.55d+32)) then
        tmp = a * (b * i)
    else if (b <= 5d-85) then
        tmp = x * (y * z)
    else if (b <= 1.82d+84) then
        tmp = t * (c * j)
    else
        tmp = (i * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -1.55e+32) {
		tmp = a * (b * i);
	} else if (b <= 5e-85) {
		tmp = x * (y * z);
	} else if (b <= 1.82e+84) {
		tmp = t * (c * j);
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if b <= -1.55e+32:
		tmp = a * (b * i)
	elif b <= 5e-85:
		tmp = x * (y * z)
	elif b <= 1.82e+84:
		tmp = t * (c * j)
	else:
		tmp = (i * a) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -1.55e+32)
		tmp = Float64(a * Float64(b * i));
	elseif (b <= 5e-85)
		tmp = Float64(x * Float64(y * z));
	elseif (b <= 1.82e+84)
		tmp = Float64(t * Float64(c * j));
	else
		tmp = Float64(Float64(i * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (b <= -1.55e+32)
		tmp = a * (b * i);
	elseif (b <= 5e-85)
		tmp = x * (y * z);
	elseif (b <= 1.82e+84)
		tmp = t * (c * j);
	else
		tmp = (i * a) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.55e+32], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-85], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.82e+84], N[(t * N[(c * j), $MachinePrecision]), $MachinePrecision], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

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

\mathbf{elif}\;b \leq 1.82 \cdot 10^{+84}:\\
\;\;\;\;t \cdot \left(c \cdot j\right)\\

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


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

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

    if -1.54999999999999997e32 < b < 5.0000000000000002e-85

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

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

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

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

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

    if 5.0000000000000002e-85 < b < 1.8200000000000001e84

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

      \[\leadsto t \cdot \left(c \cdot \color{blue}{j}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.4%

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

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

    if 1.8200000000000001e84 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

        \[\leadsto a \cdot \left(i \cdot b\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      7. lower-*.f6422.5%

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

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

Alternative 17: 30.5% accurate, 2.2× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (b <= (-1.55d+32)) then
        tmp = a * (b * i)
    else if (b <= 5d-85) then
        tmp = x * (y * z)
    else if (b <= 1.82d+84) then
        tmp = c * (j * t)
    else
        tmp = (i * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -1.55e+32) {
		tmp = a * (b * i);
	} else if (b <= 5e-85) {
		tmp = x * (y * z);
	} else if (b <= 1.82e+84) {
		tmp = c * (j * t);
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if b <= -1.55e+32:
		tmp = a * (b * i)
	elif b <= 5e-85:
		tmp = x * (y * z)
	elif b <= 1.82e+84:
		tmp = c * (j * t)
	else:
		tmp = (i * a) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -1.55e+32)
		tmp = Float64(a * Float64(b * i));
	elseif (b <= 5e-85)
		tmp = Float64(x * Float64(y * z));
	elseif (b <= 1.82e+84)
		tmp = Float64(c * Float64(j * t));
	else
		tmp = Float64(Float64(i * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (b <= -1.55e+32)
		tmp = a * (b * i);
	elseif (b <= 5e-85)
		tmp = x * (y * z);
	elseif (b <= 1.82e+84)
		tmp = c * (j * t);
	else
		tmp = (i * a) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.55e+32], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-85], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.82e+84], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{+32}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

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

\mathbf{elif}\;b \leq 1.82 \cdot 10^{+84}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\

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


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

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

    if -1.54999999999999997e32 < b < 5.0000000000000002e-85

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z - a \cdot \color{blue}{t}\right) \]
    10. Applied rewrites38.2%

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

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

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

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

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

    if 5.0000000000000002e-85 < b < 1.8200000000000001e84

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
      2. lower-*.f6422.5%

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

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

    if 1.8200000000000001e84 < b

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

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

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

        \[\leadsto a \cdot \left(i \cdot b\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      7. lower-*.f6422.5%

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

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

Alternative 18: 29.3% accurate, 2.8× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -7.50000000000000047e-107 or 1.2e106 < i

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.4%

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

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

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

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.7%

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

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

    if -7.50000000000000047e-107 < i < 1.2e106

    1. Initial program 73.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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. lower-*.f64N/A

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{x}, c \cdot j\right) \]
      4. lower-*.f6438.5%

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

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

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

        \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
      2. lower-*.f6422.5%

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

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

Alternative 19: 22.7% accurate, 5.9× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = a * (b * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return a * (b * i);
}
def code(x, y, z, t, a, b, c, i, j):
	return a * (b * i)
function code(x, y, z, t, a, b, c, i, j)
	return Float64(a * Float64(b * i))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = a * (b * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]
a \cdot \left(b \cdot i\right)
Derivation
  1. Initial program 73.7%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
  2. 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. lower-*.f64N/A

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

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

      \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
    4. lower-*.f6439.4%

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

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

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

      \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
    2. lower-*.f6422.7%

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

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

Reproduce

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