Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 73.8% → 82.2%
Time: 7.9s
Alternatives: 22
Speedup: 0.5×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 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.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 82.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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.8%

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

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

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

    1. Initial program 73.8%

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

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

    1. Initial program 73.8%

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

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

Alternative 2: 81.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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.8%

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

      \[\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}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Applied rewrites72.2%

      \[\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}{\mathsf{fma}\left(-1, i \cdot \left(j \cdot y\right), c \cdot \left(j \cdot t\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)))) < +inf.0

    1. Initial program 73.8%

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

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

    1. Initial program 73.8%

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

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

Alternative 3: 81.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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.8%

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

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

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

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

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

    1. Initial program 73.8%

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

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

    1. Initial program 73.8%

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

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

Alternative 4: 81.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (+
          (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
          (* j (- (* c t) (* i y))))))
   (if (<= t_1 INFINITY) t_1 (* 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = z * ((x * y) - (b * c));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = z * ((x * y) - (b * c));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = z * ((x * y) - (b * c))
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = z * ((x * y) - (b * c));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 73.8%

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

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

    1. Initial program 73.8%

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

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

Alternative 5: 71.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;b \leq -2.45 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(c, j \cdot t - b \cdot z, t\_2\right) - i \cdot \left(j \cdot y\right)\\

\mathbf{elif}\;b \leq 8 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{+231}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -3.69999999999999981e-5 or 8e-79 < b < 1.9e231

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

    if -3.69999999999999981e-5 < b < -2.45e-172

    1. Initial program 73.8%

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

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

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

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

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

      \[\leadsto \left(c \cdot \left(j \cdot t - b \cdot z\right) + x \cdot \left(y \cdot z\right)\right) - \color{blue}{i \cdot \left(j \cdot y\right)} \]
    7. Applied rewrites58.2%

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

    if -2.45e-172 < b < 8e-79

    1. Initial program 73.8%

      \[\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. Applied rewrites61.3%

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

    if 1.9e231 < b

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

Alternative 6: 70.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\ t_2 := b \cdot \left(\mathsf{fma}\left(a, i, \frac{t\_1}{b}\right) - c \cdot z\right)\\ \mathbf{if}\;b \leq -3.7 \cdot 10^{-5}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;b \leq -2.45 \cdot 10^{-172}:\\ \;\;\;\;\mathsf{fma}\left(c, j \cdot t - b \cdot z, x \cdot \left(y \cdot z\right)\right) - i \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-79}:\\ \;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \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 (- (fma a i (/ t_1 b)) (* c z)))))
   (if (<= b -3.7e-5)
     t_2
     (if (<= b -2.45e-172)
       (- (fma c (- (* j t) (* b z)) (* x (* y z))) (* i (* j y)))
       (if (<= b 8e-79) (fma j (- (* c t) (* i y)) 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 = x * ((y * z) - (a * t));
	double t_2 = b * (fma(a, i, (t_1 / b)) - (c * z));
	double tmp;
	if (b <= -3.7e-5) {
		tmp = t_2;
	} else if (b <= -2.45e-172) {
		tmp = fma(c, ((j * t) - (b * z)), (x * (y * z))) - (i * (j * y));
	} else if (b <= 8e-79) {
		tmp = fma(j, ((c * t) - (i * y)), t_1);
	} 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(fma(a, i, Float64(t_1 / b)) - Float64(c * z)))
	tmp = 0.0
	if (b <= -3.7e-5)
		tmp = t_2;
	elseif (b <= -2.45e-172)
		tmp = Float64(fma(c, Float64(Float64(j * t) - Float64(b * z)), Float64(x * Float64(y * z))) - Float64(i * Float64(j * y)));
	elseif (b <= 8e-79)
		tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), 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[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(a * i + N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.7e-5], t$95$2, If[LessEqual[b, -2.45e-172], N[(N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e-79], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;b \leq 8 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.69999999999999981e-5 or 8e-79 < b

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

    if -3.69999999999999981e-5 < b < -2.45e-172

    1. Initial program 73.8%

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

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

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

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

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

      \[\leadsto \left(c \cdot \left(j \cdot t - b \cdot z\right) + x \cdot \left(y \cdot z\right)\right) - \color{blue}{i \cdot \left(j \cdot y\right)} \]
    7. Applied rewrites58.2%

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

    if -2.45e-172 < b < 8e-79

    1. Initial program 73.8%

      \[\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. Applied rewrites61.3%

      \[\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 7: 69.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;j \leq 5.5 \cdot 10^{+30}:\\
\;\;\;\;t\_2 - b \cdot \left(c \cdot z - a \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_1, t\_2\right)\\


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

    1. Initial program 73.8%

      \[\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. Applied rewrites50.3%

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

    if -3.49999999999999975e49 < j < 5.50000000000000025e30

    1. Initial program 73.8%

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

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

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

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

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

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

    if 5.50000000000000025e30 < j

    1. Initial program 73.8%

      \[\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. Applied rewrites61.3%

      \[\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 8: 66.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;b \leq -2.45 \cdot 10^{-172}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z\right)\\

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

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


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

    1. Initial program 73.8%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(y \cdot z\right) - \color{blue}{b \cdot \left(c \cdot z - a \cdot i\right)} \]
    8. Applied rewrites49.7%

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

    if -5.49999999999999967e80 < b < -2.45e-172

    1. Initial program 73.8%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \color{blue}{\left(c \cdot z\right)} \]
    8. Applied rewrites50.3%

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

    if -2.45e-172 < b < 1.8499999999999999e108

    1. Initial program 73.8%

      \[\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. Applied rewrites61.3%

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

    if 1.8499999999999999e108 < b

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

Alternative 9: 55.1% accurate, 1.3× speedup?

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

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

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

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

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

\mathbf{elif}\;x \leq 6 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.50000000000000001e-60

    1. Initial program 73.8%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \color{blue}{\left(c \cdot z\right)} \]
    8. Applied rewrites50.3%

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

    if -4.50000000000000001e-60 < x < 1.15e-284

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

    if 1.15e-284 < x < 6e111

    1. Initial program 73.8%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(y \cdot z\right) - \color{blue}{b \cdot \left(c \cdot z - a \cdot i\right)} \]
    8. Applied rewrites49.7%

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

    if 6e111 < x

    1. Initial program 73.8%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)} \]
    6. Applied rewrites39.5%

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

Alternative 10: 54.0% accurate, 1.1× speedup?

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

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

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

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

\mathbf{elif}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\

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

\mathbf{elif}\;x \leq 6 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.01999999999999991e50 or 6e111 < x

    1. Initial program 73.8%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)} \]
    6. Applied rewrites39.5%

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

    if -1.01999999999999991e50 < x < -2.00000000000000001e-41

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

    if -2.00000000000000001e-41 < x < 1.15e-284

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

    if 1.15e-284 < x < 6e111

    1. Initial program 73.8%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(y \cdot z\right) - \color{blue}{b \cdot \left(c \cdot z - a \cdot i\right)} \]
    8. Applied rewrites49.7%

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

