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

Percentage Accurate: 73.5% → 82.3%
Time: 6.5s
Alternatives: 21
Speedup: 0.5×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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

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

Alternative 1: 82.3% accurate, 0.5× speedup?

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

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

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


\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 91.5%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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-*.f6444.9

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

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

Alternative 2: 82.3% 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}:\\ \;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\ \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 (* (- (* j a) (* b z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = ((j * a) - (b * z)) * c;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = ((j * a) - (b * z)) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = ((j * a) - (b * z)) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = ((j * a) - (b * z)) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(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[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $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}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\


\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 91.5%

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

      \[\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-*.f6444.9

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

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

Alternative 3: 64.6% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2e17

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.8

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites63.8%

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

    if 2e17 < x

    1. Initial program 73.9%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. 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)} \]
    3. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - t \cdot a\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 - b \cdot \left(c \cdot z - i \cdot t\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      10. *-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} \]
      11. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6467.3

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

      \[\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 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 63.8% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.2e17

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6463.8

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites63.8%

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

    if 2.2e17 < x

    1. Initial program 73.9%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. 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)} \]
    3. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - t \cdot a\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 - b \cdot \left(c \cdot z - i \cdot t\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      10. *-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} \]
      11. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6467.3

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

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

      \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6463.8

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

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

Alternative 5: 59.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(c \cdot z\right)\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_3 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+196}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-39}:\\
\;\;\;\;t\_1 + t\_2\\

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

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(-a, x \cdot t, t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.55000000000000005e196 or 1.25e64 < z

    1. Initial program 63.0%

      \[\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-*.f6467.3

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

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

    if -1.55000000000000005e196 < z < -1.25e-39

    1. Initial program 72.8%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-b\right) \cdot \color{blue}{\left(c \cdot z\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. lift-*.f6450.3

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

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

    if -1.25e-39 < z < 2.7e15

    1. Initial program 79.9%

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

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

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites59.9%

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

    if 2.7e15 < z < 1.25e64

    1. Initial program 77.8%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, -1 \cdot \left(b \cdot \left(c \cdot z\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right)\right) \]
      4. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
      5. lift-*.f6438.5

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
    9. Applied rewrites38.5%

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

Alternative 6: 58.5% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.80000000000000018e187 or 1.25e64 < z

    1. Initial program 62.9%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in 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-*.f6467.2

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

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

    if -1.80000000000000018e187 < z < 2.7e15

    1. Initial program 78.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) \]
    2. Taylor expanded in i around inf

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

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites55.7%

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

    if 2.7e15 < z < 1.25e64

    1. Initial program 77.8%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, -1 \cdot \left(b \cdot \left(c \cdot z\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right)\right) \]
      4. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
      5. lift-*.f6438.5

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
    9. Applied rewrites38.5%

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

Alternative 7: 56.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -3.8 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\

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

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

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


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

    1. Initial program 61.4%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      7. 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 \]
      8. fp-cancel-sign-sub-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
      13. lower-*.f6469.8

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
    6. Applied rewrites69.8%

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

    if -3.8000000000000001e157 < i < 4.59999999999999977e-219

    1. Initial program 77.5%

      \[\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 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)} \]
    3. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - t \cdot a\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 - b \cdot \left(c \cdot z - i \cdot t\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      10. *-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} \]
      11. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
      16. lower-*.f6461.9

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z - i \cdot t\right) \cdot b \]
    4. Applied rewrites61.9%

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

      \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-*.f6455.4

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

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

    if 4.59999999999999977e-219 < i < 2.3e12

    1. Initial program 79.7%

      \[\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-*.f6444.3

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

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

    if 2.3e12 < i

    1. Initial program 67.4%

      \[\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 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)} \]
    3. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(z \cdot y - t \cdot a\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 - b \cdot \left(c \cdot z - i \cdot t\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x - b \cdot \left(c \cdot z - i \cdot t\right) \]
      10. *-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} \]
      11. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      5. 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 \]
      6. fp-cancel-sign-sub-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, t, -j \cdot y\right) \cdot i \]
      11. lower-*.f6460.4

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

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

