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

Percentage Accurate: 72.8% → 81.1%
Time: 8.1s
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}

Sampling outcomes in binary64 precision:

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


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

    1. Initial program 88.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. Add Preprocessing

    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. Add Preprocessing
    3. Taylor expanded in t around -inf

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lower-neg.f6437.5

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{y}\right) \]
      4. lift-neg.f6452.2

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(-i\right) \cdot y\right) \]
    8. Applied rewrites52.2%

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

Alternative 2: 69.8% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 74.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. Add Preprocessing
    3. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.32e13 < b < 2.0000000000000001e-115

    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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(j \cdot y\right) + \left(\left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + j \cdot c\right) \cdot a + \left(z \cdot y\right) \cdot x\right) \]
    8. Applied rewrites71.7%

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

    if 2.0000000000000001e-115 < b

    1. Initial program 75.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -13200000000000:\\ \;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot c\right) \cdot a\right) - \mathsf{fma}\left(-i, t, c \cdot z\right) \cdot b\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-115}:\\ \;\;\;\;\mathsf{fma}\left(\left(-i\right) \cdot j, y, \mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 69.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;j \leq -2.9 \cdot 10^{+93} \lor \neg \left(j \leq 0.0001\right):\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= j -2.9e+93) (not (<= j 0.0001)))
   (+ (* (- t) (fma a x (* (- b) i))) (* j (- (* c a) (* y i))))
   (fma (fma (- a) t (* z y)) x (* (- b) (fma (- i) t (* 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 ((j <= -2.9e+93) || !(j <= 0.0001)) {
		tmp = (-t * fma(a, x, (-b * i))) + (j * ((c * a) - (y * i)));
	} else {
		tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-i, t, (c * z))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((j <= -2.9e+93) || !(j <= 0.0001))
		tmp = Float64(Float64(Float64(-t) * fma(a, x, Float64(Float64(-b) * i))) + Float64(j * Float64(Float64(c * a) - Float64(y * i))));
	else
		tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-i), t, Float64(c * z))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -2.9e+93], N[Not[LessEqual[j, 0.0001]], $MachinePrecision]], N[(N[((-t) * N[(a * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.9 \cdot 10^{+93} \lor \neg \left(j \leq 0.0001\right):\\
\;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -2.8999999999999998e93 or 1.00000000000000005e-4 < j

    1. Initial program 70.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. Add Preprocessing
    3. Taylor expanded in t around -inf

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lower-neg.f6472.7

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

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

    if -2.8999999999999998e93 < j < 1.00000000000000005e-4

    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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -2.9 \cdot 10^{+93} \lor \neg \left(j \leq 0.0001\right):\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.9 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -2.8999999999999998e93

    1. Initial program 67.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. Add Preprocessing
    3. Taylor expanded in j around inf

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

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

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j \]
      7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      16. lift-*.f6466.5

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

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

    if -2.8999999999999998e93 < j < 8.5000000000000006e138

    1. Initial program 72.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000006e138 < j

    1. Initial program 76.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. Add Preprocessing
    3. Taylor expanded in t around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{y}\right) \]
      4. lift-neg.f6475.1

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

      \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \color{blue}{\left(\left(-i\right) \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -2.9 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\ \mathbf{elif}\;j \leq 8.5 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(-i\right) \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 58.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -4.2 \cdot 10^{-55} \lor \neg \left(i \leq 1450000000000\right):\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(-i\right) \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= i -4.2e-55) (not (<= i 1450000000000.0)))
   (+ (* (- t) (fma a x (* (- b) i))) (* j (* (- i) y)))
   (fma (fma (- a) t (* z y)) 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 ((i <= -4.2e-55) || !(i <= 1450000000000.0)) {
		tmp = (-t * fma(a, x, (-b * i))) + (j * (-i * y));
	} else {
		tmp = fma(fma(-a, t, (z * y)), x, (-b * (c * z)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((i <= -4.2e-55) || !(i <= 1450000000000.0))
		tmp = Float64(Float64(Float64(-t) * fma(a, x, Float64(Float64(-b) * i))) + Float64(j * Float64(Float64(-i) * y)));
	else
		tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * Float64(c * z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -4.2e-55], N[Not[LessEqual[i, 1450000000000.0]], $MachinePrecision]], N[(N[((-t) * N[(a * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[((-i) * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.2 \cdot 10^{-55} \lor \neg \left(i \leq 1450000000000\right):\\
\;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(-i\right) \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.2000000000000003e-55 or 1.45e12 < i

    1. Initial program 59.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. Add Preprocessing
    3. Taylor expanded in t around -inf

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lower-neg.f6466.5

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{y}\right) \]
      4. lift-neg.f6468.8

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

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

    if -4.2000000000000003e-55 < i < 1.45e12

    1. Initial program 83.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
    7. Step-by-step derivation
      1. lift-*.f6471.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -4.2 \cdot 10^{-55} \lor \neg \left(i \leq 1450000000000\right):\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) + j \cdot \left(\left(-i\right) \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 56.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;i \leq 3.8 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -5.7000000000000002e-55

    1. Initial program 64.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(b, t, \frac{\left(-b\right) \cdot \left(c \cdot z\right)}{i}\right) \cdot i\right) \]
      11. lift-*.f6460.6

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(b, t, \frac{\left(-b\right) \cdot \left(c \cdot z\right)}{i}\right) \cdot i\right) \]
    8. Applied rewrites60.6%

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right) \]
    10. Step-by-step derivation
      1. lower-*.f6459.0

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right) \]
    11. Applied rewrites59.0%

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

    if -5.7000000000000002e-55 < i < 3.80000000000000002e33

    1. Initial program 83.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \left(c \cdot z\right)\right) \]
    7. Step-by-step derivation
      1. lift-*.f6471.7

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

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

    if 3.80000000000000002e33 < i

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in i around -inf

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(b\right)\right) \cdot t\right) \]
      8. lower-neg.f6461.1

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(\mathsf{fma}\left(j, \frac{y}{t}, \mathsf{neg}\left(b\right)\right) \cdot t\right) \]
      8. lift-neg.f6462.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5.7 \cdot 10^{-55}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right)\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+33}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-i\right) \cdot \left(\mathsf{fma}\left(j, \frac{y}{t}, -b\right) \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.9 \cdot 10^{+123} \lor \neg \left(c \leq 1.9 \cdot 10^{+148}\right):\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= c -2.9e+123) (not (<= c 1.9e+148)))
   (* (fma j a (* (- b) z)) c)
   (fma (fma (- a) t (* z y)) x (* (* b t) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((c <= -2.9e+123) || !(c <= 1.9e+148)) {
		tmp = fma(j, a, (-b * z)) * c;
	} else {
		tmp = fma(fma(-a, t, (z * y)), x, ((b * t) * i));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((c <= -2.9e+123) || !(c <= 1.9e+148))
		tmp = Float64(fma(j, a, Float64(Float64(-b) * z)) * c);
	else
		tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(b * t) * i));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[c, -2.9e+123], N[Not[LessEqual[c, 1.9e+148]], $MachinePrecision]], N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.9 \cdot 10^{+123} \lor \neg \left(c \leq 1.9 \cdot 10^{+148}\right):\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.9000000000000001e123 or 1.8999999999999999e148 < c

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6483.3

        \[\leadsto \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c \]
    5. Applied rewrites83.3%

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

    if -2.9000000000000001e123 < c < 1.8999999999999999e148

    1. Initial program 74.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(b, t, \frac{\left(-b\right) \cdot \left(c \cdot z\right)}{i}\right) \cdot i\right) \]
      11. lift-*.f6457.0

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(b, t, \frac{\left(-b\right) \cdot \left(c \cdot z\right)}{i}\right) \cdot i\right) \]
    8. Applied rewrites57.0%

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right) \]
    10. Step-by-step derivation
      1. lower-*.f6455.4

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right) \]
    11. Applied rewrites55.4%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.9 \cdot 10^{+123} \lor \neg \left(c \leq 1.9 \cdot 10^{+148}\right):\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(b \cdot t\right) \cdot i\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 42.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+97}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\

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

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

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


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

    1. Initial program 56.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. Add Preprocessing
    3. Taylor expanded in i around -inf

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(b\right)\right) \cdot t\right) \]
      8. lower-neg.f6455.0

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

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

      \[\leadsto \left(-i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
    7. Step-by-step derivation
      1. lower-*.f6448.0

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

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

    if -2.2000000000000001e97 < y < -1.10000000000000002e-212

    1. Initial program 77.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. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6455.2

        \[\leadsto \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c \]
    5. Applied rewrites55.2%

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

    if -1.10000000000000002e-212 < y < 3.15e90

    1. Initial program 78.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6449.8

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites49.8%

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

    if 3.15e90 < y

    1. Initial program 61.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    7. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) \cdot z \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot b\right) \cdot c + x \cdot y\right) \cdot z \]
      8. mul-1-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
      12. lower-*.f6455.3

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
    8. Applied rewrites55.3%

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

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f6447.7

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    11. Applied rewrites47.7%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+97}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-212}:\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{+90}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 29.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y \cdot x\right) \cdot z\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-184}:\\ \;\;\;\;\left(j \cdot a\right) \cdot c\\ \mathbf{elif}\;y \leq 4400000000000:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+85}:\\ \;\;\;\;\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 (* (* y x) z)))
   (if (<= y -2.6e+25)
     t_1
     (if (<= y -2.05e-184)
       (* (* j a) c)
       (if (<= y 4400000000000.0)
         (* (* (- c) z) b)
         (if (<= y 1.9e+85) (* (* 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 = (y * x) * z;
	double tmp;
	if (y <= -2.6e+25) {
		tmp = t_1;
	} else if (y <= -2.05e-184) {
		tmp = (j * a) * c;
	} else if (y <= 4400000000000.0) {
		tmp = (-c * z) * b;
	} else if (y <= 1.9e+85) {
		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 = (y * x) * z
    if (y <= (-2.6d+25)) then
        tmp = t_1
    else if (y <= (-2.05d-184)) then
        tmp = (j * a) * c
    else if (y <= 4400000000000.0d0) then
        tmp = (-c * z) * b
    else if (y <= 1.9d+85) 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 = (y * x) * z;
	double tmp;
	if (y <= -2.6e+25) {
		tmp = t_1;
	} else if (y <= -2.05e-184) {
		tmp = (j * a) * c;
	} else if (y <= 4400000000000.0) {
		tmp = (-c * z) * b;
	} else if (y <= 1.9e+85) {
		tmp = (i * t) * b;
	} 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 y <= -2.6e+25:
		tmp = t_1
	elif y <= -2.05e-184:
		tmp = (j * a) * c
	elif y <= 4400000000000.0:
		tmp = (-c * z) * b
	elif y <= 1.9e+85:
		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(y * x) * z)
	tmp = 0.0
	if (y <= -2.6e+25)
		tmp = t_1;
	elseif (y <= -2.05e-184)
		tmp = Float64(Float64(j * a) * c);
	elseif (y <= 4400000000000.0)
		tmp = Float64(Float64(Float64(-c) * z) * b);
	elseif (y <= 1.9e+85)
		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 = (y * x) * z;
	tmp = 0.0;
	if (y <= -2.6e+25)
		tmp = t_1;
	elseif (y <= -2.05e-184)
		tmp = (j * a) * c;
	elseif (y <= 4400000000000.0)
		tmp = (-c * z) * b;
	elseif (y <= 1.9e+85)
		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[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[y, -2.6e+25], t$95$1, If[LessEqual[y, -2.05e-184], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 4400000000000.0], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[y, 1.9e+85], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.05 \cdot 10^{-184}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\

\mathbf{elif}\;y \leq 4400000000000:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+85}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.5999999999999998e25 or 1.89999999999999996e85 < y

    1. Initial program 60.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    7. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) \cdot z \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot b\right) \cdot c + x \cdot y\right) \cdot z \]
      8. mul-1-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
      12. lower-*.f6451.8

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
    8. Applied rewrites51.8%

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

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f6443.3

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    11. Applied rewrites43.3%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if -2.5999999999999998e25 < y < -2.05e-184

    1. Initial program 78.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. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6458.6

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

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

      \[\leadsto \left(a \cdot j\right) \cdot c \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(j \cdot a\right) \cdot c \]
    8. Applied rewrites39.6%

      \[\leadsto \left(j \cdot a\right) \cdot c \]

    if -2.05e-184 < y < 4.4e12

    1. Initial program 80.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6452.3

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites52.3%

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(c \cdot z\right)\right) \cdot b \]
      2. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lift-neg.f6434.5

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

      \[\leadsto \left(\left(-c\right) \cdot z\right) \cdot b \]

    if 4.4e12 < y < 1.89999999999999996e85

    1. Initial program 72.2%

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

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6439.1

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites39.1%

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6435.1

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    8. Applied rewrites35.1%

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  3. Recombined 4 regimes into one program.
  4. Final simplification38.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+25}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-184}:\\ \;\;\;\;\left(j \cdot a\right) \cdot c\\ \mathbf{elif}\;y \leq 4400000000000:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+85}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 52.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+38} \lor \neg \left(z \leq 1.38 \cdot 10^{-6}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(-b, i, a \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= z -6.4e+38) (not (<= z 1.38e-6)))
   (* (fma y x (* (- b) c)) z)
   (* (- t) (fma (- b) i (* a x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((z <= -6.4e+38) || !(z <= 1.38e-6)) {
		tmp = fma(y, x, (-b * c)) * z;
	} else {
		tmp = -t * fma(-b, i, (a * x));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((z <= -6.4e+38) || !(z <= 1.38e-6))
		tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z);
	else
		tmp = Float64(Float64(-t) * fma(Float64(-b), i, Float64(a * x)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -6.4e+38], N[Not[LessEqual[z, 1.38e-6]], $MachinePrecision]], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[((-t) * N[((-b) * i + N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+38} \lor \neg \left(z \leq 1.38 \cdot 10^{-6}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.3999999999999997e38 or 1.3799999999999999e-6 < z

    1. Initial program 59.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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      7. lower-neg.f6470.9

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

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

    if -6.3999999999999997e38 < z < 1.3799999999999999e-6

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      5. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+38} \lor \neg \left(z \leq 1.38 \cdot 10^{-6}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(-b, i, a \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 52.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+38} \lor \neg \left(z \leq 1.38 \cdot 10^{-6}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= z -6.4e+38) (not (<= z 1.38e-6)))
   (* (fma y x (* (- b) c)) z)
   (* (fma (- a) x (* i b)) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((z <= -6.4e+38) || !(z <= 1.38e-6)) {
		tmp = fma(y, x, (-b * c)) * z;
	} else {
		tmp = fma(-a, x, (i * b)) * t;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((z <= -6.4e+38) || !(z <= 1.38e-6))
		tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z);
	else
		tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -6.4e+38], N[Not[LessEqual[z, 1.38e-6]], $MachinePrecision]], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+38} \lor \neg \left(z \leq 1.38 \cdot 10^{-6}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.3999999999999997e38 or 1.3799999999999999e-6 < z

    1. Initial program 59.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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      7. lower-neg.f6470.9

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

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

    if -6.3999999999999997e38 < z < 1.3799999999999999e-6

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+38} \lor \neg \left(z \leq 1.38 \cdot 10^{-6}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 52.9% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.235 \lor \neg \left(x \leq 3.4 \cdot 10^{+52}\right):\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= x -0.235) (not (<= x 3.4e+52)))
   (* (fma (- a) t (* z y)) x)
   (* (fma i t (* (- c) z)) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((x <= -0.235) || !(x <= 3.4e+52)) {
		tmp = fma(-a, t, (z * y)) * x;
	} else {
		tmp = fma(i, t, (-c * z)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((x <= -0.235) || !(x <= 3.4e+52))
		tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x);
	else
		tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[x, -0.235], N[Not[LessEqual[x, 3.4e+52]], $MachinePrecision]], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.235 \lor \neg \left(x \leq 3.4 \cdot 10^{+52}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.23499999999999999 or 3.4e52 < x

    1. Initial program 71.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. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6463.8

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites63.8%

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

    if -0.23499999999999999 < x < 3.4e52

    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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6448.6

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.235 \lor \neg \left(x \leq 3.4 \cdot 10^{+52}\right):\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 46.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+98} \lor \neg \left(z \leq 1.2 \cdot 10^{-15}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= z -1.5e+98) (not (<= z 1.2e-15)))
   (* (fma y x (* (- b) c)) z)
   (* (fma i t (* (- c) z)) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((z <= -1.5e+98) || !(z <= 1.2e-15)) {
		tmp = fma(y, x, (-b * c)) * z;
	} else {
		tmp = fma(i, t, (-c * z)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((z <= -1.5e+98) || !(z <= 1.2e-15))
		tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z);
	else
		tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -1.5e+98], N[Not[LessEqual[z, 1.2e-15]], $MachinePrecision]], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+98} \lor \neg \left(z \leq 1.2 \cdot 10^{-15}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5000000000000001e98 or 1.19999999999999997e-15 < z

    1. Initial program 59.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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      7. lower-neg.f6473.5

        \[\leadsto \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z \]
    5. Applied rewrites73.5%

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

    if -1.5000000000000001e98 < z < 1.19999999999999997e-15

    1. Initial program 80.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+98} \lor \neg \left(z \leq 1.2 \cdot 10^{-15}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 29.9% accurate, 2.0× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+75}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\

\mathbf{elif}\;t \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{+34}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.10000000000000037e75

    1. Initial program 58.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. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6463.8

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites63.8%

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

      \[\leadsto \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x \]
    7. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      4. lift-neg.f6460.7

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

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

    if -5.10000000000000037e75 < t < 2.9e-11

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6446.6

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

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(c \cdot z\right)\right) \cdot b \]
      2. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lift-neg.f6434.7

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

      \[\leadsto \left(\left(-c\right) \cdot z\right) \cdot b \]

    if 2.9e-11 < t < 7.49999999999999976e34

    1. Initial program 56.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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right)} \]
    4. 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-*.f6472.7

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

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      2. lift-*.f6470.6

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    8. Applied rewrites70.6%

      \[\leadsto \left(j \cdot c\right) \cdot a \]

    if 7.49999999999999976e34 < t

    1. Initial program 63.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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right)} \]
    4. 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-*.f6451.3

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
    5. Applied rewrites51.3%

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x\right) \cdot a \]
      4. lift-neg.f6441.8

        \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]
    8. Applied rewrites41.8%

      \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification42.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.1 \cdot 10^{+75}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-11}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+34}:\\ \;\;\;\;\left(j \cdot c\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 29.6% accurate, 2.0× speedup?

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

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

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

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

\mathbf{elif}\;t \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

\mathbf{elif}\;t \leq 8 \cdot 10^{+108}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.10000000000000037e75 or 8.0000000000000003e108 < t

    1. Initial program 58.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. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6455.6

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites55.6%

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

      \[\leadsto \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x \]
    7. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      4. lift-neg.f6449.4

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

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

    if -5.10000000000000037e75 < t < 2.9e-11

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6446.6

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

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(c \cdot z\right)\right) \cdot b \]
      2. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lift-neg.f6434.7

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

      \[\leadsto \left(\left(-c\right) \cdot z\right) \cdot b \]

    if 2.9e-11 < t < 8.0000000000000003e108

    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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right)} \]
    4. 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-*.f6454.3

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
    5. Applied rewrites54.3%

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

      \[\leadsto \left(c \cdot j\right) \cdot a \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      2. lift-*.f6442.6

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    8. Applied rewrites42.6%

      \[\leadsto \left(j \cdot c\right) \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.1 \cdot 10^{+75}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-11}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+108}:\\ \;\;\;\;\left(j \cdot c\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+150}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.20000000000000028e150

    1. Initial program 63.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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) + c \cdot j\right)} \]
    4. 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-*.f6449.8

        \[\leadsto \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a \]
    5. Applied rewrites49.8%

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x\right) \cdot a \]
      4. lift-neg.f6450.0

        \[\leadsto \left(\left(-t\right) \cdot x\right) \cdot a \]
    8. Applied rewrites50.0%

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

    if -6.20000000000000028e150 < x < 4.1999999999999997e179

    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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6446.6

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

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

    if 4.1999999999999997e179 < x

    1. Initial program 77.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      5. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(-b, i, a \cdot x\right) \]
      13. lower-*.f6463.0

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(-b, i, a \cdot x\right) \]
    8. Applied rewrites63.0%

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

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

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

      \[\leadsto \left(-t\right) \cdot \left(a \cdot \color{blue}{x}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+150}:\\ \;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 29.6% accurate, 2.4× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.05 \cdot 10^{+93}:\\
\;\;\;\;\left(\left(-b\right) \cdot z\right) \cdot c\\

\mathbf{elif}\;c \leq 2.05 \cdot 10^{+89}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6482.3

        \[\leadsto \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c \]
    5. Applied rewrites82.3%

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

      \[\leadsto \left(-1 \cdot \left(b \cdot z\right)\right) \cdot c \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(b \cdot z\right)\right) \cdot c \]
      2. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      4. lift-neg.f6459.1

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

      \[\leadsto \left(\left(-b\right) \cdot z\right) \cdot c \]

    if -1.0499999999999999e93 < c < 2.04999999999999993e89

    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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    7. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) \cdot z \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot b\right) \cdot c + x \cdot y\right) \cdot z \]
      8. mul-1-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
      12. lower-*.f6436.4

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
    8. Applied rewrites36.4%

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

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f6426.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    11. Applied rewrites26.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if 2.04999999999999993e89 < c

    1. Initial program 74.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6465.4

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites65.4%

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

      \[\leadsto \left(-1 \cdot \left(c \cdot z\right)\right) \cdot b \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(c \cdot z\right)\right) \cdot b \]
      2. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lift-neg.f6451.1

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

      \[\leadsto \left(\left(-c\right) \cdot z\right) \cdot b \]
  3. Recombined 3 regimes into one program.
  4. Final simplification35.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.05 \cdot 10^{+93}:\\ \;\;\;\;\left(\left(-b\right) \cdot z\right) \cdot c\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{+89}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 30.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+98} \lor \neg \left(z \leq 1.1 \cdot 10^{-15}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \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 (or (<= z -1.5e+98) (not (<= z 1.1e-15))) (* (* z y) x) (* (* 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 ((z <= -1.5e+98) || !(z <= 1.1e-15)) {
		tmp = (z * y) * x;
	} 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 ((z <= (-1.5d+98)) .or. (.not. (z <= 1.1d-15))) then
        tmp = (z * y) * x
    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 ((z <= -1.5e+98) || !(z <= 1.1e-15)) {
		tmp = (z * y) * x;
	} else {
		tmp = (i * t) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (z <= -1.5e+98) or not (z <= 1.1e-15):
		tmp = (z * y) * x
	else:
		tmp = (i * t) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((z <= -1.5e+98) || !(z <= 1.1e-15))
		tmp = Float64(Float64(z * y) * x);
	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 ((z <= -1.5e+98) || ~((z <= 1.1e-15)))
		tmp = (z * y) * x;
	else
		tmp = (i * t) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -1.5e+98], N[Not[LessEqual[z, 1.1e-15]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+98} \lor \neg \left(z \leq 1.1 \cdot 10^{-15}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5000000000000001e98 or 1.09999999999999993e-15 < z

    1. Initial program 59.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. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6454.1

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites54.1%

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

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f6440.8

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

      \[\leadsto \left(z \cdot y\right) \cdot x \]

    if -1.5000000000000001e98 < z < 1.09999999999999993e-15

    1. Initial program 80.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6427.3

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+98} \lor \neg \left(z \leq 1.1 \cdot 10^{-15}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 29.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{+163} \lor \neg \left(b \leq 5.2 \cdot 10^{+63}\right):\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot a\right) \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= b -1.45e+163) (not (<= b 5.2e+63))) (* (* i t) b) (* (* j a) c)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((b <= -1.45e+163) || !(b <= 5.2e+63)) {
		tmp = (i * t) * b;
	} else {
		tmp = (j * a) * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if ((b <= (-1.45d+163)) .or. (.not. (b <= 5.2d+63))) then
        tmp = (i * t) * b
    else
        tmp = (j * a) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((b <= -1.45e+163) || !(b <= 5.2e+63)) {
		tmp = (i * t) * b;
	} else {
		tmp = (j * a) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (b <= -1.45e+163) or not (b <= 5.2e+63):
		tmp = (i * t) * b
	else:
		tmp = (j * a) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((b <= -1.45e+163) || !(b <= 5.2e+63))
		tmp = Float64(Float64(i * t) * b);
	else
		tmp = Float64(Float64(j * a) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if ((b <= -1.45e+163) || ~((b <= 5.2e+63)))
		tmp = (i * t) * b;
	else
		tmp = (j * a) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[b, -1.45e+163], N[Not[LessEqual[b, 5.2e+63]], $MachinePrecision]], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{+163} \lor \neg \left(b \leq 5.2 \cdot 10^{+63}\right):\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.44999999999999999e163 or 5.2000000000000002e63 < b

    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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6467.5

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

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6436.7

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

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

    if -1.44999999999999999e163 < b < 5.2000000000000002e63

    1. Initial program 71.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. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6432.4

        \[\leadsto \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c \]
    5. Applied rewrites32.4%

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

      \[\leadsto \left(a \cdot j\right) \cdot c \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot a\right) \cdot c \]
      2. lower-*.f6420.9

        \[\leadsto \left(j \cdot a\right) \cdot c \]
    8. Applied rewrites20.9%

      \[\leadsto \left(j \cdot a\right) \cdot c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification26.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{+163} \lor \neg \left(b \leq 5.2 \cdot 10^{+63}\right):\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot a\right) \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 29.8% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+98}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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

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


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

    1. Initial program 69.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. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6462.8

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites62.8%

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

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f6448.7

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites48.7%

      \[\leadsto \left(z \cdot y\right) \cdot x \]

    if -1.5000000000000001e98 < z < 1.09999999999999993e-15

    1. Initial program 80.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6427.3

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

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

    if 1.09999999999999993e-15 < z

    1. Initial program 52.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. Add Preprocessing
    3. Taylor expanded in a around 0

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    7. 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. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) \cdot z \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot b\right) \cdot c + x \cdot y\right) \cdot z \]
      8. mul-1-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
      12. lower-*.f6469.7

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
    8. Applied rewrites69.7%

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

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f6438.4

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    11. Applied rewrites38.4%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+98}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-15}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 22.8% accurate, 5.5× 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 72.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. Add Preprocessing
  3. Taylor expanded in b around inf

    \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
  4. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

      \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    8. lower-neg.f6441.4

      \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
  5. Applied rewrites41.4%

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

    \[\leadsto \left(i \cdot t\right) \cdot b \]
  7. Step-by-step derivation
    1. lower-*.f6419.7

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  8. Applied rewrites19.7%

    \[\leadsto \left(i \cdot t\right) \cdot b \]
  9. Final simplification19.7%

    \[\leadsto \left(i \cdot t\right) \cdot b \]
  10. Add Preprocessing

Developer Target 1: 59.0% accurate, 0.2× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = j * ((c * a) - (y * i))
    t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
    if (x < (-1.469694296777705d-64)) then
        tmp = t_2
    else if (x < 3.2113527362226803d-147) then
        tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = j * ((c * a) - (y * i));
	double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
	double tmp;
	if (x < -1.469694296777705e-64) {
		tmp = t_2;
	} else if (x < 3.2113527362226803e-147) {
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = j * ((c * a) - (y * i))
	t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1
	tmp = 0
	if x < -1.469694296777705e-64:
		tmp = t_2
	elif x < 3.2113527362226803e-147:
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i)))
	t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1)
	tmp = 0.0
	if (x < -1.469694296777705e-64)
		tmp = t_2;
	elseif (x < 3.2113527362226803e-147)
		tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - t_1));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = j * ((c * a) - (y * i));
	t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1;
	tmp = 0.0;
	if (x < -1.469694296777705e-64)
		tmp = t_2;
	elseif (x < 3.2113527362226803e-147)
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\

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


\end{array}
\end{array}

Reproduce

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

  :alt
  (! :herbie-platform default (if (< x -293938859355541/2000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 32113527362226803/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))