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

Percentage Accurate: 73.3% → 84.4%
Time: 7.7s
Alternatives: 21
Speedup: 1.0×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 73.3% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 84.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - 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}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, \frac{\mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\right)}{y}\right) \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (+
          (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
          (* j (- (* c a) (* y i))))))
   (if (<= t_1 INFINITY)
     t_1
     (* (fma (- i) j (/ (fma (* j c) a (* (fma (- a) x (* i b)) t)) y)) y))))
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 = fma(-i, j, (fma((j * c), a, (fma(-a, x, (i * b)) * t)) / y)) * y;
	}
	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(fma(Float64(-i), j, Float64(fma(Float64(j * c), a, Float64(fma(Float64(-a), x, Float64(i * b)) * t)) / y)) * y);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(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[(N[((-i) * j + N[(N[(N[(j * c), $MachinePrecision] * a + N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - 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}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, \frac{\mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\right)}{y}\right) \cdot y\\


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

    1. Initial program 73.3%

      \[\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 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

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

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

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

Alternative 2: 73.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 9 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, j, \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t - t\_4\right)\\

\mathbf{elif}\;x \leq 2 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, x, \left(j \cdot c\right) \cdot a\right) - t\_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.79999999999999961e71

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right) \]
      16. lower-*.f6460.5

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

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

    if -4.79999999999999961e71 < x < 9e18

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) - \left(c \cdot b\right) \cdot z\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      2. fp-cancel-sign-sub-invN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) - \left(-1 \cdot b\right) \cdot i\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      5. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      7. mul-1-negN/A

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

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

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

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

    if 9e18 < x < 2.00000000000000001e160

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y \cdot z - a \cdot t, x, a \cdot \left(c \cdot j\right)\right) - b \cdot \left(c \cdot z\right) \]
      8. *-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, a \cdot \left(c \cdot j\right)\right) - b \cdot \left(c \cdot z\right) \]
      11. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot j\right) \cdot a\right) - b \cdot \left(c \cdot z\right) \]
      13. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot c\right) \cdot a\right) - b \cdot \left(c \cdot z\right) \]
      15. associate-*r*N/A

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

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

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

    if 2.00000000000000001e160 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      2. +-commutativeN/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      3. associate-*r*N/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      4. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      6. *-commutativeN/A

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      8. lift--.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      12. lower-*.f6438.4

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    7. Applied rewrites38.4%

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