Alternative 8: 52.6% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i\\

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.3000000000000001e153

    1. Initial program 59.2%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot b\right) \cdot t\right) \cdot i \]
      7. 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 \]
      8. fp-cancel-sign-sub-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot t\right) \cdot i \]
      13. lower-*.f6448.6

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

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

    if -6.3000000000000001e153 < y < -4.8e-97

    1. Initial program 75.7%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, -1 \cdot \left(b \cdot \left(c \cdot z\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right)\right) \]
      4. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
      5. lift-*.f6437.2

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
    9. Applied rewrites37.2%

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

    if -4.8e-97 < y < 1.31999999999999994e-23

    1. Initial program 81.5%

      \[\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-*.f6446.7

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

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

    if 1.31999999999999994e-23 < y

    1. Initial program 66.9%

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

      \[\leadsto \color{blue}{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-*.f6458.2

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

      \[\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.2% accurate, 1.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -1.5200000000000001e33 or 3.30000000000000026e-58 < j

    1. Initial program 73.7%

      \[\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 j around inf

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot \color{blue}{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. lower-*.f64N/A

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

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

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6458.5

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites58.5%

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

    if -1.5200000000000001e33 < j < -2.0999999999999999e-180

    1. Initial program 73.6%

      \[\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-*.f6443.0

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

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

    if -2.0999999999999999e-180 < j < 3.30000000000000026e-58

    1. Initial program 73.2%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) \cdot \color{blue}{t} \]
      2. 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 \]
      3. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t \]
      14. lower-*.f6446.9

        \[\leadsto \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t \]
    6. Applied rewrites46.9%

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

Alternative 10: 48.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\ \mathbf{if}\;b \leq -1.8 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 4.7 \cdot 10^{+45}:\\ \;\;\;\;\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 (* (- (* i t) (* c z)) b)))
   (if (<= b -1.8e+22) t_1 (if (<= b 4.7e+45) (* (- (* 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 = ((i * t) - (c * z)) * b;
	double tmp;
	if (b <= -1.8e+22) {
		tmp = t_1;
	} else if (b <= 4.7e+45) {
		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 = ((i * t) - (c * z)) * b
    if (b <= (-1.8d+22)) then
        tmp = t_1
    else if (b <= 4.7d+45) 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 = ((i * t) - (c * z)) * b;
	double tmp;
	if (b <= -1.8e+22) {
		tmp = t_1;
	} else if (b <= 4.7e+45) {
		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 = ((i * t) - (c * z)) * b
	tmp = 0
	if b <= -1.8e+22:
		tmp = t_1
	elif b <= 4.7e+45:
		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(i * t) - Float64(c * z)) * b)
	tmp = 0.0
	if (b <= -1.8e+22)
		tmp = t_1;
	elseif (b <= 4.7e+45)
		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 = ((i * t) - (c * z)) * b;
	tmp = 0.0;
	if (b <= -1.8e+22)
		tmp = t_1;
	elseif (b <= 4.7e+45)
		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[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.8e+22], t$95$1, If[LessEqual[b, 4.7e+45], 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(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 4.7 \cdot 10^{+45}:\\
\;\;\;\;\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 b < -1.8e22 or 4.70000000000000002e45 < b

    1. Initial program 73.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) \]
    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-*.f6461.8

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

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

    if -1.8e22 < b < 4.70000000000000002e45

    1. Initial program 73.9%

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot \color{blue}{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. lower-*.f64N/A

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

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

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6445.2

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites45.2%

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

Alternative 11: 41.4% accurate, 2.0× speedup?

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

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

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

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

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

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


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

    1. Initial program 74.7%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      7. lower-*.f6437.3

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

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

    if -7.00000000000000001e76 < b < 4.3000000000000001e72

    1. Initial program 73.9%

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot \color{blue}{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. lower-*.f64N/A

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

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

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

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
      8. lower-*.f6444.0

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j \]
    4. Applied rewrites44.0%

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

    if 4.3000000000000001e72 < b

    1. Initial program 71.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) \]
    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-*.f6446.5

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right) \]
      3. lift-neg.f64N/A

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot \color{blue}{z}\right) \]
      5. lift-*.f6436.8

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
    7. Applied rewrites36.8%

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

Alternative 12: 29.8% accurate, 2.1× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1350000000000:\\
\;\;\;\;\left(-b\right) \cdot \left(c \cdot z\right)\\

\mathbf{elif}\;c \leq 1.7 \cdot 10^{-241}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.35e12

    1. Initial program 68.0%

      \[\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-*.f6446.4

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right) \]
      3. lift-neg.f64N/A

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot \color{blue}{z}\right) \]
      5. lift-*.f6435.5

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
    7. Applied rewrites35.5%

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

    if -1.35e12 < c < 1.6999999999999999e-241

    1. Initial program 80.6%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    6. Applied rewrites55.3%

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

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

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

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

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

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

    if 1.6999999999999999e-241 < c < 2.6999999999999999e73

    1. Initial program 78.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-*.f6434.7

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

      \[\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. mul-1-negN/A

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

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

        \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]
      4. lower-*.f6424.6

        \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]
    7. Applied rewrites24.6%

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

    if 2.6999999999999999e73 < c

    1. Initial program 62.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-*.f6446.3

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

      \[\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. lift-neg.f64N/A

        \[\leadsto \left(\left(-b\right) \cdot c\right) \cdot z \]
      4. lower-*.f6436.7

        \[\leadsto \left(\left(-b\right) \cdot c\right) \cdot z \]
    7. Applied rewrites36.7%

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

Alternative 13: 29.8% accurate, 2.6× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -95000000000:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

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

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


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

    1. Initial program 74.5%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6433.0

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      7. lower-*.f6433.5

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

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

    if -9.5e10 < b < 7.5000000000000002e27

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      8. lower-*.f6445.8

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

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

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

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      2. mul-1-negN/A

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

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
      4. lower-*.f6424.9

        \[\leadsto \left(\left(-a\right) \cdot t\right) \cdot x \]
    7. Applied rewrites24.9%

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

    if 7.5000000000000002e27 < b

    1. Initial program 71.6%

      \[\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-*.f6445.4

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right) \]
      3. lift-neg.f64N/A

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot \color{blue}{z}\right) \]
      5. lift-*.f6434.8

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

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