Alternative 11: 52.8% accurate, 1.3× speedup?

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

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

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

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

\mathbf{elif}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\

\mathbf{elif}\;x \leq 62000000:\\
\;\;\;\;c \cdot \left(j \cdot \left(t + -1 \cdot \frac{b \cdot z}{j}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.01999999999999991e50 or 6.2e7 < x

    1. Initial program 73.8%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)} \]
    6. Applied rewrites39.5%

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

    if -1.01999999999999991e50 < x < -2.00000000000000001e-41

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

    if -2.00000000000000001e-41 < x < 6.2e7

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

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

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

Alternative 12: 52.7% accurate, 1.7× speedup?

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

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

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

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

\mathbf{elif}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\

\mathbf{elif}\;x \leq 62000000:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.01999999999999991e50 or 6.2e7 < x

    1. Initial program 73.8%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)} \]
    6. Applied rewrites39.5%

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

    if -1.01999999999999991e50 < x < -2.00000000000000001e-41

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

    if -2.00000000000000001e-41 < x < 6.2e7

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

Alternative 13: 52.4% accurate, 2.0× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.7200000000000001e-4 or 6e52 < b

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

    if -1.7200000000000001e-4 < b < 6e52

    1. Initial program 73.8%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(x \cdot z - i \cdot j\right)} \]
    7. Applied rewrites39.7%

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

Alternative 14: 43.0% accurate, 1.7× speedup?

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

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

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

