Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 72.4% → 81.4%
Time: 6.9s
Alternatives: 22
Speedup: 0.5×

Specification

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 72.4% accurate, 1.0× speedup?

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

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

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

Alternative 1: 81.4% accurate, 0.5× speedup?

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

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


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

    1. Initial program 72.4%

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

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

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.5% accurate, 1.1× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = j * ((c * t) - (i * y))
    if (j <= (-5.1d+32)) then
        tmp = ((-1.0d0) * (a * ((t * x) - (b * i)))) + t_1
    else if (j <= 3.2d-44) then
        tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b)
    else if (j <= 4.1d+182) then
        tmp = (z * ((x * y) - (b * c))) + t_1
    else
        tmp = (a * (b * i)) + t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = j * ((c * t) - (i * y));
	double tmp;
	if (j <= -5.1e+32) {
		tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1;
	} else if (j <= 3.2e-44) {
		tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b);
	} else if (j <= 4.1e+182) {
		tmp = (z * ((x * y) - (b * c))) + t_1;
	} else {
		tmp = (a * (b * i)) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = j * ((c * t) - (i * y))
	tmp = 0
	if j <= -5.1e+32:
		tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1
	elif j <= 3.2e-44:
		tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b)
	elif j <= 4.1e+182:
		tmp = (z * ((x * y) - (b * c))) + t_1
	else:
		tmp = (a * (b * i)) + t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(j * Float64(Float64(c * t) - Float64(i * y)))
	tmp = 0.0
	if (j <= -5.1e+32)
		tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + t_1);
	elseif (j <= 3.2e-44)
		tmp = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(a * t))) - Float64(Float64(c * z) * b)) + Float64(Float64(i * a) * b));
	elseif (j <= 4.1e+182)
		tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + t_1);
	else
		tmp = Float64(Float64(a * Float64(b * i)) + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = j * ((c * t) - (i * y));
	tmp = 0.0;
	if (j <= -5.1e+32)
		tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1;
	elseif (j <= 3.2e-44)
		tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b);
	elseif (j <= 4.1e+182)
		tmp = (z * ((x * y) - (b * c))) + t_1;
	else
		tmp = (a * (b * i)) + 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[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -5.1e+32], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[j, 3.2e-44], N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4.1e+182], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;j \leq -5.1 \cdot 10^{+32}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + t\_1\\

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

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

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


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

    1. Initial program 72.4%

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

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

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

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

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

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x - \color{blue}{b} \cdot i\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      5. lower-*.f6459.6%

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

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

    if -5.1e32 < j < 3.1999999999999999e-44

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e-44 < j < 4.1e182

    1. Initial program 72.4%

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

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

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

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

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

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

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

    if 4.1e182 < j

    1. Initial program 72.4%

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

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

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

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

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

Alternative 3: 68.4% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-35}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + t\_1\\

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.5999999999999999e29

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e29 < z < 3.6999999999999999e-35

    1. Initial program 72.4%

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

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

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

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

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

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x - \color{blue}{b} \cdot i\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      5. lower-*.f6459.6%

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

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

    if 3.6999999999999999e-35 < z < 8.8e72

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-*.f6458.6%

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

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

    if 8.8e72 < z

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) + \left(i \cdot a\right) \cdot b \]
      5. lower-*.f6449.7%

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

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

Alternative 4: 67.0% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-270}:\\
\;\;\;\;\left(\left(i \cdot b\right) \cdot a - \left(\left(-c\right) \cdot j\right) \cdot t\right) - \left(j \cdot i\right) \cdot y\\

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.75e28

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

    if -1.75e28 < z < -6.9999999999999999e-270

    1. Initial program 72.4%

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

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

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

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

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

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

    if -6.9999999999999999e-270 < z < 2.9000000000000001e28

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9000000000000001e28 < z

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) + \left(i \cdot a\right) \cdot b \]
      5. lower-*.f6449.7%

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

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

Alternative 5: 61.3% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;x \leq 3.75 \cdot 10^{+90}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right) + t\_1\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3e41 or 3.7500000000000001e90 < x

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e41 < x < 3.7500000000000001e90

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-*.f6458.6%

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

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

Alternative 6: 59.2% accurate, 1.2× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.75e28

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

    if -1.75e28 < z < 9.9999999999999998e72

    1. Initial program 72.4%

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

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

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

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

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

    if 9.9999999999999998e72 < z

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) + \left(i \cdot a\right) \cdot b \]
      5. lower-*.f6449.7%

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

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

Alternative 7: 58.8% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75e28 or 5.5000000000000002e96 < z

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

    if -1.75e28 < z < 5.5000000000000002e96

    1. Initial program 72.4%

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

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

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

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

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

Alternative 8: 52.5% accurate, 1.6× speedup?

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

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.9000000000000001e114 or 1.2e63 < b

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9000000000000001e114 < b < 33000

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot z + \left(\mathsf{neg}\left(i \cdot j\right)\right)\right) \cdot y \]
      8. sub-flip-reverseN/A

        \[\leadsto \left(x \cdot z - i \cdot j\right) \cdot y \]
      9. lower--.f6439.5%

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

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

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

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

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

    if 33000 < b < 1.2e63

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      14. lower-*.f6471.4%

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      17. lower-*.f6471.4%

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

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

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

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

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

        \[\leadsto t \cdot \left(c \cdot j - \color{blue}{a} \cdot x\right) \]
      4. lower-*.f6439.2%

        \[\leadsto t \cdot \left(c \cdot j - a \cdot \color{blue}{x}\right) \]
    6. Applied rewrites39.2%

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

Alternative 9: 52.1% accurate, 1.6× speedup?

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

\mathbf{elif}\;c \leq 2.5 \cdot 10^{-59}:\\
\;\;\;\;\left(x \cdot z - j \cdot i\right) \cdot y\\

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.6e31 or 3.7500000000000002e37 < c

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

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

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

    if -1.6e31 < c < 2.5000000000000001e-59

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot z + \left(\mathsf{neg}\left(i \cdot j\right)\right)\right) \cdot y \]
      8. sub-flip-reverseN/A

        \[\leadsto \left(x \cdot z - i \cdot j\right) \cdot y \]
      9. lower--.f6439.5%

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

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

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

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

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

    if 2.5000000000000001e-59 < c < 3.7500000000000002e37

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 51.9% accurate, 2.0× speedup?

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

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

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