Alternative 14: 29.5% accurate, 2.6× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -95000000000:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

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

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


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

    1. Initial program 74.5%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6433.0

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      7. lower-*.f6433.5

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

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

    if -9.5e10 < b < 7.0000000000000004e27

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      8. lower-*.f6445.8

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

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \left(x \cdot t\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(\left(-a\right) \cdot x\right) \cdot t \]
      6. lift-neg.f64N/A

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot x\right) \cdot t \]
      11. mul-1-negN/A

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

        \[\leadsto \left(\left(-a\right) \cdot x\right) \cdot t \]
      13. lower-*.f6425.1

        \[\leadsto \left(\left(-a\right) \cdot x\right) \cdot t \]
    7. Applied rewrites25.1%

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

    if 7.0000000000000004e27 < b

    1. Initial program 71.6%

      \[\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-*.f6445.4

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right) \]
      3. lift-neg.f64N/A

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot \color{blue}{z}\right) \]
      5. lift-*.f6434.8

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

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

Alternative 15: 29.5% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;c \leq 1.8 \cdot 10^{+83}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.35e12 or 1.7999999999999999e83 < c

    1. Initial program 65.6%

      \[\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-*.f6446.5

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z\right) \]
      3. lift-neg.f64N/A

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

        \[\leadsto \left(-b\right) \cdot \left(c \cdot \color{blue}{z}\right) \]
      5. lift-*.f6436.3

        \[\leadsto \left(-b\right) \cdot \left(c \cdot z\right) \]
    7. Applied rewrites36.3%

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

    if -1.35e12 < c < 1.7999999999999999e83

    1. Initial program 79.4%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    6. Applied rewrites56.9%

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

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6425.0

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

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