\mathbf{elif}\;b \leq 1.08 \cdot 10^{+191}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\

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


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

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

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

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

    if -6.00000000000000016e123 < b < 6.4999999999999997e57

    1. Initial program 73.8%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(x \cdot z - i \cdot j\right)} \]
    7. Applied rewrites39.7%

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

    if 6.4999999999999997e57 < b < 1.08000000000000002e191

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

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

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

    if 1.08000000000000002e191 < b

    1. Initial program 73.8%

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

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

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

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

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

      \[\leadsto i \cdot \color{blue}{\left(a \cdot b - j \cdot y\right)} \]
    7. Applied rewrites37.8%

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

Alternative 15: 40.7% accurate, 2.0× speedup?

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

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

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

\\
\begin{array}{l}
t_1 := t \cdot \left(-1 \cdot \left(a \cdot x\right)\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.59999999999999981e72 or 5.50000000000000001e103 < x

    1. Initial program 73.8%

      \[\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. Applied rewrites38.8%

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

      \[\leadsto t \cdot \left(-1 \cdot \color{blue}{\left(a \cdot x\right)}\right) \]
    5. Applied rewrites22.0%

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

    if -2.59999999999999981e72 < x < 5.50000000000000001e103

    1. Initial program 73.8%

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

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

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

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

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

      \[\leadsto i \cdot \color{blue}{\left(a \cdot b - j \cdot y\right)} \]
    7. Applied rewrites37.8%

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

Alternative 16: 29.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-172}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\

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

\mathbf{elif}\;b \leq 1.4 \cdot 10^{+198}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.4000000000000001e-172

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

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

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

    if -2.4000000000000001e-172 < b < 1.12e105

    1. Initial program 73.8%

      \[\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. Applied rewrites38.8%

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

      \[\leadsto t \cdot \left(-1 \cdot \color{blue}{\left(a \cdot x\right)}\right) \]
    5. Applied rewrites22.0%

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

    if 1.12e105 < b < 1.4e198

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

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

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

    if 1.4e198 < b

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

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

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

Alternative 17: 29.2% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-173}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\

\mathbf{elif}\;b \leq 7800:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.4999999999999995e-173

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Applied rewrites39.7%

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

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

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

    if -6.4999999999999995e-173 < b < 7800

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
    5. Applied rewrites22.0%

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

    if 7800 < b

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    5. Applied rewrites21.1%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Applied rewrites21.2%

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

Alternative 18: 28.8% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-173}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\

\mathbf{elif}\;b \leq 7800:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.4999999999999995e-173

    1. Initial program 73.8%

      \[\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. Applied rewrites39.2%

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

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

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

    if -6.4999999999999995e-173 < b < 7800

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
    5. Applied rewrites22.0%

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

    if 7800 < b

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    5. Applied rewrites21.1%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Applied rewrites21.2%

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

Alternative 19: 28.7% accurate, 2.3× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+58}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

\mathbf{elif}\;b \leq 7800:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\

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


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

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    5. Applied rewrites21.1%

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

    if -4.8e58 < b < 7800

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
    5. Applied rewrites22.0%

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

    if 7800 < b

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    5. Applied rewrites21.1%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Applied rewrites21.2%

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

Alternative 20: 28.5% accurate, 2.8× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.05000000000000003e30 or 2.2999999999999999e-15 < t

    1. Initial program 73.8%

      \[\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. Applied rewrites38.8%

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

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    5. Applied rewrites22.3%

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

    if -2.05000000000000003e30 < t < 2.2999999999999999e-15

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
    3. Applied rewrites37.9%

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

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    5. Applied rewrites21.1%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Applied rewrites21.2%

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

Alternative 21: 21.2% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(a \cdot b\right) \cdot i \end{array} \]
(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(Float64(a * 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[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}

\\
\left(a \cdot b\right) \cdot i
\end{array}
Derivation
  1. Initial program 73.8%

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

    \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
  3. Applied rewrites37.9%

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

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  5. Applied rewrites21.1%

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  6. Applied rewrites21.2%

    \[\leadsto \left(a \cdot b\right) \cdot i \]
  7. Add Preprocessing

Alternative 22: 21.1% accurate, 5.9× speedup?

\[\begin{array}{l} \\ a \cdot \left(b \cdot i\right) \end{array} \]
(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]
\begin{array}{l}

\\
a \cdot \left(b \cdot i\right)
\end{array}
Derivation
  1. Initial program 73.8%

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

    \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)} \]
  3. Applied rewrites37.9%

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

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  5. Applied rewrites21.1%

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

Reproduce

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