\mathbf{elif}\;c \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\left(x \cdot z - j \cdot i\right) \cdot y\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.6e31 or 2e38 < c

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

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

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

    if -1.6e31 < c < 2e38

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot z + \left(\mathsf{neg}\left(i \cdot j\right)\right)\right) \cdot y \]
      8. sub-flip-reverseN/A

        \[\leadsto \left(x \cdot z - i \cdot j\right) \cdot y \]
      9. lower--.f6439.5%

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

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

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

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

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

Alternative 11: 41.5% accurate, 1.6× speedup?

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

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -3.1999999999999999e112

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around 0

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

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot \color{blue}{j}\right)\right) \]
      2. lower-*.f6422.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right)\right) \]
    10. Applied rewrites22.5%

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

    if -3.1999999999999999e112 < i < 9.0000000000000002e-167

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

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

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

    if 9.0000000000000002e-167 < i < 4.8999999999999999e234

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

    if 4.8999999999999999e234 < i

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]
    8. Step-by-step derivation
      1. lower-*.f6422.8%

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

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

Alternative 12: 40.6% accurate, 2.0× speedup?

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

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

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

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

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


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

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around 0

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

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot \color{blue}{j}\right)\right) \]
      2. lower-*.f6422.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right)\right) \]
    10. Applied rewrites22.5%

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

    if -3.1999999999999999e112 < i < 1.5799999999999999e91

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

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

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

    if 1.5799999999999999e91 < i

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]
    8. Step-by-step derivation
      1. lower-*.f6422.8%

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

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

Alternative 13: 30.9% accurate, 1.1× speedup?