Alternative 16: 29.3% accurate, 2.2× speedup?

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

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

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

\mathbf{elif}\;t \leq 1.66 \cdot 10^{-38}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.05e-108

    1. Initial program 70.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) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

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

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    6. Applied rewrites63.0%

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

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

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

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6428.7

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

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

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

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

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

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

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

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

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

    if -1.05e-108 < t < 7.9999999999999994e-129

    1. Initial program 79.7%

      \[\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-*.f6430.9

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

      \[\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-*.f6425.9

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

      \[\leadsto \left(j \cdot c\right) \cdot a \]

    if 7.9999999999999994e-129 < t < 1.66000000000000006e-38

    1. Initial program 81.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-*.f6443.7

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

      \[\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. lower-*.f6424.6

        \[\leadsto \left(y \cdot z\right) \cdot x \]
    7. Applied rewrites24.6%

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

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

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. associate-*l*N/A

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

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

        \[\leadsto y \cdot \left(x \cdot \color{blue}{z}\right) \]
      6. lower-*.f6425.6

        \[\leadsto y \cdot \left(x \cdot z\right) \]
    9. Applied rewrites25.6%

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

    if 1.66000000000000006e-38 < t

    1. Initial program 68.8%

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      9. lift--.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      10. fp-cancel-sub-sign-invN/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(y \cdot z - t \cdot a\right) \cdot x} + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - \color{blue}{i \cdot t}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      14. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z - t \cdot a}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Applied rewrites70.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around 0

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)} + a \cdot \left(c \cdot j\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1} \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{t \cdot x}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, \color{blue}{t} \cdot x, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, a \cdot \left(c \cdot j\right) + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(c \cdot j\right) \cdot a + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(c \cdot j, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      11. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-1 \cdot b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      14. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    6. Applied rewrites65.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right)} \]
    7. Taylor expanded in i around inf

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6431.7

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    9. Applied rewrites31.7%

      \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 17: 29.2% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+91}:\\ \;\;\;\;\left(y \cdot z\right) \cdot x\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+20}:\\ \;\;\;\;\left(i \cdot b\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -5.5e+91)
   (* (* y z) x)
   (if (<= z 1.15e+20) (* (* i b) t) (* y (* x z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -5.5e+91) {
		tmp = (y * z) * x;
	} else if (z <= 1.15e+20) {
		tmp = (i * b) * t;
	} else {
		tmp = y * (x * z);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (z <= (-5.5d+91)) then
        tmp = (y * z) * x
    else if (z <= 1.15d+20) then
        tmp = (i * b) * t
    else
        tmp = y * (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -5.5e+91) {
		tmp = (y * z) * x;
	} else if (z <= 1.15e+20) {
		tmp = (i * b) * t;
	} else {
		tmp = y * (x * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -5.5e+91:
		tmp = (y * z) * x
	elif z <= 1.15e+20:
		tmp = (i * b) * t
	else:
		tmp = y * (x * z)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -5.5e+91)
		tmp = Float64(Float64(y * z) * x);
	elseif (z <= 1.15e+20)
		tmp = Float64(Float64(i * b) * t);
	else
		tmp = Float64(y * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -5.5e+91)
		tmp = (y * z) * x;
	elseif (z <= 1.15e+20)
		tmp = (i * b) * t;
	else
		tmp = y * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -5.5e+91], N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.15e+20], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+91}:\\
\;\;\;\;\left(y \cdot z\right) \cdot x\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4999999999999998e91

    1. Initial program 62.2%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    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-*.f6466.9

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites66.9%

      \[\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. lower-*.f6438.9

        \[\leadsto \left(y \cdot z\right) \cdot x \]
    7. Applied rewrites38.9%

      \[\leadsto \left(y \cdot z\right) \cdot \color{blue}{x} \]

    if -5.4999999999999998e91 < z < 1.15e20

    1. Initial program 79.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. lift--.f64N/A

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      9. lift--.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      10. fp-cancel-sub-sign-invN/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(y \cdot z - t \cdot a\right) \cdot x} + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - \color{blue}{i \cdot t}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      14. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z - t \cdot a}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Applied rewrites80.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around 0

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)} + a \cdot \left(c \cdot j\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1} \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{t \cdot x}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, \color{blue}{t} \cdot x, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, a \cdot \left(c \cdot j\right) + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(c \cdot j\right) \cdot a + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(c \cdot j, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      11. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-1 \cdot b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      14. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    6. Applied rewrites64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right)} \]
    7. Taylor expanded in i around inf

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6425.5

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    9. Applied rewrites25.5%

      \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. *-commutativeN/A

        \[\leadsto b \cdot \left(i \cdot \color{blue}{t}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(b \cdot i\right) \cdot t \]
      5. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot t \]
      6. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      7. lower-*.f6424.7

        \[\leadsto \left(i \cdot b\right) \cdot t \]
    11. Applied rewrites24.7%

      \[\leadsto \left(i \cdot b\right) \cdot t \]

    if 1.15e20 < z

    1. Initial program 67.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-*.f6460.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites60.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. lower-*.f6435.3

        \[\leadsto \left(y \cdot z\right) \cdot x \]
    7. Applied rewrites35.3%

      \[\leadsto \left(y \cdot z\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. associate-*l*N/A

        \[\leadsto y \cdot \left(z \cdot \color{blue}{x}\right) \]
      4. *-commutativeN/A

        \[\leadsto y \cdot \left(x \cdot z\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(x \cdot \color{blue}{z}\right) \]
      6. lower-*.f6434.6

        \[\leadsto y \cdot \left(x \cdot z\right) \]
    9. Applied rewrites34.6%

      \[\leadsto y \cdot \left(x \cdot \color{blue}{z}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 28.3% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+20}:\\ \;\;\;\;\left(i \cdot b\right) \cdot t\\ \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 -5.5e+91) t_1 (if (<= z 1.15e+20) (* (* i b) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = y * (x * z);
	double tmp;
	if (z <= -5.5e+91) {
		tmp = t_1;
	} else if (z <= 1.15e+20) {
		tmp = (i * b) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (x * z)
    if (z <= (-5.5d+91)) then
        tmp = t_1
    else if (z <= 1.15d+20) then
        tmp = (i * b) * t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = y * (x * z);
	double tmp;
	if (z <= -5.5e+91) {
		tmp = t_1;
	} else if (z <= 1.15e+20) {
		tmp = (i * b) * t;
	} 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 <= -5.5e+91:
		tmp = t_1
	elif z <= 1.15e+20:
		tmp = (i * b) * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(y * Float64(x * z))
	tmp = 0.0
	if (z <= -5.5e+91)
		tmp = t_1;
	elseif (z <= 1.15e+20)
		tmp = Float64(Float64(i * b) * t);
	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 <= -5.5e+91)
		tmp = t_1;
	elseif (z <= 1.15e+20)
		tmp = (i * b) * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+91], t$95$1, If[LessEqual[z, 1.15e+20], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4999999999999998e91 or 1.15e20 < z

    1. Initial program 65.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) \]
    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-*.f6463.1

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites63.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. lower-*.f6436.9

        \[\leadsto \left(y \cdot z\right) \cdot x \]
    7. Applied rewrites36.9%

      \[\leadsto \left(y \cdot z\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. associate-*l*N/A

        \[\leadsto y \cdot \left(z \cdot \color{blue}{x}\right) \]
      4. *-commutativeN/A

        \[\leadsto y \cdot \left(x \cdot z\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(x \cdot \color{blue}{z}\right) \]
      6. lower-*.f6436.5

        \[\leadsto y \cdot \left(x \cdot z\right) \]
    9. Applied rewrites36.5%

      \[\leadsto y \cdot \left(x \cdot \color{blue}{z}\right) \]

    if -5.4999999999999998e91 < z < 1.15e20

    1. Initial program 79.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
      4. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. lift--.f64N/A

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      9. lift--.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      10. fp-cancel-sub-sign-invN/A

        \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(y \cdot z - t \cdot a\right) \cdot x} + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - \color{blue}{i \cdot t}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
      14. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z - t \cdot a}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. Applied rewrites80.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Taylor expanded in y around 0

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)} + a \cdot \left(c \cdot j\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1} \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{t \cdot x}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, \color{blue}{t} \cdot x, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, a \cdot \left(c \cdot j\right) + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(c \cdot j\right) \cdot a + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(c \cdot j, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      11. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-1 \cdot b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      14. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    6. Applied rewrites64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right)} \]
    7. Taylor expanded in i around inf

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lift-*.f6425.5

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    9. Applied rewrites25.5%

      \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. *-commutativeN/A

        \[\leadsto b \cdot \left(i \cdot \color{blue}{t}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(b \cdot i\right) \cdot t \]
      5. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot t \]
      6. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot t \]
      7. lower-*.f6424.7

        \[\leadsto \left(i \cdot b\right) \cdot t \]
    11. Applied rewrites24.7%

      \[\leadsto \left(i \cdot b\right) \cdot t \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 21.7% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(i \cdot t\right) \cdot b \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* i t) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (i * t) * b;
}
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 = (i * t) * b
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 (i * t) * b;
}
def code(x, y, z, t, a, b, c, i, j):
	return (i * t) * b
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(i * t) * b)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (i * t) * b;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]
\begin{array}{l}