Alternative 3: 67.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{+128}:\\ \;\;\;\;\left(\left(\frac{\left(-c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b\\ \mathbf{elif}\;b \leq 3400000:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, x, i \cdot b\right), t, \left(c \cdot a - i \cdot y\right) \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= b -2.4e+128)
   (* (* (+ (/ (* (- c) z) i) t) i) b)
   (if (<= b 3400000.0)
     (fma (fma (- a) x (* i b)) t (* (- (* c a) (* i y)) j))
     (- (* (- (* z y) (* a t)) x) (* (- (* c z) (* i t)) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -2.4e+128) {
		tmp = ((((-c * z) / i) + t) * i) * b;
	} else if (b <= 3400000.0) {
		tmp = fma(fma(-a, x, (i * b)), t, (((c * a) - (i * y)) * j));
	} else {
		tmp = (((z * y) - (a * t)) * x) - (((c * z) - (i * t)) * b);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -2.4e+128)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(-c) * z) / i) + t) * i) * b);
	elseif (b <= 3400000.0)
		tmp = fma(fma(Float64(-a), x, Float64(i * b)), t, Float64(Float64(Float64(c * a) - Float64(i * y)) * j));
	else
		tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(Float64(Float64(c * z) - Float64(i * t)) * b));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.4e+128], N[(N[(N[(N[(N[((-c) * z), $MachinePrecision] / i), $MachinePrecision] + t), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 3400000.0], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t + N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+128}:\\
\;\;\;\;\left(\left(\frac{\left(-c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b\\

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

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


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

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

      \[\leadsto \left(i \cdot \left(t + -1 \cdot \frac{c \cdot z}{i}\right)\right) \cdot b \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(\left(t + -1 \cdot \frac{c \cdot z}{i}\right) \cdot i\right) \cdot b \]
      3. +-commutativeN/A

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

        \[\leadsto \left(\left(-1 \cdot \frac{c \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
      5. associate-*r/N/A

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

        \[\leadsto \left(\left(\frac{-1 \cdot \left(c \cdot z\right)}{i} + t\right) \cdot i\right) \cdot b \]
      7. associate-*r*N/A

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

        \[\leadsto \left(\left(\frac{\left(-1 \cdot c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
      9. mul-1-negN/A

        \[\leadsto \left(\left(\frac{\left(\mathsf{neg}\left(c\right)\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
      10. lower-neg.f6439.8

        \[\leadsto \left(\left(\frac{\left(-c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
    7. Applied rewrites39.8%

      \[\leadsto \left(\left(\frac{\left(-c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]

    if -2.4000000000000002e128 < b < 3.4e6

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

    if 3.4e6 < b

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) - \left(c \cdot b\right) \cdot z\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      2. fp-cancel-sign-sub-invN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) - \left(-1 \cdot b\right) \cdot i\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      5. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t - \left(c \cdot b\right) \cdot z\right) \]
      7. mul-1-negN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      5. *-commutativeN/A

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      8. *-commutativeN/A

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      12. lower-*.f6458.7

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    10. Applied rewrites58.7%

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

Alternative 4: 66.4% accurate, 1.1× speedup?

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

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

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

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

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


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

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

      \[\leadsto \left(i \cdot \left(t + -1 \cdot \frac{c \cdot z}{i}\right)\right) \cdot b \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(\left(t + -1 \cdot \frac{c \cdot z}{i}\right) \cdot i\right) \cdot b \]
      3. +-commutativeN/A

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

        \[\leadsto \left(\left(-1 \cdot \frac{c \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
      5. associate-*r/N/A

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

        \[\leadsto \left(\left(\frac{-1 \cdot \left(c \cdot z\right)}{i} + t\right) \cdot i\right) \cdot b \]
      7. associate-*r*N/A

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

        \[\leadsto \left(\left(\frac{\left(-1 \cdot c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
      9. mul-1-negN/A

        \[\leadsto \left(\left(\frac{\left(\mathsf{neg}\left(c\right)\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
      10. lower-neg.f6439.8

        \[\leadsto \left(\left(\frac{\left(-c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]
    7. Applied rewrites39.8%

      \[\leadsto \left(\left(\frac{\left(-c\right) \cdot z}{i} + t\right) \cdot i\right) \cdot b \]

    if -2.4000000000000002e128 < b < 1.56000000000000008e-58

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

    if 1.56000000000000008e-58 < b < 8.00000000000000035e93

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right) \]
      16. lower-*.f6460.5

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

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

    if 8.00000000000000035e93 < b

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

Alternative 5: 65.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -8 \cdot 10^{+44}:\\ \;\;\;\;\left(\left(-t\right) \cdot \mathsf{fma}\left(c, \frac{z}{t}, -i\right)\right) \cdot b\\ \mathbf{elif}\;b \leq 8 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= b -8e+44)
   (* (* (- t) (fma c (/ z t) (- i))) b)
   (if (<= b 8e+93)
     (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))
     (* (- (* i t) (* c z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -8e+44) {
		tmp = (-t * fma(c, (z / t), -i)) * b;
	} else if (b <= 8e+93) {
		tmp = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
	} else {
		tmp = ((i * t) - (c * z)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -8e+44)
		tmp = Float64(Float64(Float64(-t) * fma(c, Float64(z / t), Float64(-i))) * b);
	elseif (b <= 8e+93)
		tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x));
	else
		tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -8e+44], N[(N[((-t) * N[(c * N[(z / t), $MachinePrecision] + (-i)), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 8e+93], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{+44}:\\
\;\;\;\;\left(\left(-t\right) \cdot \mathsf{fma}\left(c, \frac{z}{t}, -i\right)\right) \cdot b\\

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

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


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

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

      \[\leadsto \left(-1 \cdot \left(t \cdot \left(-1 \cdot i + \frac{c \cdot z}{t}\right)\right)\right) \cdot b \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot i + \frac{c \cdot z}{t}\right)\right) \cdot b \]
      3. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot \left(-1 \cdot i + \frac{c \cdot z}{t}\right)\right) \cdot b \]
      4. lift-neg.f64N/A

        \[\leadsto \left(\left(-t\right) \cdot \left(-1 \cdot i + \frac{c \cdot z}{t}\right)\right) \cdot b \]
      5. mul-1-negN/A

        \[\leadsto \left(\left(-t\right) \cdot \left(\left(\mathsf{neg}\left(i\right)\right) + \frac{c \cdot z}{t}\right)\right) \cdot b \]
      6. +-commutativeN/A

        \[\leadsto \left(\left(-t\right) \cdot \left(\frac{c \cdot z}{t} + \left(\mathsf{neg}\left(i\right)\right)\right)\right) \cdot b \]
      7. associate-/l*N/A

        \[\leadsto \left(\left(-t\right) \cdot \left(c \cdot \frac{z}{t} + \left(\mathsf{neg}\left(i\right)\right)\right)\right) \cdot b \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(-t\right) \cdot \mathsf{fma}\left(c, \frac{z}{t}, \mathsf{neg}\left(i\right)\right)\right) \cdot b \]
      9. lower-/.f64N/A

        \[\leadsto \left(\left(-t\right) \cdot \mathsf{fma}\left(c, \frac{z}{t}, \mathsf{neg}\left(i\right)\right)\right) \cdot b \]
      10. lower-neg.f6440.0

        \[\leadsto \left(\left(-t\right) \cdot \mathsf{fma}\left(c, \frac{z}{t}, -i\right)\right) \cdot b \]
    7. Applied rewrites40.0%

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

    if -8.0000000000000007e44 < b < 8.00000000000000035e93

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right) \]
      16. lower-*.f6460.5

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

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

    if 8.00000000000000035e93 < b

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

Alternative 6: 60.2% accurate, 1.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.05000000000000003e66 or 9e18 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      2. +-commutativeN/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      3. associate-*r*N/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      4. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      6. *-commutativeN/A

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      8. lift--.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      12. lower-*.f6438.4

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    7. Applied rewrites38.4%

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

    if -1.05000000000000003e66 < x < -5.50000000000000023e-53

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

      \[\leadsto -1 \cdot \left(b \cdot \left(c \cdot z\right)\right) + \color{blue}{x \cdot \left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right) + x \cdot \left(y \cdot z\right) \]
      3. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x - b \cdot \left(c \cdot z\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x - b \cdot \left(c \cdot z\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x - \left(c \cdot z\right) \cdot b \]
      11. lower-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x - \left(c \cdot z\right) \cdot b \]
      12. lower-*.f6434.6

        \[\leadsto \left(z \cdot y\right) \cdot x - \left(c \cdot z\right) \cdot b \]
    7. Applied rewrites34.6%

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

    if -5.50000000000000023e-53 < x < 9e18

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j + b \cdot \left(i \cdot t\right) \]
      3. *-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(i \cdot t\right) \cdot b\right) \]
      10. lower-*.f6450.9

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(i \cdot t\right) \cdot b\right) \]
    10. Applied rewrites50.9%

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

Alternative 7: 58.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.9 \cdot 10^{+63}:\\ \;\;\;\;\left(\left(-c\right) \cdot \left(\frac{x}{c} \cdot t - j\right)\right) \cdot a\\ \mathbf{elif}\;a \leq -1.76 \cdot 10^{-205}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-298}:\\ \;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\ \mathbf{elif}\;a \leq 26000000000000:\\ \;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= a -5.9e+63)
   (* (* (- c) (- (* (/ x c) t) j)) a)
   (if (<= a -1.76e-205)
     (* (fma (- i) j (* z x)) y)
     (if (<= a -5.5e-298)
       (* (- (* y x) (* c b)) z)
       (if (<= a 26000000000000.0)
         (* (fma (- j) y (* b t)) i)
         (* (fma (- t) x (* j c)) a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -5.9e+63) {
		tmp = (-c * (((x / c) * t) - j)) * a;
	} else if (a <= -1.76e-205) {
		tmp = fma(-i, j, (z * x)) * y;
	} else if (a <= -5.5e-298) {
		tmp = ((y * x) - (c * b)) * z;
	} else if (a <= 26000000000000.0) {
		tmp = fma(-j, y, (b * t)) * i;
	} else {
		tmp = fma(-t, x, (j * c)) * a;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (a <= -5.9e+63)
		tmp = Float64(Float64(Float64(-c) * Float64(Float64(Float64(x / c) * t) - j)) * a);
	elseif (a <= -1.76e-205)
		tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y);
	elseif (a <= -5.5e-298)
		tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z);
	elseif (a <= 26000000000000.0)
		tmp = Float64(fma(Float64(-j), y, Float64(b * t)) * i);
	else
		tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -5.9e+63], N[(N[((-c) * N[(N[(N[(x / c), $MachinePrecision] * t), $MachinePrecision] - j), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[a, -1.76e-205], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, -5.5e-298], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 26000000000000.0], N[(N[((-j) * y + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.9 \cdot 10^{+63}:\\
\;\;\;\;\left(\left(-c\right) \cdot \left(\frac{x}{c} \cdot t - j\right)\right) \cdot a\\

\mathbf{elif}\;a \leq -1.76 \cdot 10^{-205}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\

\mathbf{elif}\;a \leq -5.5 \cdot 10^{-298}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

\mathbf{elif}\;a \leq 26000000000000:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -5.90000000000000029e63

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

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

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

      \[\leadsto \left(-1 \cdot \left(c \cdot \left(-1 \cdot j + \frac{t \cdot x}{c}\right)\right)\right) \cdot a \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(-1 \cdot j + \frac{t \cdot x}{c}\right)\right) \cdot a \]
      4. lower-neg.f64N/A

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

        \[\leadsto \left(\left(-c\right) \cdot \left(\left(\mathsf{neg}\left(j\right)\right) + \frac{t \cdot x}{c}\right)\right) \cdot a \]
      6. +-commutativeN/A

        \[\leadsto \left(\left(-c\right) \cdot \left(\frac{t \cdot x}{c} + \left(\mathsf{neg}\left(j\right)\right)\right)\right) \cdot a \]
      7. associate-/l*N/A

        \[\leadsto \left(\left(-c\right) \cdot \left(t \cdot \frac{x}{c} + \left(\mathsf{neg}\left(j\right)\right)\right)\right) \cdot a \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(-c\right) \cdot \mathsf{fma}\left(t, \frac{x}{c}, \mathsf{neg}\left(j\right)\right)\right) \cdot a \]
      9. lower-/.f64N/A

        \[\leadsto \left(\left(-c\right) \cdot \mathsf{fma}\left(t, \frac{x}{c}, \mathsf{neg}\left(j\right)\right)\right) \cdot a \]
      10. lower-neg.f6440.0

        \[\leadsto \left(\left(-c\right) \cdot \mathsf{fma}\left(t, \frac{x}{c}, -j\right)\right) \cdot a \]
    7. Applied rewrites40.0%

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

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

        \[\leadsto \left(\left(-c\right) \cdot \left(\frac{t \cdot x}{c} - j\right)\right) \cdot a \]
      2. associate-/l*N/A

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

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

        \[\leadsto \left(\left(-c\right) \cdot \left(\frac{x}{c} \cdot t - j\right)\right) \cdot a \]
      5. lift-/.f6440.0

        \[\leadsto \left(\left(-c\right) \cdot \left(\frac{x}{c} \cdot t - j\right)\right) \cdot a \]
    10. Applied rewrites40.0%

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

    if -5.90000000000000029e63 < a < -1.7599999999999999e-205

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.7

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

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

    if -1.7599999999999999e-205 < a < -5.4999999999999996e-298

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

    if -5.4999999999999996e-298 < a < 2.6e13

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot t\right) \cdot i \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot i \]
      6. associate-*r*N/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot y + b \cdot t\right) \cdot i \]
      8. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
      10. lower-*.f6439.3

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
    7. Applied rewrites39.3%

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

    if 2.6e13 < a

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

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

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

Alternative 8: 53.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -4 \cdot 10^{-183}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{-273}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{+105}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.80000000000000023e68 or 1.7e105 < t

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a \cdot x\right)\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t \]
      4. mul-1-negN/A

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot \color{blue}{t} \]
    7. Applied rewrites39.0%

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

    if -5.80000000000000023e68 < t < -4.00000000000000002e-183

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

    if -4.00000000000000002e-183 < t < 2.49999999999999983e-273

    1. Initial program 73.3%

      \[\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. *-commutativeN/A

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

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

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot c \]
      4. *-commutativeN/A

        \[\leadsto \left(j \cdot a - b \cdot z\right) \cdot c \]
      5. lower-*.f64N/A

        \[\leadsto \left(j \cdot a - b \cdot z\right) \cdot c \]
      6. lower-*.f6439.5

        \[\leadsto \left(j \cdot a - b \cdot z\right) \cdot c \]
    4. Applied rewrites39.5%

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

    if 2.49999999999999983e-273 < t < 1.7e105

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.7

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

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

Alternative 9: 52.4% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.29999999999999996e23 or 3.49999999999999998e34 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      2. +-commutativeN/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      3. associate-*r*N/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      4. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      6. *-commutativeN/A

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      8. lift--.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      12. lower-*.f6438.4

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    7. Applied rewrites38.4%

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

    if -1.29999999999999996e23 < x < 3.49999999999999998e34

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j + b \cdot \left(i \cdot t\right) \]
      3. *-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(i \cdot t\right) \cdot b\right) \]
      10. lower-*.f6450.9

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(i \cdot t\right) \cdot b\right) \]
    10. Applied rewrites50.9%

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

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

        \[\leadsto i \cdot \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) + a \cdot \left(c \cdot j\right) \]
      2. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(j \cdot y\right) + b \cdot t, i, a \cdot \left(c \cdot j\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(\left(-1 \cdot j\right) \cdot y + b \cdot t, i, a \cdot \left(c \cdot j\right)\right) \]
      5. mul-1-negN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-j, y, b \cdot t\right), i, \left(j \cdot c\right) \cdot a\right) \]
      12. lift-*.f6450.9

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-j, y, b \cdot t\right), i, \left(j \cdot c\right) \cdot a\right) \]
    13. Applied rewrites50.9%

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

Alternative 10: 52.1% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 5.8 \cdot 10^{-179}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.80000000000000023e68 or 3.0999999999999999e106 < t

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a \cdot x\right)\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t \]
      4. mul-1-negN/A

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot \color{blue}{t} \]
    7. Applied rewrites39.0%

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

    if -5.80000000000000023e68 < t < 5.7999999999999998e-179

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

    if 5.7999999999999998e-179 < t < 3.0999999999999999e106

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      2. *-commutativeN/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      5. lift--.f64N/A

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lift-*.f6439.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    10. Applied rewrites39.9%

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

Alternative 11: 51.8% accurate, 2.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4e90 or 2.35000000000000006e48 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      2. +-commutativeN/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      3. associate-*r*N/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      4. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      6. *-commutativeN/A

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      8. lift--.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      12. lower-*.f6438.4

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    7. Applied rewrites38.4%

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

    if -5.4e90 < x < 2.35000000000000006e48

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

Alternative 12: 51.7% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;x \leq 21:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25e26 or 21 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      2. +-commutativeN/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      3. associate-*r*N/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      4. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      6. *-commutativeN/A

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

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      8. lift--.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      12. lower-*.f6438.4

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    7. Applied rewrites38.4%

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

    if -1.25e26 < x < 21

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      2. *-commutativeN/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      5. lift--.f64N/A

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lift-*.f6439.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    10. Applied rewrites39.9%

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

Alternative 13: 41.4% accurate, 2.0× speedup?

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

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

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

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

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

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


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

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

      \[\leadsto \left(-1 \cdot \left(b \cdot c\right)\right) \cdot z \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot b\right) \cdot c\right) \cdot z \]
      2. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      3. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      4. lower-neg.f6422.6

        \[\leadsto \left(\left(-b\right) \cdot c\right) \cdot z \]
    7. Applied rewrites22.6%

      \[\leadsto \left(\left(-b\right) \cdot c\right) \cdot z \]

    if -1.75e130 < b < 4.8500000000000001e27

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      2. *-commutativeN/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      5. lift--.f64N/A

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lift-*.f6439.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    10. Applied rewrites39.9%

      \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]

    if 4.8500000000000001e27 < b

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6422.2

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

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

Alternative 14: 30.7% accurate, 1.5× speedup?

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

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

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

\\
\begin{array}{l}
t_1 := \left(\left(-i\right) \cdot y\right) \cdot j\\
t_2 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;b \leq -1 \cdot 10^{-6}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b \leq -3.1 \cdot 10^{-165}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\

\mathbf{elif}\;b \leq 2.7 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;b \leq 2.8 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -9.99999999999999955e-7 or 2.8000000000000002e25 < b

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6422.2

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

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

    if -9.99999999999999955e-7 < b < -3.09999999999999996e-165

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      2. lift-*.f6423.2

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

      \[\leadsto \left(j \cdot c\right) \cdot a \]

    if -3.09999999999999996e-165 < b < 2.69999999999999991e-238 or 1.8600000000000001e-149 < b < 2.8000000000000002e25

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      2. *-commutativeN/A

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

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      5. lift--.f64N/A

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lift-*.f6439.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    10. Applied rewrites39.9%

      \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    11. Taylor expanded in y around inf

      \[\leadsto \left(-1 \cdot \left(i \cdot y\right)\right) \cdot j \]
    12. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      2. mul-1-negN/A

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

        \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
      4. lower-*.f6422.2

        \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
    13. Applied rewrites22.2%

      \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]

    if 2.69999999999999991e-238 < b < 1.8600000000000001e-149

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

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

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

      \[\leadsto \left(-1 \cdot \left(t \cdot x\right)\right) \cdot a \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot x\right) \cdot a \]
      3. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x\right) \cdot a \]
      4. lift-neg.f6421.6

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

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

Alternative 15: 29.8% accurate, 2.1× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-82}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.6000000000000001e-82

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.7

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

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if -1.6000000000000001e-82 < y < -3.9999999999999997e-207

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      2. lift-*.f6423.2

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

      \[\leadsto \left(j \cdot c\right) \cdot a \]

    if -3.9999999999999997e-207 < y < 4.1500000000000002e-69

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6422.2

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

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

    if 4.1500000000000002e-69 < y

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

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

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

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

        \[\leadsto \left(-1 \cdot i\right) \cdot \left(j \cdot y\right) \]
      2. mul-1-negN/A

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      5. lower-*.f6422.6

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

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

Alternative 16: 29.3% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-82}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.6000000000000001e-82

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

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

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

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

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

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

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.7

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

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if -1.6000000000000001e-82 < y < -3.9999999999999997e-207

    1. Initial program 73.3%

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a} \]
    5. Taylor expanded in x around 0

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      2. lift-*.f6423.2

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    7. Applied rewrites23.2%

      \[\leadsto \left(j \cdot c\right) \cdot a \]

    if -3.9999999999999997e-207 < y < 4.1500000000000002e-69

    1. Initial program 73.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      4. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6422.2

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Applied rewrites22.2%

      \[\leadsto \left(i \cdot t\right) \cdot b \]

    if 4.1500000000000002e-69 < y

    1. Initial program 73.3%

      \[\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 0

      \[\leadsto \color{blue}{\left(j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right)\right) - b \cdot \left(c \cdot z\right)} \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \color{blue}{\left(\left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j + \left(\color{blue}{\left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right)} - b \cdot \left(c \cdot z\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j + \left(\left(\color{blue}{t} \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j + \left(\left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right)} + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, \color{blue}{j}, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      7. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      10. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
    4. Applied rewrites75.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot a - i \cdot y, j, \mathsf{fma}\left(\left(-a\right) \cdot x - \left(-i \cdot b\right), t, \left(z \cdot y\right) \cdot x\right) - \left(c \cdot b\right) \cdot z\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \color{blue}{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) + j \cdot \color{blue}{\left(a \cdot c - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) \cdot t + j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) \]
      3. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot t + j \cdot \left(\color{blue}{a} \cdot c - i \cdot y\right) \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - \left(-1 \cdot b\right) \cdot i\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a \cdot x\right)\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      7. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(b \cdot i\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right), t, j \cdot \left(a \cdot c - i \cdot y\right)\right) \]
    7. Applied rewrites61.5%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, x, i \cdot b\right), \color{blue}{t}, \left(c \cdot a - i \cdot y\right) \cdot j\right) \]
    8. Taylor expanded in t around 0

      \[\leadsto j \cdot \left(a \cdot c - \color{blue}{i \cdot y}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      2. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      3. *-commutativeN/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      5. lift--.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lift-*.f6439.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    10. Applied rewrites39.9%

      \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    11. Taylor expanded in y around inf

      \[\leadsto \left(-1 \cdot \left(i \cdot y\right)\right) \cdot j \]
    12. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      2. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      3. lift-neg.f64N/A

        \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
      4. lower-*.f6422.2

        \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
    13. Applied rewrites22.2%

      \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 17: 28.7% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+44}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{elif}\;z \leq 1.72 \cdot 10^{+21}:\\ \;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -3.4e+44)
   (* (* y x) z)
   (if (<= z 1.72e+21) (* (* (- t) x) a) (* (* (- c) z) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -3.4e+44) {
		tmp = (y * x) * z;
	} else if (z <= 1.72e+21) {
		tmp = (-t * x) * a;
	} else {
		tmp = (-c * z) * b;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (z <= (-3.4d+44)) then
        tmp = (y * x) * z
    else if (z <= 1.72d+21) then
        tmp = (-t * x) * a
    else
        tmp = (-c * z) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -3.4e+44) {
		tmp = (y * x) * z;
	} else if (z <= 1.72e+21) {
		tmp = (-t * x) * a;
	} else {
		tmp = (-c * z) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -3.4e+44:
		tmp = (y * x) * z
	elif z <= 1.72e+21:
		tmp = (-t * x) * a
	else:
		tmp = (-c * z) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -3.4e+44)
		tmp = Float64(Float64(y * x) * z);
	elseif (z <= 1.72e+21)
		tmp = Float64(Float64(Float64(-t) * x) * a);
	else
		tmp = Float64(Float64(Float64(-c) * z) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -3.4e+44)
		tmp = (y * x) * z;
	elseif (z <= 1.72e+21)
		tmp = (-t * x) * a;
	else
		tmp = (-c * z) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -3.4e+44], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.72e+21], N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+44}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