\[\begin{array}{l} t_1 := \left(x \cdot y\right) \cdot z\\ t_2 := b \cdot \left(a \cdot i\right)\\ \mathbf{if}\;a \leq -6.4 \cdot 10^{+230}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{+29}:\\ \;\;\;\;\left(x \cdot t\right) \cdot \left(-a\right)\\ \mathbf{elif}\;a \leq -1.56 \cdot 10^{-93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-204}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-99}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{+32}:\\ \;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+176}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (let* ((t_1 (* (* x y) z)) (t_2 (* b (* a i))))
  (if (<= a -6.4e+230)
    t_2
    (if (<= a -3.2e+29)
      (* (* x t) (- a))
      (if (<= a -1.56e-93)
        t_1
        (if (<= a 6e-204)
          (* c (* j t))
          (if (<= a 1.05e-99)
            t_1
            (if (<= a 3.9e+32)
              (* -1.0 (* i (* j y)))
              (if (<= a 4.4e+176) (* (* (- a) t) x) t_2)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (x * y) * z;
	double t_2 = b * (a * i);
	double tmp;
	if (a <= -6.4e+230) {
		tmp = t_2;
	} else if (a <= -3.2e+29) {
		tmp = (x * t) * -a;
	} else if (a <= -1.56e-93) {
		tmp = t_1;
	} else if (a <= 6e-204) {
		tmp = c * (j * t);
	} else if (a <= 1.05e-99) {
		tmp = t_1;
	} else if (a <= 3.9e+32) {
		tmp = -1.0 * (i * (j * y));
	} else if (a <= 4.4e+176) {
		tmp = (-a * t) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * y) * z
    t_2 = b * (a * i)
    if (a <= (-6.4d+230)) then
        tmp = t_2
    else if (a <= (-3.2d+29)) then
        tmp = (x * t) * -a
    else if (a <= (-1.56d-93)) then
        tmp = t_1
    else if (a <= 6d-204) then
        tmp = c * (j * t)
    else if (a <= 1.05d-99) then
        tmp = t_1
    else if (a <= 3.9d+32) then
        tmp = (-1.0d0) * (i * (j * y))
    else if (a <= 4.4d+176) then
        tmp = (-a * t) * x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (x * y) * z;
	double t_2 = b * (a * i);
	double tmp;
	if (a <= -6.4e+230) {
		tmp = t_2;
	} else if (a <= -3.2e+29) {
		tmp = (x * t) * -a;
	} else if (a <= -1.56e-93) {
		tmp = t_1;
	} else if (a <= 6e-204) {
		tmp = c * (j * t);
	} else if (a <= 1.05e-99) {
		tmp = t_1;
	} else if (a <= 3.9e+32) {
		tmp = -1.0 * (i * (j * y));
	} else if (a <= 4.4e+176) {
		tmp = (-a * t) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (x * y) * z
	t_2 = b * (a * i)
	tmp = 0
	if a <= -6.4e+230:
		tmp = t_2
	elif a <= -3.2e+29:
		tmp = (x * t) * -a
	elif a <= -1.56e-93:
		tmp = t_1
	elif a <= 6e-204:
		tmp = c * (j * t)
	elif a <= 1.05e-99:
		tmp = t_1
	elif a <= 3.9e+32:
		tmp = -1.0 * (i * (j * y))
	elif a <= 4.4e+176:
		tmp = (-a * t) * x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(x * y) * z)
	t_2 = Float64(b * Float64(a * i))
	tmp = 0.0
	if (a <= -6.4e+230)
		tmp = t_2;
	elseif (a <= -3.2e+29)
		tmp = Float64(Float64(x * t) * Float64(-a));
	elseif (a <= -1.56e-93)
		tmp = t_1;
	elseif (a <= 6e-204)
		tmp = Float64(c * Float64(j * t));
	elseif (a <= 1.05e-99)
		tmp = t_1;
	elseif (a <= 3.9e+32)
		tmp = Float64(-1.0 * Float64(i * Float64(j * y)));
	elseif (a <= 4.4e+176)
		tmp = Float64(Float64(Float64(-a) * t) * x);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (x * y) * z;
	t_2 = b * (a * i);
	tmp = 0.0;
	if (a <= -6.4e+230)
		tmp = t_2;
	elseif (a <= -3.2e+29)
		tmp = (x * t) * -a;
	elseif (a <= -1.56e-93)
		tmp = t_1;
	elseif (a <= 6e-204)
		tmp = c * (j * t);
	elseif (a <= 1.05e-99)
		tmp = t_1;
	elseif (a <= 3.9e+32)
		tmp = -1.0 * (i * (j * y));
	elseif (a <= 4.4e+176)
		tmp = (-a * t) * x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.4e+230], t$95$2, If[LessEqual[a, -3.2e+29], N[(N[(x * t), $MachinePrecision] * (-a)), $MachinePrecision], If[LessEqual[a, -1.56e-93], t$95$1, If[LessEqual[a, 6e-204], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-99], t$95$1, If[LessEqual[a, 3.9e+32], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.4e+176], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot z\\
t_2 := b \cdot \left(a \cdot i\right)\\
\mathbf{if}\;a \leq -6.4 \cdot 10^{+230}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;a \leq -1.56 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 6 \cdot 10^{-204}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\

\mathbf{elif}\;a \leq 1.05 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.9 \cdot 10^{+32}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\

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

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


\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -6.3999999999999999e230 or 4.4000000000000001e176 < a

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]
    8. Step-by-step derivation
      1. lower-*.f6422.8%

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

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

    if -6.3999999999999999e230 < a < -3.1999999999999999e29

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      14. lower-*.f6471.4%

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      17. lower-*.f6471.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - \color{blue}{a} \cdot i\right)\right) \]
      10. lower-*.f6457.2%

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

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

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

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

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

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) \]
    9. Applied rewrites22.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999999e29 < a < -1.5600000000000001e-93 or 5.9999999999999997e-204 < a < 1.0499999999999999e-99

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      5. lower-*.f6421.8%

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

      \[\leadsto \left(x \cdot y\right) \cdot z \]

    if -1.5600000000000001e-93 < a < 5.9999999999999997e-204

    1. Initial program 72.4%

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

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

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

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.0%

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

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

    if 1.0499999999999999e-99 < a < 3.8999999999999999e32

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around 0

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

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

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \color{blue}{y}\right)\right) \]
      3. lower-*.f6422.7%

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot y\right)\right) \]
    10. Applied rewrites22.7%

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

    if 3.8999999999999999e32 < a < 4.4000000000000001e176

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      14. lower-*.f6471.4%

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      17. lower-*.f6471.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - \color{blue}{a} \cdot i\right)\right) \]
      10. lower-*.f6457.2%

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f6422.4%

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) \]
    9. Applied rewrites22.4%

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto -1 \cdot \left(\left(a \cdot t\right) \cdot x\right) \]
      5. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(\left(a \cdot t\right) \cdot x\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      7. lift-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      8. lower-*.f6422.4%

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      9. lift-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      10. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a \cdot t\right)\right) \cdot x \]
      11. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a \cdot t\right)\right) \cdot x \]
      12. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      13. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      14. lower-neg.f6422.4%

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
    11. Applied rewrites22.4%

      \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 14: 30.9% accurate, 2.1× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+34}:\\ \;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 0.16:\\ \;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (if (<= z -3.8e+34)
  (* b (* -1.0 (* c z)))
  (if (<= z 0.16)
    (* y (* -1.0 (* i j)))
    (if (<= z 3.8e+162) (* a (* b i)) (* x (* y z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -3.8e+34) {
		tmp = b * (-1.0 * (c * z));
	} else if (z <= 0.16) {
		tmp = y * (-1.0 * (i * j));
	} else if (z <= 3.8e+162) {
		tmp = a * (b * i);
	} else {
		tmp = x * (y * z);
	}
	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 (z <= (-3.8d+34)) then
        tmp = b * ((-1.0d0) * (c * z))
    else if (z <= 0.16d0) then
        tmp = y * ((-1.0d0) * (i * j))
    else if (z <= 3.8d+162) then
        tmp = a * (b * i)
    else
        tmp = x * (y * z)
    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 (z <= -3.8e+34) {
		tmp = b * (-1.0 * (c * z));
	} else if (z <= 0.16) {
		tmp = y * (-1.0 * (i * j));
	} else if (z <= 3.8e+162) {
		tmp = a * (b * i);
	} else {
		tmp = x * (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -3.8e+34:
		tmp = b * (-1.0 * (c * z))
	elif z <= 0.16:
		tmp = y * (-1.0 * (i * j))
	elif z <= 3.8e+162:
		tmp = a * (b * i)
	else:
		tmp = x * (y * z)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -3.8e+34)
		tmp = Float64(b * Float64(-1.0 * Float64(c * z)));
	elseif (z <= 0.16)
		tmp = Float64(y * Float64(-1.0 * Float64(i * j)));
	elseif (z <= 3.8e+162)
		tmp = Float64(a * Float64(b * i));
	else
		tmp = Float64(x * Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -3.8e+34)
		tmp = b * (-1.0 * (c * z));
	elseif (z <= 0.16)
		tmp = y * (-1.0 * (i * j));
	elseif (z <= 3.8e+162)
		tmp = a * (b * i);
	else
		tmp = x * (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -3.8e+34], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.16], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+162], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+34}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\

\mathbf{elif}\;z \leq 0.16:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8000000000000001e34

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      3. lift--.f64N/A

        \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      4. associate-+r-N/A

        \[\leadsto \color{blue}{\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot a\right)} \]
      6. lift--.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z - i \cdot a\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - \color{blue}{i \cdot a}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i\right)\right) \cdot a\right)} \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b\right)} \]
      10. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b} \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \color{blue}{\left(\mathsf{neg}\left(i \cdot a\right)\right)} \cdot b \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\mathsf{neg}\left(\color{blue}{i \cdot a}\right)\right) \cdot b \]
    3. Applied rewrites71.3%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot t - i \cdot y\right) \cdot j - \left(a \cdot t - z \cdot y\right) \cdot x\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b} \]
    4. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(a \cdot i - c \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.2%

        \[\leadsto b \cdot \left(a \cdot i - c \cdot \color{blue}{z}\right) \]
    6. Applied rewrites39.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    7. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(-1 \cdot \color{blue}{\left(c \cdot z\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(-1 \cdot \left(c \cdot \color{blue}{z}\right)\right) \]
      2. lower-*.f6421.9%

        \[\leadsto b \cdot \left(-1 \cdot \left(c \cdot z\right)\right) \]
    9. Applied rewrites21.9%

      \[\leadsto b \cdot \left(-1 \cdot \color{blue}{\left(c \cdot z\right)}\right) \]

    if -3.8000000000000001e34 < z < 0.16

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around 0

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(i \cdot j\right)}\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot \color{blue}{j}\right)\right) \]
      2. lower-*.f6422.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right)\right) \]
    10. Applied rewrites22.5%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(i \cdot j\right)}\right) \]

    if 0.16 < z < 3.8000000000000002e162

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      3. lift--.f64N/A

        \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      4. associate-+r-N/A

        \[\leadsto \color{blue}{\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot a\right)} \]
      6. lift--.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z - i \cdot a\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - \color{blue}{i \cdot a}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i\right)\right) \cdot a\right)} \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b\right)} \]
      10. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b} \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \color{blue}{\left(\mathsf{neg}\left(i \cdot a\right)\right)} \cdot b \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\mathsf{neg}\left(\color{blue}{i \cdot a}\right)\right) \cdot b \]
    3. Applied rewrites71.3%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot t - i \cdot y\right) \cdot j - \left(a \cdot t - z \cdot y\right) \cdot x\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b} \]
    4. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(a \cdot i - c \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.2%

        \[\leadsto b \cdot \left(a \cdot i - c \cdot \color{blue}{z}\right) \]
    6. Applied rewrites39.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    7. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.9%

        \[\leadsto a \cdot \left(b \cdot i\right) \]
    9. Applied rewrites22.9%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]

    if 3.8000000000000002e162 < z

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 15: 30.0% accurate, 2.1× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+34}:\\ \;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 0.16:\\ \;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (if (<= z -3.8e+34)
  (* c (* -1.0 (* b z)))
  (if (<= z 0.16)
    (* y (* -1.0 (* i j)))
    (if (<= z 3.8e+162) (* a (* b i)) (* x (* y z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -3.8e+34) {
		tmp = c * (-1.0 * (b * z));
	} else if (z <= 0.16) {
		tmp = y * (-1.0 * (i * j));
	} else if (z <= 3.8e+162) {
		tmp = a * (b * i);
	} else {
		tmp = x * (y * z);
	}
	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 (z <= (-3.8d+34)) then
        tmp = c * ((-1.0d0) * (b * z))
    else if (z <= 0.16d0) then
        tmp = y * ((-1.0d0) * (i * j))
    else if (z <= 3.8d+162) then
        tmp = a * (b * i)
    else
        tmp = x * (y * z)
    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 (z <= -3.8e+34) {
		tmp = c * (-1.0 * (b * z));
	} else if (z <= 0.16) {
		tmp = y * (-1.0 * (i * j));
	} else if (z <= 3.8e+162) {
		tmp = a * (b * i);
	} else {
		tmp = x * (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -3.8e+34:
		tmp = c * (-1.0 * (b * z))
	elif z <= 0.16:
		tmp = y * (-1.0 * (i * j))
	elif z <= 3.8e+162:
		tmp = a * (b * i)
	else:
		tmp = x * (y * z)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -3.8e+34)
		tmp = Float64(c * Float64(-1.0 * Float64(b * z)));
	elseif (z <= 0.16)
		tmp = Float64(y * Float64(-1.0 * Float64(i * j)));
	elseif (z <= 3.8e+162)
		tmp = Float64(a * Float64(b * i));
	else
		tmp = Float64(x * Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -3.8e+34)
		tmp = c * (-1.0 * (b * z));
	elseif (z <= 0.16)
		tmp = y * (-1.0 * (i * j));
	elseif (z <= 3.8e+162)
		tmp = a * (b * i);
	else
		tmp = x * (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -3.8e+34], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.16], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+162], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+34}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\

\mathbf{elif}\;z \leq 0.16:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8000000000000001e34

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(j \cdot t - b \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    5. Taylor expanded in z around inf

      \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(-1 \cdot \left(b \cdot \color{blue}{z}\right)\right) \]
      2. lower-*.f6422.1%

        \[\leadsto c \cdot \left(-1 \cdot \left(b \cdot z\right)\right) \]
    7. Applied rewrites22.1%

      \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\left(b \cdot z\right)}\right) \]

    if -3.8000000000000001e34 < z < 0.16

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around 0

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(i \cdot j\right)}\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot \color{blue}{j}\right)\right) \]
      2. lower-*.f6422.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right)\right) \]
    10. Applied rewrites22.5%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(i \cdot j\right)}\right) \]

    if 0.16 < z < 3.8000000000000002e162

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      3. lift--.f64N/A

        \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      4. associate-+r-N/A

        \[\leadsto \color{blue}{\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot a\right)} \]
      6. lift--.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z - i \cdot a\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - \color{blue}{i \cdot a}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i\right)\right) \cdot a\right)} \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b\right)} \]
      10. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b} \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \color{blue}{\left(\mathsf{neg}\left(i \cdot a\right)\right)} \cdot b \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\mathsf{neg}\left(\color{blue}{i \cdot a}\right)\right) \cdot b \]
    3. Applied rewrites71.3%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot t - i \cdot y\right) \cdot j - \left(a \cdot t - z \cdot y\right) \cdot x\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b} \]
    4. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(a \cdot i - c \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.2%

        \[\leadsto b \cdot \left(a \cdot i - c \cdot \color{blue}{z}\right) \]
    6. Applied rewrites39.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    7. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.9%

        \[\leadsto a \cdot \left(b \cdot i\right) \]
    9. Applied rewrites22.9%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]

    if 3.8000000000000002e162 < z

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 16: 30.0% accurate, 1.8× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+41}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{-172}:\\ \;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+39}:\\ \;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot t\right) \cdot \left(-a\right)\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (if (<= x -1.3e+41)
  (* (* x y) z)
  (if (<= x 7.6e-172)
    (* c (* -1.0 (* b z)))
    (if (<= x 2.8e+39) (* -1.0 (* i (* j y))) (* (* x t) (- a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (x <= -1.3e+41) {
		tmp = (x * y) * z;
	} else if (x <= 7.6e-172) {
		tmp = c * (-1.0 * (b * z));
	} else if (x <= 2.8e+39) {
		tmp = -1.0 * (i * (j * y));
	} else {
		tmp = (x * t) * -a;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (x <= (-1.3d+41)) then
        tmp = (x * y) * z
    else if (x <= 7.6d-172) then
        tmp = c * ((-1.0d0) * (b * z))
    else if (x <= 2.8d+39) then
        tmp = (-1.0d0) * (i * (j * y))
    else
        tmp = (x * t) * -a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (x <= -1.3e+41) {
		tmp = (x * y) * z;
	} else if (x <= 7.6e-172) {
		tmp = c * (-1.0 * (b * z));
	} else if (x <= 2.8e+39) {
		tmp = -1.0 * (i * (j * y));
	} else {
		tmp = (x * t) * -a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if x <= -1.3e+41:
		tmp = (x * y) * z
	elif x <= 7.6e-172:
		tmp = c * (-1.0 * (b * z))
	elif x <= 2.8e+39:
		tmp = -1.0 * (i * (j * y))
	else:
		tmp = (x * t) * -a
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (x <= -1.3e+41)
		tmp = Float64(Float64(x * y) * z);
	elseif (x <= 7.6e-172)
		tmp = Float64(c * Float64(-1.0 * Float64(b * z)));
	elseif (x <= 2.8e+39)
		tmp = Float64(-1.0 * Float64(i * Float64(j * y)));
	else
		tmp = Float64(Float64(x * t) * Float64(-a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (x <= -1.3e+41)
		tmp = (x * y) * z;
	elseif (x <= 7.6e-172)
		tmp = c * (-1.0 * (b * z));
	elseif (x <= 2.8e+39)
		tmp = -1.0 * (i * (j * y));
	else
		tmp = (x * t) * -a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.3e+41], N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 7.6e-172], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+39], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t), $MachinePrecision] * (-a)), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+41}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z\\

\mathbf{elif}\;x \leq 7.6 \cdot 10^{-172}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{+39}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot t\right) \cdot \left(-a\right)\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.3e41

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot z\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      5. lower-*.f6421.8%

        \[\leadsto \left(x \cdot y\right) \cdot z \]
    12. Applied rewrites21.8%

      \[\leadsto \left(x \cdot y\right) \cdot z \]

    if -1.3e41 < x < 7.5999999999999997e-172

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(j \cdot t - b \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    5. Taylor expanded in z around inf

      \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(-1 \cdot \left(b \cdot \color{blue}{z}\right)\right) \]
      2. lower-*.f6422.1%

        \[\leadsto c \cdot \left(-1 \cdot \left(b \cdot z\right)\right) \]
    7. Applied rewrites22.1%

      \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\left(b \cdot z\right)}\right) \]

    if 7.5999999999999997e-172 < x < 2.8e39

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around 0

      \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(j \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(j \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \color{blue}{y}\right)\right) \]
      3. lower-*.f6422.7%

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot y\right)\right) \]
    10. Applied rewrites22.7%

      \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(j \cdot y\right)\right)} \]

    if 2.8e39 < x

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      2. lift--.f64N/A

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(\mathsf{neg}\left(t\right)\right) \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x + \left(\left(\mathsf{neg}\left(t\right)\right) \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      6. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \color{blue}{\left(\mathsf{neg}\left(t \cdot a\right)\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \left(\mathsf{neg}\left(\color{blue}{t \cdot a}\right)\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      8. fp-cancel-sub-signN/A

        \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x - \left(t \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      9. lower--.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x - \left(t \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot z\right) \cdot x} - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      11. lift-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot z\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      13. lower-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      14. lower-*.f6471.4%

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(t \cdot a\right) \cdot x}\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      15. lift-*.f64N/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(t \cdot a\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      16. *-commutativeN/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      17. lower-*.f6471.4%

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    3. Applied rewrites71.4%

      \[\leadsto \left(\color{blue}{\left(\left(z \cdot y\right) \cdot x - \left(a \cdot t\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    4. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right)} \]
    5. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \color{blue}{\left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(\color{blue}{a \cdot \left(t \cdot x\right)} + b \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \color{blue}{\left(t \cdot x\right)} + b \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      4. lower-+.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + \color{blue}{b \cdot \left(c \cdot z - a \cdot i\right)}\right) \]
      5. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + \color{blue}{b} \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \color{blue}{\left(c \cdot z - a \cdot i\right)}\right) \]
      8. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - \color{blue}{a \cdot i}\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - \color{blue}{a} \cdot i\right)\right) \]
      10. lower-*.f6457.2%

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot \color{blue}{i}\right)\right) \]
    6. Applied rewrites57.2%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right)} \]
    7. Taylor expanded in x around inf

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f6422.4%

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) \]
    9. Applied rewrites22.4%

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(t \cdot x\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(t \cdot x\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(t \cdot x\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(x \cdot t\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(x \cdot t\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      10. lower-neg.f6422.4%

        \[\leadsto \left(x \cdot t\right) \cdot \left(-a\right) \]
    11. Applied rewrites22.4%

      \[\leadsto \left(x \cdot t\right) \cdot \left(-a\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 17: 29.9% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(a \cdot i\right)\\ \mathbf{if}\;a \leq -2.3 \cdot 10^{+79}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.56 \cdot 10^{-93}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-204}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \mathbf{elif}\;a \leq 8800:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (let* ((t_1 (* b (* a i))))
  (if (<= a -2.3e+79)
    t_1
    (if (<= a -1.56e-93)
      (* (* x y) z)
      (if (<= a 6e-204)
        (* c (* j t))
        (if (<= a 8800.0) (* 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 = b * (a * i);
	double tmp;
	if (a <= -2.3e+79) {
		tmp = t_1;
	} else if (a <= -1.56e-93) {
		tmp = (x * y) * z;
	} else if (a <= 6e-204) {
		tmp = c * (j * t);
	} else if (a <= 8800.0) {
		tmp = x * (y * 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 = b * (a * i)
    if (a <= (-2.3d+79)) then
        tmp = t_1
    else if (a <= (-1.56d-93)) then
        tmp = (x * y) * z
    else if (a <= 6d-204) then
        tmp = c * (j * t)
    else if (a <= 8800.0d0) then
        tmp = x * (y * 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 = b * (a * i);
	double tmp;
	if (a <= -2.3e+79) {
		tmp = t_1;
	} else if (a <= -1.56e-93) {
		tmp = (x * y) * z;
	} else if (a <= 6e-204) {
		tmp = c * (j * t);
	} else if (a <= 8800.0) {
		tmp = x * (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = b * (a * i)
	tmp = 0
	if a <= -2.3e+79:
		tmp = t_1
	elif a <= -1.56e-93:
		tmp = (x * y) * z
	elif a <= 6e-204:
		tmp = c * (j * t)
	elif a <= 8800.0:
		tmp = x * (y * z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(b * Float64(a * i))
	tmp = 0.0
	if (a <= -2.3e+79)
		tmp = t_1;
	elseif (a <= -1.56e-93)
		tmp = Float64(Float64(x * y) * z);
	elseif (a <= 6e-204)
		tmp = Float64(c * Float64(j * t));
	elseif (a <= 8800.0)
		tmp = Float64(x * Float64(y * z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = b * (a * i);
	tmp = 0.0;
	if (a <= -2.3e+79)
		tmp = t_1;
	elseif (a <= -1.56e-93)
		tmp = (x * y) * z;
	elseif (a <= 6e-204)
		tmp = c * (j * t);
	elseif (a <= 8800.0)
		tmp = x * (y * 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[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.3e+79], t$95$1, If[LessEqual[a, -1.56e-93], N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 6e-204], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8800.0], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i\right)\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1.56 \cdot 10^{-93}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z\\

\mathbf{elif}\;a \leq 6 \cdot 10^{-204}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\

\mathbf{elif}\;a \leq 8800:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.3e79 or 8800 < a

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      3. lift--.f64N/A

        \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      4. associate-+r-N/A

        \[\leadsto \color{blue}{\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot a\right)} \]
      6. lift--.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z - i \cdot a\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - \color{blue}{i \cdot a}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i\right)\right) \cdot a\right)} \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b\right)} \]
      10. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b} \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \color{blue}{\left(\mathsf{neg}\left(i \cdot a\right)\right)} \cdot b \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\mathsf{neg}\left(\color{blue}{i \cdot a}\right)\right) \cdot b \]
    3. Applied rewrites71.3%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot t - i \cdot y\right) \cdot j - \left(a \cdot t - z \cdot y\right) \cdot x\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b} \]
    4. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(a \cdot i - c \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.2%

        \[\leadsto b \cdot \left(a \cdot i - c \cdot \color{blue}{z}\right) \]
    6. Applied rewrites39.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    7. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]
    8. Step-by-step derivation
      1. lower-*.f6422.8%

        \[\leadsto b \cdot \left(a \cdot i\right) \]
    9. Applied rewrites22.8%

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]

    if -2.3e79 < a < -1.5600000000000001e-93

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot z\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      5. lower-*.f6421.8%

        \[\leadsto \left(x \cdot y\right) \cdot z \]
    12. Applied rewrites21.8%

      \[\leadsto \left(x \cdot y\right) \cdot z \]

    if -1.5600000000000001e-93 < a < 5.9999999999999997e-204

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(j \cdot t - b \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.0%

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    7. Applied rewrites22.0%

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]

    if 5.9999999999999997e-204 < a < 8800

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 18: 29.3% accurate, 2.0× speedup?

\[\begin{array}{l} t_1 := \left(x \cdot t\right) \cdot \left(-a\right)\\ \mathbf{if}\;t \leq -1.3 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-178}:\\ \;\;\;\;b \cdot \left(a \cdot i\right)\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+122}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (let* ((t_1 (* (* x t) (- a))))
  (if (<= t -1.3e+55)
    t_1
    (if (<= t 7e-178)
      (* b (* a i))
      (if (<= t 1.9e+122) (* (* 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 = (x * t) * -a;
	double tmp;
	if (t <= -1.3e+55) {
		tmp = t_1;
	} else if (t <= 7e-178) {
		tmp = b * (a * i);
	} else if (t <= 1.9e+122) {
		tmp = (x * y) * 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 * t) * -a
    if (t <= (-1.3d+55)) then
        tmp = t_1
    else if (t <= 7d-178) then
        tmp = b * (a * i)
    else if (t <= 1.9d+122) then
        tmp = (x * y) * 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 * t) * -a;
	double tmp;
	if (t <= -1.3e+55) {
		tmp = t_1;
	} else if (t <= 7e-178) {
		tmp = b * (a * i);
	} else if (t <= 1.9e+122) {
		tmp = (x * y) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (x * t) * -a
	tmp = 0
	if t <= -1.3e+55:
		tmp = t_1
	elif t <= 7e-178:
		tmp = b * (a * i)
	elif t <= 1.9e+122:
		tmp = (x * y) * z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(x * t) * Float64(-a))
	tmp = 0.0
	if (t <= -1.3e+55)
		tmp = t_1;
	elseif (t <= 7e-178)
		tmp = Float64(b * Float64(a * i));
	elseif (t <= 1.9e+122)
		tmp = Float64(Float64(x * y) * 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 * t) * -a;
	tmp = 0.0;
	if (t <= -1.3e+55)
		tmp = t_1;
	elseif (t <= 7e-178)
		tmp = b * (a * i);
	elseif (t <= 1.9e+122)
		tmp = (x * y) * z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * t), $MachinePrecision] * (-a)), $MachinePrecision]}, If[LessEqual[t, -1.3e+55], t$95$1, If[LessEqual[t, 7e-178], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+122], N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(x \cdot t\right) \cdot \left(-a\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 7 \cdot 10^{-178}:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+122}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.3e55 or 1.8999999999999999e122 < t

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      2. lift--.f64N/A

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(\mathsf{neg}\left(t\right)\right) \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x + \left(\left(\mathsf{neg}\left(t\right)\right) \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      6. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \color{blue}{\left(\mathsf{neg}\left(t \cdot a\right)\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \left(\mathsf{neg}\left(\color{blue}{t \cdot a}\right)\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      8. fp-cancel-sub-signN/A

        \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x - \left(t \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      9. lower--.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x - \left(t \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot z\right) \cdot x} - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      11. lift-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot z\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      13. lower-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(z \cdot y\right)} \cdot x - \left(t \cdot a\right) \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      14. lower-*.f6471.4%

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(t \cdot a\right) \cdot x}\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      15. lift-*.f64N/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(t \cdot a\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      16. *-commutativeN/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      17. lower-*.f6471.4%

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x - \color{blue}{\left(a \cdot t\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    3. Applied rewrites71.4%

      \[\leadsto \left(\color{blue}{\left(\left(z \cdot y\right) \cdot x - \left(a \cdot t\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    4. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right)} \]
    5. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \color{blue}{\left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(\color{blue}{a \cdot \left(t \cdot x\right)} + b \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \color{blue}{\left(t \cdot x\right)} + b \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      4. lower-+.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + \color{blue}{b \cdot \left(c \cdot z - a \cdot i\right)}\right) \]
      5. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + \color{blue}{b} \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \color{blue}{\left(c \cdot z - a \cdot i\right)}\right) \]
      8. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - \color{blue}{a \cdot i}\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - \color{blue}{a} \cdot i\right)\right) \]
      10. lower-*.f6457.2%

        \[\leadsto c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot \color{blue}{i}\right)\right) \]
    6. Applied rewrites57.2%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t\right) - \left(a \cdot \left(t \cdot x\right) + b \cdot \left(c \cdot z - a \cdot i\right)\right)} \]
    7. Taylor expanded in x around inf

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f6422.4%

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) \]
    9. Applied rewrites22.4%

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \color{blue}{\left(t \cdot x\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto -1 \cdot \left(a \cdot \left(t \cdot \color{blue}{x}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(t \cdot x\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(t \cdot x\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(t \cdot x\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(x \cdot t\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(x \cdot t\right) \cdot \left(\mathsf{neg}\left(a\right)\right) \]
      10. lower-neg.f6422.4%

        \[\leadsto \left(x \cdot t\right) \cdot \left(-a\right) \]
    11. Applied rewrites22.4%

      \[\leadsto \left(x \cdot t\right) \cdot \left(-a\right) \]

    if -1.3e55 < t < 6.9999999999999997e-178

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      3. lift--.f64N/A

        \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      4. associate-+r-N/A

        \[\leadsto \color{blue}{\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot a\right)} \]
      6. lift--.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z - i \cdot a\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - \color{blue}{i \cdot a}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i\right)\right) \cdot a\right)} \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b\right)} \]
      10. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b} \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \color{blue}{\left(\mathsf{neg}\left(i \cdot a\right)\right)} \cdot b \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\mathsf{neg}\left(\color{blue}{i \cdot a}\right)\right) \cdot b \]
    3. Applied rewrites71.3%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot t - i \cdot y\right) \cdot j - \left(a \cdot t - z \cdot y\right) \cdot x\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b} \]
    4. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(a \cdot i - c \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.2%

        \[\leadsto b \cdot \left(a \cdot i - c \cdot \color{blue}{z}\right) \]
    6. Applied rewrites39.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    7. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]
    8. Step-by-step derivation
      1. lower-*.f6422.8%

        \[\leadsto b \cdot \left(a \cdot i\right) \]
    9. Applied rewrites22.8%

      \[\leadsto b \cdot \left(a \cdot \color{blue}{i}\right) \]

    if 6.9999999999999997e-178 < t < 1.8999999999999999e122

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot z\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      5. lower-*.f6421.8%

        \[\leadsto \left(x \cdot y\right) \cdot z \]
    12. Applied rewrites21.8%

      \[\leadsto \left(x \cdot y\right) \cdot z \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 29.3% accurate, 2.1× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-5}:\\ \;\;\;\;\left(x \cdot z\right) \cdot y\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-270}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\ \;\;\;\;a \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (if (<= z -8e-5)
  (* (* x z) y)
  (if (<= z -6.4e-270)
    (* c (* j t))
    (if (<= z 3.8e+162) (* a (* b i)) (* x (* y z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -8e-5) {
		tmp = (x * z) * y;
	} else if (z <= -6.4e-270) {
		tmp = c * (j * t);
	} else if (z <= 3.8e+162) {
		tmp = a * (b * i);
	} else {
		tmp = x * (y * z);
	}
	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 (z <= (-8d-5)) then
        tmp = (x * z) * y
    else if (z <= (-6.4d-270)) then
        tmp = c * (j * t)
    else if (z <= 3.8d+162) then
        tmp = a * (b * i)
    else
        tmp = x * (y * z)
    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 (z <= -8e-5) {
		tmp = (x * z) * y;
	} else if (z <= -6.4e-270) {
		tmp = c * (j * t);
	} else if (z <= 3.8e+162) {
		tmp = a * (b * i);
	} else {
		tmp = x * (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -8e-5:
		tmp = (x * z) * y
	elif z <= -6.4e-270:
		tmp = c * (j * t)
	elif z <= 3.8e+162:
		tmp = a * (b * i)
	else:
		tmp = x * (y * z)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -8e-5)
		tmp = Float64(Float64(x * z) * y);
	elseif (z <= -6.4e-270)
		tmp = Float64(c * Float64(j * t));
	elseif (z <= 3.8e+162)
		tmp = Float64(a * Float64(b * i));
	else
		tmp = Float64(x * Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -8e-5)
		tmp = (x * z) * y;
	elseif (z <= -6.4e-270)
		tmp = c * (j * t);
	elseif (z <= 3.8e+162)
		tmp = a * (b * i);
	else
		tmp = x * (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -8e-5], N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -6.4e-270], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+162], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-5}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-270}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.0000000000000007e-5

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot z\right) \]
      3. *-commutativeN/A

        \[\leadsto x \cdot \left(z \cdot y\right) \]
      4. associate-*l*N/A

        \[\leadsto \left(x \cdot z\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot z\right) \cdot y \]
      6. lower-*.f6422.4%

        \[\leadsto \left(x \cdot z\right) \cdot y \]
    12. Applied rewrites22.4%

      \[\leadsto \left(x \cdot z\right) \cdot y \]

    if -8.0000000000000007e-5 < z < -6.3999999999999998e-270

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(j \cdot t - b \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.0%

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    7. Applied rewrites22.0%

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]

    if -6.3999999999999998e-270 < z < 3.8000000000000002e162

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      3. lift--.f64N/A

        \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)} \]
      4. associate-+r-N/A

        \[\leadsto \color{blue}{\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{b \cdot \left(c \cdot z - i \cdot a\right)} \]
      6. lift--.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z - i \cdot a\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - \color{blue}{i \cdot a}\right) \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i\right)\right) \cdot a\right)} \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b\right)} \]
      10. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\left(\mathsf{neg}\left(i\right)\right) \cdot a\right) \cdot b} \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \color{blue}{\left(\mathsf{neg}\left(i \cdot a\right)\right)} \cdot b \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z\right) \cdot b\right) - \left(\mathsf{neg}\left(\color{blue}{i \cdot a}\right)\right) \cdot b \]
    3. Applied rewrites71.3%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot t - i \cdot y\right) \cdot j - \left(a \cdot t - z \cdot y\right) \cdot x\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b} \]
    4. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(a \cdot i - c \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(a \cdot i - \color{blue}{c} \cdot z\right) \]
      4. lower-*.f6439.2%

        \[\leadsto b \cdot \left(a \cdot i - c \cdot \color{blue}{z}\right) \]
    6. Applied rewrites39.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    7. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      2. lower-*.f6422.9%

        \[\leadsto a \cdot \left(b \cdot i\right) \]
    9. Applied rewrites22.9%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]

    if 3.8000000000000002e162 < z

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 20: 28.6% accurate, 2.6× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-5}:\\ \;\;\;\;\left(x \cdot z\right) \cdot y\\ \mathbf{elif}\;z \leq 1.46 \cdot 10^{+85}:\\ \;\;\;\;c \cdot \left(j \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
(FPCore (x y z t a b c i j)
  :precision binary64
  (if (<= z -8e-5)
  (* (* x z) y)
  (if (<= z 1.46e+85) (* c (* j t)) (* x (* y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -8e-5) {
		tmp = (x * z) * y;
	} else if (z <= 1.46e+85) {
		tmp = c * (j * t);
	} else {
		tmp = x * (y * z);
	}
	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 (z <= (-8d-5)) then
        tmp = (x * z) * y
    else if (z <= 1.46d+85) then
        tmp = c * (j * t)
    else
        tmp = x * (y * z)
    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 (z <= -8e-5) {
		tmp = (x * z) * y;
	} else if (z <= 1.46e+85) {
		tmp = c * (j * t);
	} else {
		tmp = x * (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -8e-5:
		tmp = (x * z) * y
	elif z <= 1.46e+85:
		tmp = c * (j * t)
	else:
		tmp = x * (y * z)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -8e-5)
		tmp = Float64(Float64(x * z) * y);
	elseif (z <= 1.46e+85)
		tmp = Float64(c * Float64(j * t));
	else
		tmp = Float64(x * Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -8e-5)
		tmp = (x * z) * y;
	elseif (z <= 1.46e+85)
		tmp = c * (j * t);
	else
		tmp = x * (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -8e-5], N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1.46e+85], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-5}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\

\mathbf{elif}\;z \leq 1.46 \cdot 10^{+85}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.0000000000000007e-5

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot z\right) \]
      3. *-commutativeN/A

        \[\leadsto x \cdot \left(z \cdot y\right) \]
      4. associate-*l*N/A

        \[\leadsto \left(x \cdot z\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot z\right) \cdot y \]
      6. lower-*.f6422.4%

        \[\leadsto \left(x \cdot z\right) \cdot y \]
    12. Applied rewrites22.4%

      \[\leadsto \left(x \cdot z\right) \cdot y \]

    if -8.0000000000000007e-5 < z < 1.46e85

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(j \cdot t - b \cdot z\right)} \]
      2. lower--.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(j \cdot t - \color{blue}{b} \cdot z\right) \]
      4. lower-*.f6438.8%

        \[\leadsto c \cdot \left(j \cdot t - b \cdot \color{blue}{z}\right) \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.0%

        \[\leadsto c \cdot \left(j \cdot t\right) \]
    7. Applied rewrites22.0%

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]

    if 1.46e85 < z

    1. Initial program 72.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
      6. lower-*.f6471.1%

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
    4. Applied rewrites71.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
      5. lower-*.f6439.5%

        \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
    7. Applied rewrites39.5%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      2. lower-*.f6422.5%

        \[\leadsto x \cdot \left(y \cdot z\right) \]
    10. Applied rewrites22.5%

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 21: 22.5% accurate, 5.5× speedup?