\\
\left(i \cdot t\right) \cdot b
\end{array}
Derivation
  1. Initial program 73.5%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  2. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \color{blue}{\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. lift-*.f64N/A

      \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
    4. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. lift--.f64N/A

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    7. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    8. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    9. lift--.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    10. fp-cancel-sub-sign-invN/A

      \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    11. *-commutativeN/A

      \[\leadsto \left(\color{blue}{\left(y \cdot z - t \cdot a\right) \cdot x} + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - \color{blue}{i \cdot t}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    14. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z - t \cdot a}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    16. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    17. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    18. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  3. Applied rewrites74.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
  4. Taylor expanded in y around 0

    \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)} + a \cdot \left(c \cdot j\right)\right) \]
    2. mul-1-negN/A

      \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1} \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    3. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{t \cdot x}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    4. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, \color{blue}{t} \cdot x, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    6. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, a \cdot \left(c \cdot j\right) + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(c \cdot j\right) \cdot a + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    9. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(c \cdot j, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    10. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    11. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    12. associate-*r*N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-1 \cdot b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    13. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    14. lift-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    16. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
  6. Applied rewrites60.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right)} \]
  7. Taylor expanded in i around inf

    \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    2. lower-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    3. lift-*.f6421.7

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  9. Applied rewrites21.7%

    \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  10. Add Preprocessing

