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

Percentage Accurate: 73.9% → 82.5%
Time: 18.2s
Alternatives: 24
Speedup: 0.5×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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

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

Alternative 1: 82.5% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(t, b, -j \cdot y\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 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0

    1. Initial program 73.9%

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

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

    1. Initial program 73.9%

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

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

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

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

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

Alternative 2: 71.6% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -7.99999999999999939e-24 or 2.2500000000000001e-20 < b

    1. Initial program 73.9%

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

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

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

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

    if -7.99999999999999939e-24 < b < 2.2500000000000001e-20

    1. Initial program 73.9%

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

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

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

Alternative 3: 71.3% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.3999999999999998e-17 or 1.08e-45 < x

    1. Initial program 73.9%

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

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

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

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

    if -3.3999999999999998e-17 < x < 1.08e-45

    1. Initial program 73.9%

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

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

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

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

Alternative 4: 69.1% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5e59 or 1.74999999999999998e-35 < x

    1. Initial program 73.9%

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

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

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

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

    if -1.5e59 < x < 1.74999999999999998e-35

    1. Initial program 73.9%

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

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

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

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

Alternative 5: 61.7% accurate, 1.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.5e59 or 1.0199999999999999e-45 < x

    1. Initial program 73.9%

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

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

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

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

    if -1.5e59 < x < -1.75000000000000006e-219

    1. Initial program 73.9%

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

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

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

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

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

    if -1.75000000000000006e-219 < x < 1.0199999999999999e-45

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

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

Alternative 6: 61.1% accurate, 1.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.99999999999999986e58 or 1.0199999999999999e-45 < x

    1. Initial program 73.9%

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

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

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

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

    if -4.99999999999999986e58 < x < -2.4999999999999999e-148

    1. Initial program 73.9%

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

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

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

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

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

    if -2.4999999999999999e-148 < x < 1.0199999999999999e-45

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

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

Alternative 7: 57.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;b \leq 505:\\
\;\;\;\;t\_1 + j \cdot \left(c \cdot a - y \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.2999999999999997e-25 or 505 < b

    1. Initial program 73.9%

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

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

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

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

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

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

    if -5.2999999999999997e-25 < b < 505

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Applied rewrites50.2%

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

Alternative 8: 54.8% 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 -5.2 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-148}:\\ \;\;\;\;i \cdot \mathsf{fma}\left(t, b, -j \cdot y\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\ \;\;\;\;c \cdot \mathsf{fma}\left(-z, b, a \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 (* x (- (* y z) (* a t)))))
   (if (<= x -5.2e+58)
     t_1
     (if (<= x -2.5e-148)
       (* i (fma t b (- (* j y))))
       (if (<= x 1.3e-35) (* c (fma (- z) b (* a 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -2.5e-148) {
		tmp = i * fma(t, b, -(j * y));
	} else if (x <= 1.3e-35) {
		tmp = c * fma(-z, b, (a * 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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -2.5e-148)
		tmp = Float64(i * fma(t, b, Float64(-Float64(j * y))));
	elseif (x <= 1.3e-35)
		tmp = Float64(c * fma(Float64(-z), b, Float64(a * j)));
	else
		tmp = t_1;
	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[x, -5.2e+58], t$95$1, If[LessEqual[x, -2.5e-148], N[(i * N[(t * b + (-N[(j * y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-35], N[(c * N[((-z) * b + N[(a * j), $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 -5.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.19999999999999976e58 or 1.30000000000000002e-35 < x

    1. Initial program 73.9%

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

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

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

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

    if -5.19999999999999976e58 < x < -2.4999999999999999e-148

    1. Initial program 73.9%

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

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

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

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

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

    if -2.4999999999999999e-148 < x < 1.30000000000000002e-35

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

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

Alternative 9: 52.3% 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 -5.2 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-148}:\\ \;\;\;\;i \cdot \mathsf{fma}\left(t, b, -j \cdot y\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\ \;\;\;\;c \cdot \left(a \cdot j - 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 -5.2e+58)
     t_1
     (if (<= x -2.5e-148)
       (* i (fma t b (- (* j y))))
       (if (<= x 1.3e-35) (* c (- (* a j) (* 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -2.5e-148) {
		tmp = i * fma(t, b, -(j * y));
	} else if (x <= 1.3e-35) {
		tmp = c * ((a * j) - (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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -2.5e-148)
		tmp = Float64(i * fma(t, b, Float64(-Float64(j * y))));
	elseif (x <= 1.3e-35)
		tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+58], t$95$1, If[LessEqual[x, -2.5e-148], N[(i * N[(t * b + (-N[(j * y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-35], N[(c * N[(N[(a * j), $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 -5.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.19999999999999976e58 or 1.30000000000000002e-35 < x

    1. Initial program 73.9%

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

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

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

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

    if -5.19999999999999976e58 < x < -2.4999999999999999e-148

    1. Initial program 73.9%

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

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

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

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

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

    if -2.4999999999999999e-148 < x < 1.30000000000000002e-35

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

Alternative 10: 52.2% 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 -5.2 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-148}:\\ \;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\ \;\;\;\;c \cdot \left(a \cdot j - 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 -5.2e+58)
     t_1
     (if (<= x -2.5e-148)
       (* i (- (* b t) (* j y)))
       (if (<= x 1.3e-35) (* c (- (* a j) (* 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -2.5e-148) {
		tmp = i * ((b * t) - (j * y));
	} else if (x <= 1.3e-35) {
		tmp = c * ((a * j) - (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 <= (-5.2d+58)) then
        tmp = t_1
    else if (x <= (-2.5d-148)) then
        tmp = i * ((b * t) - (j * y))
    else if (x <= 1.3d-35) then
        tmp = c * ((a * j) - (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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -2.5e-148) {
		tmp = i * ((b * t) - (j * y));
	} else if (x <= 1.3e-35) {
		tmp = c * ((a * j) - (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 <= -5.2e+58:
		tmp = t_1
	elif x <= -2.5e-148:
		tmp = i * ((b * t) - (j * y))
	elif x <= 1.3e-35:
		tmp = c * ((a * j) - (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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -2.5e-148)
		tmp = Float64(i * Float64(Float64(b * t) - Float64(j * y)));
	elseif (x <= 1.3e-35)
		tmp = Float64(c * Float64(Float64(a * j) - 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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -2.5e-148)
		tmp = i * ((b * t) - (j * y));
	elseif (x <= 1.3e-35)
		tmp = c * ((a * j) - (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, -5.2e+58], t$95$1, If[LessEqual[x, -2.5e-148], N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-35], N[(c * N[(N[(a * j), $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 -5.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-148}:\\
\;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.19999999999999976e58 or 1.30000000000000002e-35 < x

    1. Initial program 73.9%

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

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

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

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

    if -5.19999999999999976e58 < x < -2.4999999999999999e-148

    1. Initial program 73.9%

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

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

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

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

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

    if -2.4999999999999999e-148 < x < 1.30000000000000002e-35

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

Alternative 11: 52.2% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.4000000000000002e65 or 1.02000000000000005e74 < a

    1. Initial program 73.9%

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

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

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

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

    if -2.4000000000000002e65 < a < 1.02000000000000005e74

    1. Initial program 73.9%

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

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

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

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

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

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

Alternative 12: 52.1% 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 -5.2 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-128}:\\ \;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\ \mathbf{elif}\;x \leq 5 \cdot 10^{+72}:\\ \;\;\;\;b \cdot \left(i \cdot t - c \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 -5.2e+58)
     t_1
     (if (<= x -3.5e-128)
       (* i (- (* b t) (* j y)))
       (if (<= x 5e+72) (* b (- (* i t) (* c 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -3.5e-128) {
		tmp = i * ((b * t) - (j * y));
	} else if (x <= 5e+72) {
		tmp = b * ((i * t) - (c * 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 <= (-5.2d+58)) then
        tmp = t_1
    else if (x <= (-3.5d-128)) then
        tmp = i * ((b * t) - (j * y))
    else if (x <= 5d+72) then
        tmp = b * ((i * t) - (c * 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -3.5e-128) {
		tmp = i * ((b * t) - (j * y));
	} else if (x <= 5e+72) {
		tmp = b * ((i * t) - (c * 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 <= -5.2e+58:
		tmp = t_1
	elif x <= -3.5e-128:
		tmp = i * ((b * t) - (j * y))
	elif x <= 5e+72:
		tmp = b * ((i * t) - (c * 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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -3.5e-128)
		tmp = Float64(i * Float64(Float64(b * t) - Float64(j * y)));
	elseif (x <= 5e+72)
		tmp = Float64(b * Float64(Float64(i * t) - Float64(c * 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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -3.5e-128)
		tmp = i * ((b * t) - (j * y));
	elseif (x <= 5e+72)
		tmp = b * ((i * t) - (c * 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, -5.2e+58], t$95$1, If[LessEqual[x, -3.5e-128], N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+72], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * 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 -5.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -3.5 \cdot 10^{-128}:\\
\;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.19999999999999976e58 or 4.99999999999999992e72 < x

    1. Initial program 73.9%

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

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

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

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

    if -5.19999999999999976e58 < x < -3.5e-128

    1. Initial program 73.9%

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

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

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

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

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

    if -3.5e-128 < x < 4.99999999999999992e72

    1. Initial program 73.9%

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

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

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

Alternative 13: 47.4% 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 -5.2 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-262}:\\ \;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-45}:\\ \;\;\;\;c \cdot \left(a \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 (* x (- (* y z) (* a t)))))
   (if (<= x -5.2e+58)
     t_1
     (if (<= x -4.5e-262)
       (* i (- (* b t) (* j y)))
       (if (<= x 1.02e-45) (* c (* a 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -4.5e-262) {
		tmp = i * ((b * t) - (j * y));
	} else if (x <= 1.02e-45) {
		tmp = c * (a * 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 <= (-5.2d+58)) then
        tmp = t_1
    else if (x <= (-4.5d-262)) then
        tmp = i * ((b * t) - (j * y))
    else if (x <= 1.02d-45) then
        tmp = c * (a * 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 <= -5.2e+58) {
		tmp = t_1;
	} else if (x <= -4.5e-262) {
		tmp = i * ((b * t) - (j * y));
	} else if (x <= 1.02e-45) {
		tmp = c * (a * 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 <= -5.2e+58:
		tmp = t_1
	elif x <= -4.5e-262:
		tmp = i * ((b * t) - (j * y))
	elif x <= 1.02e-45:
		tmp = c * (a * 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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -4.5e-262)
		tmp = Float64(i * Float64(Float64(b * t) - Float64(j * y)));
	elseif (x <= 1.02e-45)
		tmp = Float64(c * Float64(a * 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 <= -5.2e+58)
		tmp = t_1;
	elseif (x <= -4.5e-262)
		tmp = i * ((b * t) - (j * y));
	elseif (x <= 1.02e-45)
		tmp = c * (a * 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, -5.2e+58], t$95$1, If[LessEqual[x, -4.5e-262], N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.02e-45], N[(c * N[(a * j), $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 -5.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -4.5 \cdot 10^{-262}:\\
\;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\

\mathbf{elif}\;x \leq 1.02 \cdot 10^{-45}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.19999999999999976e58 or 1.0199999999999999e-45 < x

    1. Initial program 73.9%

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

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

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

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

    if -5.19999999999999976e58 < x < -4.49999999999999998e-262

    1. Initial program 73.9%

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

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

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

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

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

    if -4.49999999999999998e-262 < x < 1.0199999999999999e-45

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

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

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

Alternative 14: 44.6% accurate, 1.7× speedup?

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

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

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

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

\mathbf{elif}\;c \leq -2.4 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -7.40000000000000006e140

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - 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 rewrites21.8%

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

    if -7.40000000000000006e140 < c < -2.39999999999999991e32 or 1.25999999999999994e138 < c

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto \color{blue}{j \cdot \left(a \cdot c - i \cdot y\right)} \]
    6. Applied rewrites39.0%

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

    if -2.39999999999999991e32 < c < 1.25999999999999994e138

    1. Initial program 73.9%

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

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

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

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

Alternative 15: 43.3% accurate, 1.7× speedup?

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

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

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

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

\mathbf{elif}\;j \leq -3.8 \cdot 10^{-277}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -6.80000000000000029e-50 or 2.4499999999999999e-22 < j

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto \color{blue}{j \cdot \left(a \cdot c - i \cdot y\right)} \]
    6. Applied rewrites39.0%

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

    if -6.80000000000000029e-50 < j < -3.79999999999999986e-277

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - 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 rewrites21.8%

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

    if -3.79999999999999986e-277 < j < 2.4499999999999999e-22

    1. Initial program 73.9%

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

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

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

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

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

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

Alternative 16: 30.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot z\right)\\ \mathbf{if}\;x \leq -9.6 \cdot 10^{+145}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -6.2 \cdot 10^{-131}:\\ \;\;\;\;i \cdot \left(-1 \cdot \left(j \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-87}:\\ \;\;\;\;a \cdot \left(c \cdot j\right)\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{+106}:\\ \;\;\;\;-1 \cdot \left(b \cdot \left(c \cdot z\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))))
   (if (<= x -9.6e+145)
     t_1
     (if (<= x -6.2e-131)
       (* i (* -1.0 (* j y)))
       (if (<= x 6.5e-87)
         (* a (* c j))
         (if (<= x 2.55e+106) (* -1.0 (* b (* c 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);
	double tmp;
	if (x <= -9.6e+145) {
		tmp = t_1;
	} else if (x <= -6.2e-131) {
		tmp = i * (-1.0 * (j * y));
	} else if (x <= 6.5e-87) {
		tmp = a * (c * j);
	} else if (x <= 2.55e+106) {
		tmp = -1.0 * (b * (c * 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)
    if (x <= (-9.6d+145)) then
        tmp = t_1
    else if (x <= (-6.2d-131)) then
        tmp = i * ((-1.0d0) * (j * y))
    else if (x <= 6.5d-87) then
        tmp = a * (c * j)
    else if (x <= 2.55d+106) then
        tmp = (-1.0d0) * (b * (c * 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);
	double tmp;
	if (x <= -9.6e+145) {
		tmp = t_1;
	} else if (x <= -6.2e-131) {
		tmp = i * (-1.0 * (j * y));
	} else if (x <= 6.5e-87) {
		tmp = a * (c * j);
	} else if (x <= 2.55e+106) {
		tmp = -1.0 * (b * (c * z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = x * (y * z)
	tmp = 0
	if x <= -9.6e+145:
		tmp = t_1
	elif x <= -6.2e-131:
		tmp = i * (-1.0 * (j * y))
	elif x <= 6.5e-87:
		tmp = a * (c * j)
	elif x <= 2.55e+106:
		tmp = -1.0 * (b * (c * z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(x * Float64(y * z))
	tmp = 0.0
	if (x <= -9.6e+145)
		tmp = t_1;
	elseif (x <= -6.2e-131)
		tmp = Float64(i * Float64(-1.0 * Float64(j * y)));
	elseif (x <= 6.5e-87)
		tmp = Float64(a * Float64(c * j));
	elseif (x <= 2.55e+106)
		tmp = Float64(-1.0 * Float64(b * Float64(c * 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);
	tmp = 0.0;
	if (x <= -9.6e+145)
		tmp = t_1;
	elseif (x <= -6.2e-131)
		tmp = i * (-1.0 * (j * y));
	elseif (x <= 6.5e-87)
		tmp = a * (c * j);
	elseif (x <= 2.55e+106)
		tmp = -1.0 * (b * (c * 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.6e+145], t$95$1, If[LessEqual[x, -6.2e-131], N[(i * N[(-1.0 * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e-87], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.55e+106], N[(-1.0 * N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -6.2 \cdot 10^{-131}:\\
\;\;\;\;i \cdot \left(-1 \cdot \left(j \cdot y\right)\right)\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{-87}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -9.59999999999999967e145 or 2.54999999999999986e106 < x

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if -9.59999999999999967e145 < x < -6.20000000000000041e-131

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto i \cdot \left(-1 \cdot \color{blue}{\left(j \cdot y\right)}\right) \]
    6. Applied rewrites22.1%

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

    if -6.20000000000000041e-131 < x < 6.5000000000000003e-87

    1. Initial program 73.9%

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

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

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

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

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

    if 6.5000000000000003e-87 < x < 2.54999999999999986e106

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

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

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

Alternative 17: 30.1% accurate, 1.8× speedup?

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

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

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

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

\mathbf{elif}\;x \leq -6.2 \cdot 10^{-131}:\\
\;\;\;\;i \cdot \left(-1 \cdot \left(j \cdot y\right)\right)\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -9.59999999999999967e145 or 3.7499999999999999e171 < x

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if -9.59999999999999967e145 < x < -6.20000000000000041e-131

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto i \cdot \left(-1 \cdot \color{blue}{\left(j \cdot y\right)}\right) \]
    6. Applied rewrites22.1%

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

    if -6.20000000000000041e-131 < x < 1.30000000000000002e-35

    1. Initial program 73.9%

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

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

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

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

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

    if 1.30000000000000002e-35 < x < 3.7499999999999999e171

    1. Initial program 73.9%

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

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

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

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

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

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

Alternative 18: 30.0% accurate, 1.8× speedup?

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

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

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

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

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

\mathbf{elif}\;x \leq 1.3 \cdot 10^{-35}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.2000000000000001e73 or 3.7499999999999999e171 < x

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if -5.2000000000000001e73 < x < -8.50000000000000029e-110

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

    if -8.50000000000000029e-110 < x < 1.30000000000000002e-35

    1. Initial program 73.9%

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

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

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

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

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

    if 1.30000000000000002e-35 < x < 3.7499999999999999e171

    1. Initial program 73.9%

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

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

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

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

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

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

Alternative 19: 29.9% accurate, 2.2× speedup?

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

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

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

\mathbf{elif}\;x \leq 4 \cdot 10^{-45}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.2000000000000001e73 or 3.99999999999999994e-45 < x

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if -5.2000000000000001e73 < x < -2.4000000000000001e-260

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

    if -2.4000000000000001e-260 < x < 3.99999999999999994e-45

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    3. Applied rewrites38.1%

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

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

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

Alternative 20: 29.9% accurate, 2.2× speedup?

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

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

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

\mathbf{elif}\;x \leq 2.2 \cdot 10^{-45}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.2000000000000001e73 or 2.19999999999999993e-45 < x

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if -5.2000000000000001e73 < x < -8.50000000000000029e-110

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

    if -8.50000000000000029e-110 < x < 2.19999999999999993e-45

    1. Initial program 73.9%

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

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

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

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

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

Alternative 21: 29.8% accurate, 2.8× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.1 \cdot 10^{+59}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

\mathbf{elif}\;i \leq 230000:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.1e59

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

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

    if -1.1e59 < i < 2.3e5

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if 2.3e5 < i

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

Alternative 22: 29.5% accurate, 2.8× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -7.8 \cdot 10^{+60}:\\
\;\;\;\;\left(b \cdot t\right) \cdot i\\

\mathbf{elif}\;i \leq 230000:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -7.8000000000000006e60

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

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

    if -7.8000000000000006e60 < i < 2.3e5

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if 2.3e5 < i

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

Alternative 23: 29.5% accurate, 2.8× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+14}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1e107 or 1.15e14 < z

    1. Initial program 73.9%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Applied rewrites23.2%

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

    if -2.1e107 < z < 1.15e14

    1. Initial program 73.9%

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

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

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

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    5. Applied rewrites22.0%

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

Alternative 24: 23.2% accurate, 5.9× speedup?

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

\\
x \cdot \left(y \cdot z\right)
\end{array}
Derivation
  1. Initial program 73.9%

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

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

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

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

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  6. Applied rewrites23.2%

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

Reproduce

?
herbie shell --seed 2025153 
(FPCore (x y z t a b c i j)
  :name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
  :precision binary64
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))