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

Percentage Accurate: 72.2% → 81.0%
Time: 8.2s
Alternatives: 19
Speedup: 0.5×

Specification

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 72.2% accurate, 1.0× speedup?

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

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

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

Alternative 1: 81.0% 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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\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) (* t i))))
         (* j (- (* c a) (* y i))))))
  (if (<= t_1 INFINITY) t_1 (* -1.0 (* t (- (* a x) (* b i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = -1.0 * (t * ((a * x) - (b * i)));
	}
	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) - (t * i)))) + (j * ((c * a) - (y * i)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = -1.0 * (t * ((a * x) - (b * i)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = -1.0 * (t * ((a * x) - (b * i)))
	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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(-1.0 * Float64(t * Float64(Float64(a * x) - Float64(b * i))));
	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) - (t * i)))) + (j * ((c * a) - (y * i)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = -1.0 * (t * ((a * x) - (b * i)));
	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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(-1.0 * N[(t * N[(N[(a * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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

    1. Initial program 72.2%

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

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

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(a \cdot x - \color{blue}{b} \cdot i\right)\right) \]
      5. lower-*.f6438.9%

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

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

Alternative 2: 66.9% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.95 \cdot 10^{+46}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + t\_2\\

\mathbf{elif}\;y \leq 80000000000:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right) + t\_2\\

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.3999999999999997e209 or 2.6000000000000001e190 < y

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    7. 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-*.f6440.0%

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

        \[\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(z \cdot x - i \cdot j\right) \cdot y \]
      12. lower-*.f6440.0%

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

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

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
      15. lower-*.f6440.0%

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
    8. Applied rewrites40.0%

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

    if -4.3999999999999997e209 < y < -1.95e46

    1. Initial program 72.2%

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

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

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

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

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

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

    if -1.95e46 < y < 8e10

    1. Initial program 72.2%

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

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

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

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

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

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

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

    if 8e10 < y < 2.6000000000000001e190

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.7% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2000000000000001e-22

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e-22 < x < 4.2000000000000003e198

    1. Initial program 72.2%

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

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

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

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

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

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

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

    if 4.2000000000000003e198 < x

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.1% accurate, 1.1× speedup?

\[\begin{array}{l} t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.023:\\ \;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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))) (* j (* a c)))))
  (if (<= z -5.8e+83)
    t_1
    (if (<= z 0.023)
      (+ (* -1.0 (* t (- (* a x) (* b i)))) (* j (- (* c a) (* y 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 = (z * ((x * y) - (b * c))) + (j * (a * c));
	double tmp;
	if (z <= -5.8e+83) {
		tmp = t_1;
	} else if (z <= 0.023) {
		tmp = (-1.0 * (t * ((a * x) - (b * i)))) + (j * ((c * a) - (y * i)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8e83 or 0.023 < z

    1. Initial program 72.2%

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

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

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

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

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

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

      \[\leadsto z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \color{blue}{\left(a \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f6448.4%

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

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

    if -5.8e83 < z < 0.023

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

Alternative 5: 64.2% accurate, 1.2× speedup?

\[\begin{array}{l} t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{+76}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+105}:\\ \;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\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))) (* j (* a c)))))
  (if (<= z -1.75e+76)
    t_1
    (if (<= z 1.05e+105)
      (+ (* b (- (* i t) (* c z))) (* j (- (* c a) (* y 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 = (z * ((x * y) - (b * c))) + (j * (a * c));
	double tmp;
	if (z <= -1.75e+76) {
		tmp = t_1;
	} else if (z <= 1.05e+105) {
		tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75e76 or 1.05e105 < z

    1. Initial program 72.2%

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

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

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

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

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

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

      \[\leadsto z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \color{blue}{\left(a \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f6448.4%

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

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

    if -1.75e76 < z < 1.05e105

    1. Initial program 72.2%

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

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

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

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

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

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

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

Alternative 6: 60.7% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1499999999999999e76 or 0.023 < z

    1. Initial program 72.2%

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

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

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

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

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

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

      \[\leadsto z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \color{blue}{\left(a \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f6448.4%

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

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

    if -2.1499999999999999e76 < z < 0.023

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 60.2% accurate, 1.4× speedup?

\[\begin{array}{l} t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\ \mathbf{if}\;z \leq -270000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.023:\\ \;\;\;\;b \cdot \left(i \cdot t\right) + j \cdot \left(c \cdot a - y \cdot i\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))) (* j (* a c)))))
  (if (<= z -270000000000.0)
    t_1
    (if (<= z 0.023)
      (+ (* b (* i t)) (* j (- (* c a) (* y 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 = (z * ((x * y) - (b * c))) + (j * (a * c));
	double tmp;
	if (z <= -270000000000.0) {
		tmp = t_1;
	} else if (z <= 0.023) {
		tmp = (b * (i * t)) + (j * ((c * a) - (y * i)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e11 or 0.023 < z

    1. Initial program 72.2%

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

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

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

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

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

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

      \[\leadsto z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \color{blue}{\left(a \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f6448.4%

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

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

    if -2.7e11 < z < 0.023

    1. Initial program 72.2%

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

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

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

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

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

Alternative 8: 53.5% accurate, 1.3× speedup?

\[\begin{array}{l} t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\ \mathbf{if}\;y \leq -5.4 \cdot 10^{+66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-55}:\\ \;\;\;\;b \cdot \left(i \cdot t\right) + j \cdot \left(a \cdot c\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+17}:\\ \;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+188}:\\ \;\;\;\;x \cdot \left(y \cdot z\right) - a \cdot \left(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 (* (- (* z x) (* j i)) y)))
  (if (<= y -5.4e+66)
    t_1
    (if (<= y -2.4e-55)
      (+ (* b (* i t)) (* j (* a c)))
      (if (<= y 6.8e+17)
        (* c (- (* a j) (* b z)))
        (if (<= y 2.3e+188) (- (* x (* y z)) (* a (* t x))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((z * x) - (j * i)) * y;
	double tmp;
	if (y <= -5.4e+66) {
		tmp = t_1;
	} else if (y <= -2.4e-55) {
		tmp = (b * (i * t)) + (j * (a * c));
	} else if (y <= 6.8e+17) {
		tmp = c * ((a * j) - (b * z));
	} else if (y <= 2.3e+188) {
		tmp = (x * (y * z)) - (a * (t * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.3999999999999998e66 or 2.3000000000000001e188 < y

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    7. 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-*.f6440.0%

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

        \[\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(z \cdot x - i \cdot j\right) \cdot y \]
      12. lower-*.f6440.0%

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

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

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
      15. lower-*.f6440.0%

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
    8. Applied rewrites40.0%

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

    if -5.3999999999999998e66 < y < -2.3999999999999999e-55

    1. Initial program 72.2%

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

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

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

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

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

      \[\leadsto b \cdot \left(i \cdot t\right) + j \cdot \color{blue}{\left(a \cdot c\right)} \]
    6. Step-by-step derivation
      1. lower-*.f6438.2%

        \[\leadsto b \cdot \left(i \cdot t\right) + j \cdot \left(a \cdot \color{blue}{c}\right) \]
    7. Applied rewrites38.2%

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

    if -2.3999999999999999e-55 < y < 6.8e17

    1. Initial program 72.2%

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

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

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

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

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

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

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

    if 6.8e17 < y < 2.3000000000000001e188

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot \color{blue}{x}\right) \]
      5. lower-*.f6436.0%

        \[\leadsto x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot x\right) \]
    9. Applied rewrites36.0%

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

Alternative 9: 52.7% accurate, 1.3× speedup?

\[\begin{array}{l} t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-55}:\\ \;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+17}:\\ \;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+188}:\\ \;\;\;\;x \cdot \left(y \cdot z\right) - a \cdot \left(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 (* (- (* z x) (* j i)) y)))
  (if (<= y -2.8e+67)
    t_1
    (if (<= y -2.9e-55)
      (* -1.0 (* t (- (* a x) (* b i))))
      (if (<= y 6.8e+17)
        (* c (- (* a j) (* b z)))
        (if (<= y 2.3e+188) (- (* x (* y z)) (* a (* t x))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((z * x) - (j * i)) * y;
	double tmp;
	if (y <= -2.8e+67) {
		tmp = t_1;
	} else if (y <= -2.9e-55) {
		tmp = -1.0 * (t * ((a * x) - (b * i)));
	} else if (y <= 6.8e+17) {
		tmp = c * ((a * j) - (b * z));
	} else if (y <= 2.3e+188) {
		tmp = (x * (y * z)) - (a * (t * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;y \leq -2.9 \cdot 10^{-55}:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\

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

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7999999999999998e67 or 2.3000000000000001e188 < y

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    7. 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-*.f6440.0%

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

        \[\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(z \cdot x - i \cdot j\right) \cdot y \]
      12. lower-*.f6440.0%

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

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

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
      15. lower-*.f6440.0%

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
    8. Applied rewrites40.0%

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

    if -2.7999999999999998e67 < y < -2.9e-55

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(a \cdot x - \color{blue}{b} \cdot i\right)\right) \]
      5. lower-*.f6438.9%

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

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

    if -2.9e-55 < y < 6.8e17

    1. Initial program 72.2%

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

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

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

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

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

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

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

    if 6.8e17 < y < 2.3000000000000001e188

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot \color{blue}{x}\right) \]
      5. lower-*.f6436.0%

        \[\leadsto x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot x\right) \]
    9. Applied rewrites36.0%

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

Alternative 10: 52.7% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.7e-8

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot \color{blue}{x}\right) \]
      5. lower-*.f6436.0%

        \[\leadsto x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot x\right) \]
    9. Applied rewrites36.0%

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

    if -2.7e-8 < x < 6.9999999999999998e41

    1. Initial program 72.2%

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

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

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

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

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

    if 6.9999999999999998e41 < x

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(a \cdot x - \color{blue}{b} \cdot i\right)\right) \]
      5. lower-*.f6438.9%

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

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

Alternative 11: 52.6% accurate, 1.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -2.9 \cdot 10^{-55}:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.7999999999999998e67 or 6.8e17 < y

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    7. 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-*.f6440.0%

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

        \[\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(z \cdot x - i \cdot j\right) \cdot y \]
      12. lower-*.f6440.0%

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

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

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
      15. lower-*.f6440.0%

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
    8. Applied rewrites40.0%

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

    if -2.7999999999999998e67 < y < -2.9e-55

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(a \cdot x - \color{blue}{b} \cdot i\right)\right) \]
      5. lower-*.f6438.9%

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

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

    if -2.9e-55 < y < 6.8e17

    1. Initial program 72.2%

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

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

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

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

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

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

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

Alternative 12: 50.9% accurate, 1.6× speedup?

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

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.3999999999999998e66 or 6.8e17 < y

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    7. 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-*.f6440.0%

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

        \[\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(z \cdot x - i \cdot j\right) \cdot y \]
      12. lower-*.f6440.0%

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

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

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
      15. lower-*.f6440.0%

        \[\leadsto \left(z \cdot x - j \cdot i\right) \cdot y \]
    8. Applied rewrites40.0%

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

    if -5.3999999999999998e66 < y < -3.7999999999999997e-55

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(i \cdot \left(j \cdot y - b \cdot t\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(j \cdot y - b \cdot t\right) \cdot i\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot y - b \cdot t\right)\right)\right) \cdot i \]
      7. sub-negate-revN/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
      8. lower-*.f64N/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot \color{blue}{i} \]
      9. lower--.f6440.5%

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
    8. Applied rewrites40.5%

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

    if -3.7999999999999997e-55 < y < 6.8e17

    1. Initial program 72.2%

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

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

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

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

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

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

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

Alternative 13: 50.8% accurate, 1.6× speedup?

\[\begin{array}{l} t_1 := \left(b \cdot t - j \cdot y\right) \cdot i\\ \mathbf{if}\;i \leq -1.9 \cdot 10^{+37}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -8.2 \cdot 10^{-143}:\\ \;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\ \mathbf{elif}\;i \leq 1660000000000:\\ \;\;\;\;c \cdot \left(a \cdot j - b \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 t) (* j y)) i)))
  (if (<= i -1.9e+37)
    t_1
    (if (<= i -8.2e-143)
      (* a (- (* c j) (* t x)))
      (if (<= i 1660000000000.0) (* c (- (* a j) (* b z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((b * t) - (j * y)) * i;
	double tmp;
	if (i <= -1.9e+37) {
		tmp = t_1;
	} else if (i <= -8.2e-143) {
		tmp = a * ((c * j) - (t * x));
	} else if (i <= 1660000000000.0) {
		tmp = c * ((a * j) - (b * z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;i \leq -8.2 \cdot 10^{-143}:\\
\;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\

\mathbf{elif}\;i \leq 1660000000000:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.8999999999999999e37 or 1.66e12 < i

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(i \cdot \left(j \cdot y - b \cdot t\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(j \cdot y - b \cdot t\right) \cdot i\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot y - b \cdot t\right)\right)\right) \cdot i \]
      7. sub-negate-revN/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
      8. lower-*.f64N/A

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot \color{blue}{i} \]
      9. lower--.f6440.5%

        \[\leadsto \left(b \cdot t - j \cdot y\right) \cdot i \]
    8. Applied rewrites40.5%

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

    if -1.8999999999999999e37 < i < -8.2e-143

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2e-143 < i < 1.66e12

    1. Initial program 72.2%

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

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

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

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

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

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

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

Alternative 14: 41.5% accurate, 2.0× speedup?

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

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

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

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

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

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

    if -2.3e-235 < b < 6.4999999999999999e140

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.4999999999999999e140 < b

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      6. lower-*.f6422.4%

        \[\leadsto \left(i \cdot b\right) \cdot t \]
    11. Applied rewrites22.4%

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

Alternative 15: 41.3% accurate, 2.0× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(i \cdot t\right)\\ \mathbf{if}\;i \leq -9 \cdot 10^{+121}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 2.4 \cdot 10^{+64}:\\ \;\;\;\;c \cdot \left(a \cdot j - b \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 (* i t))))
  (if (<= i -9e+121)
    t_1
    (if (<= i 2.4e+64) (* c (- (* a j) (* b z))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = b * (i * t);
	double tmp;
	if (i <= -9e+121) {
		tmp = t_1;
	} else if (i <= 2.4e+64) {
		tmp = c * ((a * j) - (b * z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -9.0000000000000007e121 or 2.4e64 < i

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000007e121 < i < 2.4e64

    1. Initial program 72.2%

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

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

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

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

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

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

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

Alternative 16: 30.2% accurate, 2.1× speedup?

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-98}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\

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

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - 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 -1.7e28 < z < -1.2e-98

    1. Initial program 72.2%

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

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

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

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

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

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

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

      \[\leadsto c \cdot \left(a \cdot \color{blue}{j}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.2%

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

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

    if -1.2e-98 < z < 7.6000000000000002e84

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

    if 7.6000000000000002e84 < z

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    8. 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) \]
    9. Applied rewrites22.5%

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

Alternative 17: 30.0% accurate, 2.1× speedup?

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

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

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-98}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.05e25 or 7.6000000000000002e84 < z

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    5. 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-*.f6440.0%

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

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

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    8. 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) \]
    9. Applied rewrites22.5%

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

    if -1.05e25 < z < -1.2e-98

    1. Initial program 72.2%

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

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

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

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

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

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

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

      \[\leadsto c \cdot \left(a \cdot \color{blue}{j}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.2%

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

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

    if -1.2e-98 < z < 7.6000000000000002e84

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 29.7% accurate, 2.6× speedup?

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

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

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

\mathbf{elif}\;i \leq 1.18 \cdot 10^{+64}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.06e36 or 1.1800000000000001e64 < i

    1. Initial program 72.2%

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

        \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. lower-*.f6471.2%

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e36 < i < 1.1800000000000001e64

    1. Initial program 72.2%

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

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

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

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

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

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

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

      \[\leadsto c \cdot \left(a \cdot \color{blue}{j}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6422.2%

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

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

Alternative 19: 22.2% accurate, 5.5× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto c \cdot \left(a \cdot \color{blue}{j}\right) \]
  6. Step-by-step derivation
    1. lower-*.f6422.2%

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

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

Reproduce

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