Alternative 20: 21.7% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(i \cdot b\right) \cdot t \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* i b) t))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (i * b) * t;
}
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 = (i * b) * t
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 (i * b) * t;
}
def code(x, y, z, t, a, b, c, i, j):
	return (i * b) * t
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(i * b) * t)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (i * b) * t;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}

\\
\left(i \cdot b\right) \cdot t
\end{array}
Derivation
  1. Initial program 73.5%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  2. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \color{blue}{\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. lift-*.f64N/A

      \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
    4. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. lift--.f64N/A

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    7. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    8. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    9. lift--.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    10. fp-cancel-sub-sign-invN/A

      \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    11. *-commutativeN/A

      \[\leadsto \left(\color{blue}{\left(y \cdot z - t \cdot a\right) \cdot x} + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - \color{blue}{i \cdot t}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    14. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z - t \cdot a}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    16. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    17. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    18. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  3. Applied rewrites74.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
  4. Taylor expanded in y around 0

    \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)} + a \cdot \left(c \cdot j\right)\right) \]
    2. mul-1-negN/A

      \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1} \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    3. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{t \cdot x}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    4. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, \color{blue}{t} \cdot x, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    6. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, a \cdot \left(c \cdot j\right) + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(c \cdot j\right) \cdot a + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    9. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(c \cdot j, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    10. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    11. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    12. associate-*r*N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-1 \cdot b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    13. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    14. lift-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    16. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
  6. Applied rewrites60.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right)} \]
  7. Taylor expanded in i around inf

    \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    2. lower-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    3. lift-*.f6421.7

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  9. Applied rewrites21.7%

    \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    2. lift-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    3. *-commutativeN/A

      \[\leadsto b \cdot \left(i \cdot \color{blue}{t}\right) \]
    4. associate-*r*N/A

      \[\leadsto \left(b \cdot i\right) \cdot t \]
    5. lower-*.f64N/A

      \[\leadsto \left(b \cdot i\right) \cdot t \]
    6. *-commutativeN/A

      \[\leadsto \left(i \cdot b\right) \cdot t \]
    7. lower-*.f6421.5

      \[\leadsto \left(i \cdot b\right) \cdot t \]
  11. Applied rewrites21.5%

    \[\leadsto \left(i \cdot b\right) \cdot t \]
  12. Add Preprocessing