\[\left(x \cdot y\right) \cdot z \]
(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(Float64(x * 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[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]
\left(x \cdot y\right) \cdot z
Derivation
  1. Initial program 72.4%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
  2. Taylor expanded in y around 0

    \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
  3. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
    2. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
    3. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
    5. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
    6. lower-*.f6471.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
  4. Applied rewrites71.1%

    \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
  5. Taylor expanded in y around inf

    \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    2. lower-+.f64N/A

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
    3. lower-*.f64N/A

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
    4. lower-*.f64N/A

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
    5. lower-*.f6439.5%

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
  7. Applied rewrites39.5%

    \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
  8. Taylor expanded in x around inf

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  9. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
    2. lower-*.f6422.5%

      \[\leadsto x \cdot \left(y \cdot z\right) \]
  10. Applied rewrites22.5%

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  11. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
    2. lift-*.f64N/A

      \[\leadsto x \cdot \left(y \cdot z\right) \]
    3. associate-*r*N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    4. lower-*.f64N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    5. lower-*.f6421.8%

      \[\leadsto \left(x \cdot y\right) \cdot z \]
  12. Applied rewrites21.8%

    \[\leadsto \left(x \cdot y\right) \cdot z \]
  13. Add Preprocessing

Alternative 22: 21.8% accurate, 5.5× speedup?

\[x \cdot \left(y \cdot z\right) \]
(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]
x \cdot \left(y \cdot z\right)
Derivation
  1. Initial program 72.4%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
  2. Taylor expanded in y around 0

    \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
  3. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c \cdot \left(j \cdot t\right)}\right) \]
    2. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \color{blue}{c} \cdot \left(j \cdot t\right)\right) \]
    3. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right) \]
    5. lower-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \color{blue}{\left(j \cdot t\right)}\right) \]
    6. lower-*.f6471.1%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot \color{blue}{t}\right)\right) \]
  4. Applied rewrites71.1%

    \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + c \cdot \left(j \cdot t\right)\right)} \]
  5. Taylor expanded in y around inf

    \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    2. lower-+.f64N/A

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x \cdot z}\right) \]
    3. lower-*.f64N/A

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + \color{blue}{x} \cdot z\right) \]
    4. lower-*.f64N/A

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \]
    5. lower-*.f6439.5%

      \[\leadsto y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot \color{blue}{z}\right) \]
  7. Applied rewrites39.5%

    \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
  8. Taylor expanded in x around inf

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  9. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
    2. lower-*.f6422.5%

      \[\leadsto x \cdot \left(y \cdot z\right) \]
  10. Applied rewrites22.5%

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2025258 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))