\mathbf{elif}\;z \leq 1.72 \cdot 10^{+21}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.4e44

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites22.0%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.7

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.7%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if -3.4e44 < z < 1.72e21

    1. Initial program 73.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right) \cdot \color{blue}{a} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right) \cdot \color{blue}{a} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot x + c \cdot j\right) \cdot a \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(t\right), x, c \cdot j\right) \cdot a \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, x, c \cdot j\right) \cdot a \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
    4. Applied rewrites39.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a} \]
    5. Taylor expanded in x around inf

      \[\leadsto \left(-1 \cdot \left(t \cdot x\right)\right) \cdot a \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot x\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot x\right) \cdot a \]
      3. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x\right) \cdot a \]
      4. lift-neg.f6421.6

        \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]
    7. Applied rewrites21.6%

      \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]

    if 1.72e21 < z

    1. Initial program 73.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      4. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around inf

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      3. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-neg.f6422.5

        \[\leadsto \left(\left(-c\right) \cdot z\right) \cdot b \]
    7. Applied rewrites22.5%

      \[\leadsto \left(\left(-c\right) \cdot z\right) \cdot b \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 28.3% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+20}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+55}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -4.2e+20)
   (* (* y x) z)
   (if (<= z 1.9e+55) (* (* i t) b) (* (* z y) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -4.2e+20) {
		tmp = (y * x) * z;
	} else if (z <= 1.9e+55) {
		tmp = (i * t) * b;
	} else {
		tmp = (z * y) * x;
	}
	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 <= (-4.2d+20)) then
        tmp = (y * x) * z
    else if (z <= 1.9d+55) then
        tmp = (i * t) * b
    else
        tmp = (z * y) * x
    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 <= -4.2e+20) {
		tmp = (y * x) * z;
	} else if (z <= 1.9e+55) {
		tmp = (i * t) * b;
	} else {
		tmp = (z * y) * x;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -4.2e+20:
		tmp = (y * x) * z
	elif z <= 1.9e+55:
		tmp = (i * t) * b
	else:
		tmp = (z * y) * x
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -4.2e+20)
		tmp = Float64(Float64(y * x) * z);
	elseif (z <= 1.9e+55)
		tmp = Float64(Float64(i * t) * b);
	else
		tmp = Float64(Float64(z * y) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -4.2e+20)
		tmp = (y * x) * z;
	elseif (z <= 1.9e+55)
		tmp = (i * t) * b;
	else
		tmp = (z * y) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -4.2e+20], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.9e+55], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+20}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+55}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2e20

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites22.0%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.7

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.7%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if -4.2e20 < z < 1.9e55

    1. Initial program 73.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      4. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
      5. lift-*.f6439.3

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.3%

      \[\leadsto \color{blue}{\left(i \cdot t - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6422.2

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Applied rewrites22.2%

      \[\leadsto \left(i \cdot t\right) \cdot b \]

    if 1.9e55 < z

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites22.0%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 28.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y \cdot x\right) \cdot z\\ \mathbf{if}\;z \leq -9.2 \cdot 10^{-69}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+176}:\\ \;\;\;\;\left(j \cdot c\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* y x) z)))
   (if (<= z -9.2e-69) t_1 (if (<= z 3.7e+176) (* (* j c) a) 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 = (y * x) * z;
	double tmp;
	if (z <= -9.2e-69) {
		tmp = t_1;
	} else if (z <= 3.7e+176) {
		tmp = (j * c) * a;
	} 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 = (y * x) * z
    if (z <= (-9.2d-69)) then
        tmp = t_1
    else if (z <= 3.7d+176) then
        tmp = (j * c) * a
    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 = (y * x) * z;
	double tmp;
	if (z <= -9.2e-69) {
		tmp = t_1;
	} else if (z <= 3.7e+176) {
		tmp = (j * c) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (y * x) * z
	tmp = 0
	if z <= -9.2e-69:
		tmp = t_1
	elif z <= 3.7e+176:
		tmp = (j * c) * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(y * x) * z)
	tmp = 0.0
	if (z <= -9.2e-69)
		tmp = t_1;
	elseif (z <= 3.7e+176)
		tmp = Float64(Float64(j * c) * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (y * x) * z;
	tmp = 0.0;
	if (z <= -9.2e-69)
		tmp = t_1;
	elseif (z <= 3.7e+176)
		tmp = (j * c) * a;
	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[(y * x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -9.2e-69], t$95$1, If[LessEqual[z, 3.7e+176], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot z\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.7 \cdot 10^{+176}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.2000000000000003e-69 or 3.6999999999999998e176 < z

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites22.0%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.7

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.7%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if -9.2000000000000003e-69 < z < 3.6999999999999998e176

    1. Initial program 73.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right) \cdot \color{blue}{a} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right) \cdot \color{blue}{a} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot x + c \cdot j\right) \cdot a \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + c \cdot j\right) \cdot a \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(t\right), x, c \cdot j\right) \cdot a \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, x, c \cdot j\right) \cdot a \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
      8. lower-*.f6439.6

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
    4. Applied rewrites39.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a} \]
    5. Taylor expanded in x around 0

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      2. lift-*.f6423.2

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    7. Applied rewrites23.2%

      \[\leadsto \left(j \cdot c\right) \cdot a \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 28.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(c \cdot a\right) \cdot j\\ \mathbf{if}\;a \leq -60000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{+83}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* c a) j)))
   (if (<= a -60000000.0) t_1 (if (<= a 8.8e+83) (* (* y x) z) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (c * a) * j;
	double tmp;
	if (a <= -60000000.0) {
		tmp = t_1;
	} else if (a <= 8.8e+83) {
		tmp = (y * x) * 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 = (c * a) * j
    if (a <= (-60000000.0d0)) then
        tmp = t_1
    else if (a <= 8.8d+83) then
        tmp = (y * x) * 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 = (c * a) * j;
	double tmp;
	if (a <= -60000000.0) {
		tmp = t_1;
	} else if (a <= 8.8e+83) {
		tmp = (y * x) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (c * a) * j
	tmp = 0
	if a <= -60000000.0:
		tmp = t_1
	elif a <= 8.8e+83:
		tmp = (y * x) * z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(c * a) * j)
	tmp = 0.0
	if (a <= -60000000.0)
		tmp = t_1;
	elseif (a <= 8.8e+83)
		tmp = Float64(Float64(y * x) * z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (c * a) * j;
	tmp = 0.0;
	if (a <= -60000000.0)
		tmp = t_1;
	elseif (a <= 8.8e+83)
		tmp = (y * x) * 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[(c * a), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[a, -60000000.0], t$95$1, If[LessEqual[a, 8.8e+83], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(c \cdot a\right) \cdot j\\
\mathbf{if}\;a \leq -60000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 8.8 \cdot 10^{+83}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6e7 or 8.79999999999999995e83 < a

    1. Initial program 73.3%

      \[\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 0

      \[\leadsto \color{blue}{\left(j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right)\right) - b \cdot \left(c \cdot z\right)} \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \color{blue}{\left(\left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j + \left(\color{blue}{\left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right)} - b \cdot \left(c \cdot z\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j + \left(\left(\color{blue}{t} \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j + \left(\left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right)} + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, \color{blue}{j}, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      7. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
      10. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z\right)\right) \]
    4. Applied rewrites75.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot a - i \cdot y, j, \mathsf{fma}\left(\left(-a\right) \cdot x - \left(-i \cdot b\right), t, \left(z \cdot y\right) \cdot x\right) - \left(c \cdot b\right) \cdot z\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \color{blue}{t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto t \cdot \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) + j \cdot \color{blue}{\left(a \cdot c - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) \cdot t + j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) \]
      3. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot t + j \cdot \left(\color{blue}{a} \cdot c - i \cdot y\right) \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - \left(-1 \cdot b\right) \cdot i\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a \cdot x\right)\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      7. distribute-lft-neg-outN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - -1 \cdot \left(b \cdot i\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(b \cdot i\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right)\right) \cdot t + j \cdot \left(a \cdot c - i \cdot y\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(a\right)\right) \cdot x - \left(\mathsf{neg}\left(i \cdot b\right)\right), t, j \cdot \left(a \cdot c - i \cdot y\right)\right) \]
    7. Applied rewrites61.5%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, x, i \cdot b\right), \color{blue}{t}, \left(c \cdot a - i \cdot y\right) \cdot j\right) \]
    8. Taylor expanded in t around 0

      \[\leadsto j \cdot \left(a \cdot c - \color{blue}{i \cdot y}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      2. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      3. *-commutativeN/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      5. lift--.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      6. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lift-*.f6439.9

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    10. Applied rewrites39.9%

      \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    11. Taylor expanded in y around 0

      \[\leadsto \left(a \cdot c\right) \cdot j \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot a\right) \cdot j \]
      2. lift-*.f6423.4

        \[\leadsto \left(c \cdot a\right) \cdot j \]
    13. Applied rewrites23.4%

      \[\leadsto \left(c \cdot a\right) \cdot j \]

    if -6e7 < a < 8.79999999999999995e83

    1. Initial program 73.3%

      \[\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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.1%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6422.0

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites22.0%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.7

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.7%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 21.7% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(y \cdot x\right) \cdot z \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* y x) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (y * x) * z;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = (y * x) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (y * x) * z;
}
def code(x, y, z, t, a, b, c, i, j):
	return (y * x) * z
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(y * x) * z)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (y * x) * z;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}

\\
\left(y \cdot x\right) \cdot z
\end{array}
Derivation
  1. Initial program 73.3%

    \[\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)} \]
  3. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
    2. lower-*.f64N/A

      \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
    3. lower--.f64N/A

      \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
    4. *-commutativeN/A

      \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
    5. lower-*.f64N/A

      \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
    6. *-commutativeN/A

      \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    7. lower-*.f6439.1

      \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
  4. Applied rewrites39.1%

    \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]
  5. Taylor expanded in x around inf

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    2. lower-*.f64N/A

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    3. *-commutativeN/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    4. lower-*.f6422.0

      \[\leadsto \left(z \cdot y\right) \cdot x \]
  7. Applied rewrites22.0%

    \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    2. lift-*.f64N/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    3. *-commutativeN/A

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    4. *-commutativeN/A

      \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
    5. associate-*r*N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    6. lower-*.f64N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    7. *-commutativeN/A

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    8. lower-*.f6421.7

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  9. Applied rewrites21.7%

    \[\leadsto \left(y \cdot x\right) \cdot z \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2025131 
(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)))))