Alternative 21: 21.5% accurate, 5.9× speedup?

\[\begin{array}{l} \\ i \cdot \left(b \cdot t\right) \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* i (* b t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return i * (b * t);
}
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 = i * (b * t)
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 i * (b * t);
}
def code(x, y, z, t, a, b, c, i, j):
	return i * (b * t)
function code(x, y, z, t, a, b, c, i, j)
	return Float64(i * Float64(b * t))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = i * (b * t);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(i * N[(b * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
i \cdot \left(b \cdot t\right)
\end{array}
Derivation
  1. Initial program 73.5%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  2. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \color{blue}{\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. lift-*.f64N/A

      \[\leadsto \left(\color{blue}{x \cdot \left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    3. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(\color{blue}{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) \]
    4. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. lift--.f64N/A

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z - t \cdot a\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    7. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    8. lift-*.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    9. lift--.f64N/A

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    10. fp-cancel-sub-sign-invN/A

      \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    11. *-commutativeN/A

      \[\leadsto \left(\color{blue}{\left(y \cdot z - t \cdot a\right) \cdot x} + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - \color{blue}{i \cdot t}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
    14. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z - t \cdot a}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    16. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y} - t \cdot a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    17. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    18. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot y - \color{blue}{a \cdot t}, x, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  3. Applied rewrites74.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right) \]
  4. Taylor expanded in y around 0

    \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)} + a \cdot \left(c \cdot j\right)\right) \]
    2. mul-1-negN/A

      \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) + \left(\color{blue}{-1} \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    3. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{t \cdot x}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    4. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, \color{blue}{t} \cdot x, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    6. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot \color{blue}{t}, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right) + a \cdot \left(c \cdot j\right)\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, a \cdot \left(c \cdot j\right) + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \left(c \cdot j\right) \cdot a + -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    9. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(c \cdot j, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    10. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    11. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, -1 \cdot \left(b \cdot \left(c \cdot z - i \cdot t\right)\right)\right)\right) \]
    12. associate-*r*N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-1 \cdot b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    13. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    14. lift-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(-b\right) \cdot \left(c \cdot z - i \cdot t\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
    16. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right) \]
  6. Applied rewrites60.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(j \cdot c, a, \left(c \cdot z - i \cdot t\right) \cdot \left(-b\right)\right)\right)} \]
  7. Taylor expanded in i around inf

    \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    2. lower-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    3. lift-*.f6421.7

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  9. Applied rewrites21.7%

    \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    2. lift-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    3. associate-*l*N/A

      \[\leadsto i \cdot \left(t \cdot \color{blue}{b}\right) \]
    4. *-commutativeN/A

      \[\leadsto i \cdot \left(b \cdot t\right) \]
    5. lower-*.f64N/A

      \[\leadsto i \cdot \left(b \cdot \color{blue}{t}\right) \]
    6. lower-*.f6421.7

      \[\leadsto i \cdot \left(b \cdot t\right) \]
  11. Applied rewrites21.7%

    \[\leadsto i \cdot \left(b \cdot \color{blue}{t}\right) \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2025119 
(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)))))